sys_or32.c 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * OpenRISC sys_or32.c
  3. *
  4. * Linux architectural port borrowing liberally from similar works of
  5. * others. All original copyrights apply as per the original source
  6. * declaration.
  7. *
  8. * Modifications for the OpenRISC architecture:
  9. * Copyright (C) 2003 Matjaz Breskvar <phoenix@bsemi.com>
  10. * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se>
  11. *
  12. * This program is free software; you can redistribute it and/or
  13. * modify it under the terms of the GNU General Public License
  14. * as published by the Free Software Foundation; either version
  15. * 2 of the License, or (at your option) any later version.
  16. *
  17. * This file contains various random system calls that
  18. * have a non-standard calling sequence on some platforms.
  19. * Since we don't have to do any backwards compatibility, our
  20. * versions are done in the most "normal" way possible.
  21. */
  22. #include <linux/errno.h>
  23. #include <linux/syscalls.h>
  24. #include <linux/mm.h>
  25. #include <asm/syscalls.h>
  26. /* These are secondary entry points as the primary entry points are defined in
  27. * entry.S where we add the 'regs' parameter value
  28. */
  29. asmlinkage long _sys_clone(unsigned long clone_flags, unsigned long newsp,
  30. int __user *parent_tid, int __user *child_tid,
  31. struct pt_regs *regs)
  32. {
  33. long ret;
  34. /* FIXME: Is alignment necessary? */
  35. /* newsp = ALIGN(newsp, 4); */
  36. if (!newsp)
  37. newsp = regs->sp;
  38. ret = do_fork(clone_flags, newsp, regs, 0, parent_tid, child_tid);
  39. return ret;
  40. }
  41. asmlinkage int _sys_fork(struct pt_regs *regs)
  42. {
  43. #ifdef CONFIG_MMU
  44. return do_fork(SIGCHLD, regs->sp, regs, 0, NULL, NULL);
  45. #else
  46. return -EINVAL;
  47. #endif
  48. }