Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 | |
Paul Mackerras | 0a26b13 | 2006-03-28 10:22:10 +1100 | [diff] [blame] | 11 | /* This is used in arch/ppc/mm/mem_pieces.h */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | struct reg_property { |
| 13 | unsigned int address; |
| 14 | unsigned int size; |
| 15 | }; |
| 16 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | /* |
Paul Mackerras | 0a26b13 | 2006-03-28 10:22:10 +1100 | [diff] [blame] | 18 | * These macros assist in performing the address calculations that we |
| 19 | * need to do to access data when the kernel is running at an address |
| 20 | * that is different from the address that the kernel is linked at. |
| 21 | * The reloc_offset() function returns the difference between these |
| 22 | * two addresses and the macros simplify the process of adding or |
| 23 | * subtracting this offset to/from pointer values. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | */ |
| 25 | extern unsigned long reloc_offset(void); |
| 26 | extern unsigned long add_reloc_offset(unsigned long); |
| 27 | extern unsigned long sub_reloc_offset(unsigned long); |
| 28 | |
| 29 | #define PTRRELOC(x) ((typeof(x))add_reloc_offset((unsigned long)(x))) |
| 30 | #define PTRUNRELOC(x) ((typeof(x))sub_reloc_offset((unsigned long)(x))) |
| 31 | |
Benjamin Herrenschmidt | d1405b8 | 2005-11-23 17:53:42 +1100 | [diff] [blame] | 32 | /* |
Paul Mackerras | 0a26b13 | 2006-03-28 10:22:10 +1100 | [diff] [blame] | 33 | * Fallback definitions since we don't support OF in arch/ppc any more. |
Paul Mackerras | a7fdd90 | 2006-01-15 17:30:44 +1100 | [diff] [blame] | 34 | */ |
| 35 | #define machine_is_compatible(x) 0 |
| 36 | #define of_find_compatible_node(f, t, c) NULL |
Stephen Rothwell | 0e56efc | 2007-04-03 10:54:01 +1000 | [diff] [blame] | 37 | #define of_get_property(p, n, l) NULL |
| 38 | #define get_property(a, b, c) of_get_property((a), (b), (c)) |
Benjamin Herrenschmidt | d1405b8 | 2005-11-23 17:53:42 +1100 | [diff] [blame] | 39 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | #endif /* _PPC_PROM_H */ |
| 41 | #endif /* __KERNEL__ */ |