current.h 922 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /* MN10300 Current task structure accessor
  2. *
  3. * Copyright (C) 2007 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 Licence
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the Licence, or (at your option) any later version.
  10. */
  11. #ifndef _ASM_CURRENT_H
  12. #define _ASM_CURRENT_H
  13. #include <linux/thread_info.h>
  14. /*
  15. * dedicate E2 to keeping the current task pointer
  16. */
  17. #ifdef CONFIG_MN10300_CURRENT_IN_E2
  18. register struct task_struct *const current asm("e2") __attribute__((used));
  19. #define get_current() current
  20. extern struct task_struct *__current;
  21. #else
  22. static inline __attribute__((const))
  23. struct task_struct *get_current(void)
  24. {
  25. return current_thread_info()->task;
  26. }
  27. #define current get_current()
  28. #endif
  29. #endif /* _ASM_CURRENT_H */