You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef _UNISTD_H
  2. #define _UNISTD_H
  3. FILE_LICENCE ( GPL2_OR_LATER );
  4. #include <stddef.h>
  5. #include <stdarg.h>
  6. extern int execv ( const char *command, char * const argv[] );
  7. /**
  8. * Execute command
  9. *
  10. * @v command Command name
  11. * @v arg ... Argument list (starting with argv[0])
  12. * @ret rc Command exit status
  13. *
  14. * This is a front end to execv().
  15. */
  16. #define execl( command, arg, ... ) ( { \
  17. char * const argv[] = { (arg), ## __VA_ARGS__ }; \
  18. int rc = execv ( (command), argv ); \
  19. rc; \
  20. } )
  21. /* Pick up udelay() */
  22. #include <ipxe/timer.h>
  23. /*
  24. * sleep() prototype is defined by POSIX.1. usleep() prototype is
  25. * defined by 4.3BSD. udelay() and mdelay() prototypes are chosen to
  26. * be reasonably sensible.
  27. *
  28. */
  29. extern unsigned int sleep ( unsigned int seconds );
  30. extern void mdelay ( unsigned long msecs );
  31. static inline __always_inline void usleep ( unsigned long usecs ) {
  32. udelay ( usecs );
  33. }
  34. #endif /* _UNISTD_H */