diff options
-rw-r--r-- | drivers/firmware/memmap.c | 16 | ||||
-rw-r--r-- | include/linux/firmware-map.h | 12 |
2 files changed, 13 insertions, 15 deletions
diff --git a/drivers/firmware/memmap.c b/drivers/firmware/memmap.c index 05aa2d406ac6..d5ea8a68d338 100644 --- a/drivers/firmware/memmap.c +++ b/drivers/firmware/memmap.c | |||
@@ -31,8 +31,12 @@ | |||
31 | * information is necessary as for the resource tree. | 31 | * information is necessary as for the resource tree. |
32 | */ | 32 | */ |
33 | struct firmware_map_entry { | 33 | struct firmware_map_entry { |
34 | resource_size_t start; /* start of the memory range */ | 34 | /* |
35 | resource_size_t end; /* end of the memory range (incl.) */ | 35 | * start and end must be u64 rather than resource_size_t, because e820 |
36 | * resources can lie at addresses above 4G. | ||
37 | */ | ||
38 | u64 start; /* start of the memory range */ | ||
39 | u64 end; /* end of the memory range (incl.) */ | ||
36 | const char *type; /* type of the memory range */ | 40 | const char *type; /* type of the memory range */ |
37 | struct list_head list; /* entry for the linked list */ | 41 | struct list_head list; /* entry for the linked list */ |
38 | struct kobject kobj; /* kobject for each entry */ | 42 | struct kobject kobj; /* kobject for each entry */ |
@@ -101,7 +105,7 @@ static LIST_HEAD(map_entries); | |||
101 | * Common implementation of firmware_map_add() and firmware_map_add_early() | 105 | * Common implementation of firmware_map_add() and firmware_map_add_early() |
102 | * which expects a pre-allocated struct firmware_map_entry. | 106 | * which expects a pre-allocated struct firmware_map_entry. |
103 | **/ | 107 | **/ |
104 | static int firmware_map_add_entry(resource_size_t start, resource_size_t end, | 108 | static int firmware_map_add_entry(u64 start, u64 end, |
105 | const char *type, | 109 | const char *type, |
106 | struct firmware_map_entry *entry) | 110 | struct firmware_map_entry *entry) |
107 | { | 111 | { |
@@ -132,8 +136,7 @@ static int firmware_map_add_entry(resource_size_t start, resource_size_t end, | |||
132 | * | 136 | * |
133 | * Returns 0 on success, or -ENOMEM if no memory could be allocated. | 137 | * Returns 0 on success, or -ENOMEM if no memory could be allocated. |
134 | **/ | 138 | **/ |
135 | int firmware_map_add(resource_size_t start, resource_size_t end, | 139 | int firmware_map_add(u64 start, u64 end, const char *type) |
136 | const char *type) | ||
137 | { | 140 | { |
138 | struct firmware_map_entry *entry; | 141 | struct firmware_map_entry *entry; |
139 | 142 | ||
@@ -157,8 +160,7 @@ int firmware_map_add(resource_size_t start, resource_size_t end, | |||
157 | * | 160 | * |
158 | * Returns 0 on success, or -ENOMEM if no memory could be allocated. | 161 | * Returns 0 on success, or -ENOMEM if no memory could be allocated. |
159 | **/ | 162 | **/ |
160 | int __init firmware_map_add_early(resource_size_t start, resource_size_t end, | 163 | int __init firmware_map_add_early(u64 start, u64 end, const char *type) |
161 | const char *type) | ||
162 | { | 164 | { |
163 | struct firmware_map_entry *entry; | 165 | struct firmware_map_entry *entry; |
164 | 166 | ||
diff --git a/include/linux/firmware-map.h b/include/linux/firmware-map.h index cca686b39123..875451f1373a 100644 --- a/include/linux/firmware-map.h +++ b/include/linux/firmware-map.h | |||
@@ -24,21 +24,17 @@ | |||
24 | */ | 24 | */ |
25 | #ifdef CONFIG_FIRMWARE_MEMMAP | 25 | #ifdef CONFIG_FIRMWARE_MEMMAP |
26 | 26 | ||
27 | int firmware_map_add(resource_size_t start, resource_size_t end, | 27 | int firmware_map_add(u64 start, u64 end, const char *type); |
28 | const char *type); | 28 | int firmware_map_add_early(u64 start, u64 end, const char *type); |
29 | int firmware_map_add_early(resource_size_t start, resource_size_t end, | ||
30 | const char *type); | ||
31 | 29 | ||
32 | #else /* CONFIG_FIRMWARE_MEMMAP */ | 30 | #else /* CONFIG_FIRMWARE_MEMMAP */ |
33 | 31 | ||
34 | static inline int firmware_map_add(resource_size_t start, resource_size_t end, | 32 | static inline int firmware_map_add(u64 start, u64 end, const char *type) |
35 | const char *type) | ||
36 | { | 33 | { |
37 | return 0; | 34 | return 0; |
38 | } | 35 | } |
39 | 36 | ||
40 | static inline int firmware_map_add_early(resource_size_t start, | 37 | static inline int firmware_map_add_early(u64 start, u64 end, const char *type) |
41 | resource_size_t end, const char *type) | ||
42 | { | 38 | { |
43 | return 0; | 39 | return 0; |
44 | } | 40 | } |