mips_machine.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
  3. *
  4. * This program is free software; you can redistribute it and/or modify it
  5. * under the terms of the GNU General Public License version 2 as published
  6. * by the Free Software Foundation.
  7. *
  8. */
  9. #ifndef __ASM_MIPS_MACHINE_H
  10. #define __ASM_MIPS_MACHINE_H
  11. #include <linux/init.h>
  12. #include <linux/stddef.h>
  13. #include <asm/bootinfo.h>
  14. struct mips_machine {
  15. unsigned long mach_type;
  16. const char *mach_id;
  17. const char *mach_name;
  18. void (*mach_setup)(void);
  19. };
  20. #define MIPS_MACHINE(_type, _id, _name, _setup) \
  21. static const char machine_name_##_type[] __initconst \
  22. __aligned(1) = _name; \
  23. static const char machine_id_##_type[] __initconst \
  24. __aligned(1) = _id; \
  25. static struct mips_machine machine_##_type \
  26. __used __section(.mips.machines.init) = \
  27. { \
  28. .mach_type = _type, \
  29. .mach_id = machine_id_##_type, \
  30. .mach_name = machine_name_##_type, \
  31. .mach_setup = _setup, \
  32. };
  33. extern long __mips_machines_start;
  34. extern long __mips_machines_end;
  35. #ifdef CONFIG_MIPS_MACHINE
  36. int mips_machtype_setup(char *id) __init;
  37. void mips_machine_setup(void) __init;
  38. #else
  39. static inline int mips_machtype_setup(char *id) { return 1; }
  40. static inline void mips_machine_setup(void) { }
  41. #endif /* CONFIG_MIPS_MACHINE */
  42. #endif /* __ASM_MIPS_MACHINE_H */