asmscall.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * This file is part of Jehanne.
  3. *
  4. * Copyright (C) 2016 Giacomo Tesio <giacomo@tesio.it>
  5. *
  6. * Jehanne is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, version 2 of the License.
  9. *
  10. * Jehanne is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #include <u.h>
  19. #include <lib9.h>
  20. int verbose = 1;
  21. void
  22. main(void)
  23. {
  24. int ret = 0; // success
  25. uint64_t start, end;
  26. char *msg;
  27. start = sys_remove("#c/time");
  28. if (start == -1){
  29. print("FAIL: start: remove #c/time: %r");
  30. exits("FAIL");
  31. }
  32. sleep(1);
  33. end = sys_remove("#c/time");
  34. if (end == -1){
  35. print("end: start: remove #c/time: %r");
  36. exits("FAIL");
  37. }
  38. if (end <= start)
  39. ret = 1;
  40. if (verbose)
  41. print("nsec: start %llx, end %llx\n", start, end);
  42. if(ret){
  43. msg = smprint("nsec: FAIL: start %llx end %llx",
  44. start, end);
  45. print("%s\n", msg);
  46. exits(msg);
  47. }
  48. int fd;
  49. fd = open("#|", ORDWR);
  50. sys_mount(fd, -1, "/tmp", MREPL, "", 'M');
  51. print("PASS\n");
  52. exits("PASS");
  53. }