machvec_init.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. #include <linux/config.h>
  14. /*
  15. * In a GENERIC kernel, we have lots of these vectors floating about,
  16. * all but one of which we want to go away. In a non-GENERIC kernel,
  17. * we want only one, ever.
  18. *
  19. * Accomplish this in the GENERIC kernel by puting all of the vectors
  20. * in the .init.data section where they'll go away. We'll copy the
  21. * one we want to the real alpha_mv vector in setup_arch.
  22. *
  23. * Accomplish this in a non-GENERIC kernel by ifdef'ing out all but
  24. * one of the vectors, which will not reside in .init.data. We then
  25. * alias this one vector to alpha_mv, so no copy is needed.
  26. *
  27. * Upshot: set __initdata to nothing for non-GENERIC kernels.
  28. *
  29. * Note we do the same thing for the UNKNOWN kernel, as we need to write
  30. * to the machine vector while setting it up.
  31. */
  32. #if defined(CONFIG_SH_GENERIC) || defined(CONFIG_SH_UNKNOWN)
  33. #define __initmv __attribute__((unused,__section__ (".machvec.init")))
  34. #define ALIAS_MV(x)
  35. #else
  36. #define __initmv
  37. /* GCC actually has a syntax for defining aliases, but is under some
  38. delusion that you shouldn't be able to declare it extern somewhere
  39. else beforehand. Fine. We'll do it ourselves. */
  40. #if 0
  41. #define ALIAS_MV(system) \
  42. struct sh_machine_vector sh_mv __attribute__((alias("mv_"#system)));
  43. #else
  44. #define ALIAS_MV(system) \
  45. asm(".global sh_mv\nsh_mv = mv_"#system );
  46. #endif
  47. #endif /* GENERIC */
  48. #endif /* __SH_MACHVEC_INIT_H */