prom.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * Definitions for talking to the Open Firmware PROM on
  3. * Power Macintosh computers.
  4. *
  5. * Copyright (C) 1996 Paul Mackerras.
  6. */
  7. #ifdef __KERNEL__
  8. #ifndef _PPC_PROM_H
  9. #define _PPC_PROM_H
  10. /* This is used in arch/ppc/mm/mem_pieces.h */
  11. struct reg_property {
  12. unsigned int address;
  13. unsigned int size;
  14. };
  15. /*
  16. * These macros assist in performing the address calculations that we
  17. * need to do to access data when the kernel is running at an address
  18. * that is different from the address that the kernel is linked at.
  19. * The reloc_offset() function returns the difference between these
  20. * two addresses and the macros simplify the process of adding or
  21. * subtracting this offset to/from pointer values.
  22. */
  23. extern unsigned long reloc_offset(void);
  24. extern unsigned long add_reloc_offset(unsigned long);
  25. extern unsigned long sub_reloc_offset(unsigned long);
  26. #define PTRRELOC(x) ((typeof(x))add_reloc_offset((unsigned long)(x)))
  27. #define PTRUNRELOC(x) ((typeof(x))sub_reloc_offset((unsigned long)(x)))
  28. /*
  29. * Fallback definitions since we don't support OF in arch/ppc any more.
  30. */
  31. #define machine_is_compatible(x) 0
  32. #define of_find_compatible_node(f, t, c) NULL
  33. #define get_property(p, n, l) NULL
  34. #endif /* _PPC_PROM_H */
  35. #endif /* __KERNEL__ */