File: prom.h

package info (click to toggle)
linux-kernel-headers 2.6.18-7
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 38,648 kB
  • ctags: 300,882
  • sloc: ansic: 461,192; asm: 1,555; cpp: 340; makefile: 312; sh: 110
file content (40 lines) | stat: -rw-r--r-- 1,250 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
 * Definitions for talking to the Open Firmware PROM on
 * Power Macintosh computers.
 *
 * Copyright (C) 1996 Paul Mackerras.
 */
#ifdef __KERNEL__
#ifndef _PPC_PROM_H
#define _PPC_PROM_H

/* This is used in arch/ppc/mm/mem_pieces.h */
struct reg_property {
	unsigned int address;
	unsigned int size;
};

/*
 * These macros assist in performing the address calculations that we
 * need to do to access data when the kernel is running at an address
 * that is different from the address that the kernel is linked at.
 * The reloc_offset() function returns the difference between these
 * two addresses and the macros simplify the process of adding or
 * subtracting this offset to/from pointer values.
 */
extern unsigned long reloc_offset(void);
extern unsigned long add_reloc_offset(unsigned long);
extern unsigned long sub_reloc_offset(unsigned long);

#define PTRRELOC(x)	((typeof(x))add_reloc_offset((unsigned long)(x)))
#define PTRUNRELOC(x)	((typeof(x))sub_reloc_offset((unsigned long)(x)))

/*
 * Fallback definitions since we don't support OF in arch/ppc any more.
 */
#define machine_is_compatible(x)		0
#define of_find_compatible_node(f, t, c)	NULL
#define get_property(p, n, l)			NULL

#endif /* _PPC_PROM_H */
#endif /* __KERNEL__ */