1 | /* address.h |
---|
2 | * |
---|
3 | * This include file contains the information required to manipulate |
---|
4 | * physical addresses. |
---|
5 | * |
---|
6 | * COPYRIGHT (c) 1988-1998. |
---|
7 | * On-Line Applications Research Corporation (OAR). |
---|
8 | * All rights reserved. |
---|
9 | * |
---|
10 | * $Id$ |
---|
11 | */ |
---|
12 | |
---|
13 | #ifndef __ADDRESSES_h |
---|
14 | #define __ADDRESSES_h |
---|
15 | |
---|
16 | /* |
---|
17 | * _Addresses_Add_offset |
---|
18 | * |
---|
19 | * DESCRIPTION: |
---|
20 | * |
---|
21 | * This function is used to add an offset to a base address. |
---|
22 | * It returns the resulting address. This address is typically |
---|
23 | * converted to an access type before being used further. |
---|
24 | */ |
---|
25 | |
---|
26 | STATIC INLINE void *_Addresses_Add_offset ( |
---|
27 | void *base, |
---|
28 | unsigned32 offset |
---|
29 | ); |
---|
30 | |
---|
31 | /* |
---|
32 | * _Addresses_Subtract_offset |
---|
33 | * |
---|
34 | * DESCRIPTION: |
---|
35 | * |
---|
36 | * This function is used to subtract an offset from a base |
---|
37 | * address. It returns the resulting address. This address is |
---|
38 | * typically converted to an access type before being used further. |
---|
39 | */ |
---|
40 | |
---|
41 | STATIC INLINE void *_Addresses_Subtract_offset( |
---|
42 | void *base, |
---|
43 | unsigned32 offset |
---|
44 | ); |
---|
45 | |
---|
46 | /* |
---|
47 | * _Addresses_Add |
---|
48 | * |
---|
49 | * DESCRIPTION: |
---|
50 | * |
---|
51 | * This function is used to add two addresses. It returns the |
---|
52 | * resulting address. This address is typically converted to an |
---|
53 | * access type before being used further. |
---|
54 | */ |
---|
55 | |
---|
56 | STATIC INLINE void *_Addresses_Add ( |
---|
57 | void *left, |
---|
58 | void *right |
---|
59 | ); |
---|
60 | |
---|
61 | /* |
---|
62 | * _Addresses_Subtract |
---|
63 | * |
---|
64 | * DESCRIPTION: |
---|
65 | * |
---|
66 | * This function is used to subtract two addresses. It returns the |
---|
67 | * resulting offset. |
---|
68 | */ |
---|
69 | |
---|
70 | STATIC INLINE unsigned32 _Addresses_Subtract ( |
---|
71 | void *left, |
---|
72 | void *right |
---|
73 | ); |
---|
74 | |
---|
75 | /* |
---|
76 | * _Addresses_Is_aligned |
---|
77 | * |
---|
78 | * DESCRIPTION: |
---|
79 | * |
---|
80 | * This function returns TRUE if the given address is correctly |
---|
81 | * aligned for this processor and FALSE otherwise. Proper alignment |
---|
82 | * is based on correctness and efficiency. |
---|
83 | */ |
---|
84 | |
---|
85 | STATIC INLINE boolean _Addresses_Is_aligned ( |
---|
86 | void *address |
---|
87 | ); |
---|
88 | |
---|
89 | /* |
---|
90 | * _Addresses_Is_in_range |
---|
91 | * |
---|
92 | * DESCRIPTION: |
---|
93 | * |
---|
94 | * This function returns TRUE if the given address is within the |
---|
95 | * memory range specified and FALSE otherwise. base is the address |
---|
96 | * of the first byte in the memory range and limit is the address |
---|
97 | * of the last byte in the memory range. The base address is |
---|
98 | * assumed to be lower than the limit address. |
---|
99 | */ |
---|
100 | |
---|
101 | STATIC INLINE boolean _Addresses_Is_in_range ( |
---|
102 | void *address, |
---|
103 | void *base, |
---|
104 | void *limit |
---|
105 | ); |
---|
106 | |
---|
107 | #include "address.inl" |
---|
108 | |
---|
109 | #endif |
---|
110 | /* end of include file */ |
---|