kernel_execve.S 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. /* in-kernel program execution
  2. *
  3. * Copyright (C) 2006 Red Hat, Inc. All Rights Reserved.
  4. * Written by David Howells (dhowells@redhat.com)
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the License, or (at your option) any later version.
  10. */
  11. #include <linux/linkage.h>
  12. #include <asm/unistd.h>
  13. ###############################################################################
  14. #
  15. # Do a system call from kernel instead of calling sys_execve so we end up with
  16. # proper pt_regs.
  17. #
  18. # int kernel_execve(const char *filename, char *const argv[], char *const envp[])
  19. #
  20. # On entry: GR8/GR9/GR10: arguments to function
  21. # On return: GR8: syscall return.
  22. #
  23. ###############################################################################
  24. .globl kernel_execve
  25. .type kernel_execve,@function
  26. kernel_execve:
  27. setlos __NR_execve,gr7
  28. tira gr0,#0
  29. bralr
  30. .size kernel_execve,.-kernel_execve