sys_avr32.c 642 B

12345678910111213141516171819202122
  1. /*
  2. * Copyright (C) 2004-2006 Atmel Corporation
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. */
  8. #include <linux/unistd.h>
  9. int kernel_execve(const char *file, char **argv, char **envp)
  10. {
  11. register long scno asm("r8") = __NR_execve;
  12. register long sc1 asm("r12") = (long)file;
  13. register long sc2 asm("r11") = (long)argv;
  14. register long sc3 asm("r10") = (long)envp;
  15. asm volatile("scall"
  16. : "=r"(sc1)
  17. : "r"(scno), "0"(sc1), "r"(sc2), "r"(sc3)
  18. : "cc", "memory");
  19. return sc1;
  20. }