current.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * include/asm-v850/current.h -- Current task
  3. *
  4. * Copyright (C) 2001,02 NEC Corporation
  5. * Copyright (C) 2001,02 Miles Bader <miles@gnu.org>
  6. *
  7. * This file is subject to the terms and conditions of the GNU General
  8. * Public License. See the file COPYING in the main directory of this
  9. * archive for more details.
  10. *
  11. * Written by Miles Bader <miles@gnu.org>
  12. */
  13. #ifndef __V850_CURRENT_H__
  14. #define __V850_CURRENT_H__
  15. #ifndef __ASSEMBLY__ /* <linux/thread_info.h> is not asm-safe. */
  16. #include <linux/thread_info.h>
  17. #endif
  18. #include <asm/macrology.h>
  19. /* Register used to hold the current task pointer while in the kernel.
  20. Any `call clobbered' register without a special meaning should be OK,
  21. but check asm/v850/kernel/entry.S to be sure. */
  22. #define CURRENT_TASK_REGNUM 16
  23. #define CURRENT_TASK macrology_paste (r, CURRENT_TASK_REGNUM)
  24. #ifdef __ASSEMBLY__
  25. /* Put a pointer to the current task structure into REG. */
  26. #define GET_CURRENT_TASK(reg) \
  27. GET_CURRENT_THREAD(reg); \
  28. ld.w TI_TASK[reg], reg
  29. #else /* !__ASSEMBLY__ */
  30. /* A pointer to the current task. */
  31. register struct task_struct *current \
  32. __asm__ (macrology_stringify (CURRENT_TASK));
  33. #endif /* __ASSEMBLY__ */
  34. #endif /* _V850_CURRENT_H */