machvec_init.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * include/asm-sh/machvec_init.h
  3. *
  4. * Copyright 2000 Stuart Menefy (stuart.menefy@st.com)
  5. *
  6. * May be copied or modified under the terms of the GNU General Public
  7. * License. See linux/COPYING for more information.
  8. *
  9. * This file has goodies to help simplify instantiation of machine vectors.
  10. */
  11. #ifndef __SH_MACHVEC_INIT_H
  12. #define __SH_MACHVEC_INIT_H
  13. /*
  14. * In a GENERIC kernel, we have lots of these vectors floating about,
  15. * all but one of which we want to go away. In a non-GENERIC kernel,
  16. * we want only one, ever.
  17. *
  18. * Accomplish this in the GENERIC kernel by puting all of the vectors
  19. * in the .init.data section where they'll go away. We'll copy the
  20. * one we want to the real alpha_mv vector in setup_arch.
  21. *
  22. * Accomplish this in a non-GENERIC kernel by ifdef'ing out all but
  23. * one of the vectors, which will not reside in .init.data. We then
  24. * alias this one vector to alpha_mv, so no copy is needed.
  25. *
  26. * Upshot: set __initdata to nothing for non-GENERIC kernels.
  27. *
  28. * Note we do the same thing for the UNKNOWN kernel, as we need to write
  29. * to the machine vector while setting it up.
  30. */
  31. #if defined(CONFIG_SH_GENERIC) || defined(CONFIG_SH_UNKNOWN)
  32. #define __initmv __attribute__((unused,__section__ (".machvec.init")))
  33. #define ALIAS_MV(x)
  34. #else
  35. #define __initmv
  36. /* GCC actually has a syntax for defining aliases, but is under some
  37. delusion that you shouldn't be able to declare it extern somewhere
  38. else beforehand. Fine. We'll do it ourselves. */
  39. #if 0
  40. #define ALIAS_MV(system) \
  41. struct sh_machine_vector sh_mv __attribute__((alias("mv_"#system)));
  42. #else
  43. #define ALIAS_MV(system) \
  44. asm(".global sh_mv\nsh_mv = mv_"#system );
  45. #endif
  46. #endif /* GENERIC */
  47. #endif /* __SH_MACHVEC_INIT_H */