diff options
Diffstat (limited to 'arch/parisc/kernel/inventory.c')
-rw-r--r-- | arch/parisc/kernel/inventory.c | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/arch/parisc/kernel/inventory.c b/arch/parisc/kernel/inventory.c index bd1f7f1ff74e..d228d8237879 100644 --- a/arch/parisc/kernel/inventory.c +++ b/arch/parisc/kernel/inventory.c | |||
@@ -170,23 +170,27 @@ static void __init pagezero_memconfig(void) | |||
170 | static int __init | 170 | static int __init |
171 | pat_query_module(ulong pcell_loc, ulong mod_index) | 171 | pat_query_module(ulong pcell_loc, ulong mod_index) |
172 | { | 172 | { |
173 | pdc_pat_cell_mod_maddr_block_t pa_pdc_cell; | 173 | pdc_pat_cell_mod_maddr_block_t *pa_pdc_cell; |
174 | unsigned long bytecnt; | 174 | unsigned long bytecnt; |
175 | unsigned long temp; /* 64-bit scratch value */ | 175 | unsigned long temp; /* 64-bit scratch value */ |
176 | long status; /* PDC return value status */ | 176 | long status; /* PDC return value status */ |
177 | struct parisc_device *dev; | 177 | struct parisc_device *dev; |
178 | 178 | ||
179 | pa_pdc_cell = kmalloc(sizeof (*pa_pdc_cell), GFP_KERNEL); | ||
180 | if (!pa_pdc_cell) | ||
181 | panic("couldn't allocate memory for PDC_PAT_CELL!"); | ||
182 | |||
179 | /* return cell module (PA or Processor view) */ | 183 | /* return cell module (PA or Processor view) */ |
180 | status = pdc_pat_cell_module(&bytecnt, pcell_loc, mod_index, | 184 | status = pdc_pat_cell_module(&bytecnt, pcell_loc, mod_index, |
181 | PA_VIEW, &pa_pdc_cell); | 185 | PA_VIEW, pa_pdc_cell); |
182 | 186 | ||
183 | if (status != PDC_OK) { | 187 | if (status != PDC_OK) { |
184 | /* no more cell modules or error */ | 188 | /* no more cell modules or error */ |
185 | return status; | 189 | return status; |
186 | } | 190 | } |
187 | 191 | ||
188 | temp = pa_pdc_cell.cba; | 192 | temp = pa_pdc_cell->cba; |
189 | dev = alloc_pa_dev(PAT_GET_CBA(temp), &pa_pdc_cell.mod_path); | 193 | dev = alloc_pa_dev(PAT_GET_CBA(temp), &(pa_pdc_cell->mod_path)); |
190 | if (!dev) { | 194 | if (!dev) { |
191 | return PDC_OK; | 195 | return PDC_OK; |
192 | } | 196 | } |
@@ -203,8 +207,8 @@ pat_query_module(ulong pcell_loc, ulong mod_index) | |||
203 | 207 | ||
204 | /* save generic info returned from the call */ | 208 | /* save generic info returned from the call */ |
205 | /* REVISIT: who is the consumer of this? not sure yet... */ | 209 | /* REVISIT: who is the consumer of this? not sure yet... */ |
206 | dev->mod_info = pa_pdc_cell.mod_info; /* pass to PAT_GET_ENTITY() */ | 210 | dev->mod_info = pa_pdc_cell->mod_info; /* pass to PAT_GET_ENTITY() */ |
207 | dev->pmod_loc = pa_pdc_cell.mod_location; | 211 | dev->pmod_loc = pa_pdc_cell->mod_location; |
208 | 212 | ||
209 | register_parisc_device(dev); /* advertise device */ | 213 | register_parisc_device(dev); /* advertise device */ |
210 | 214 | ||
@@ -216,14 +220,14 @@ pat_query_module(ulong pcell_loc, ulong mod_index) | |||
216 | 220 | ||
217 | case PAT_ENTITY_PROC: | 221 | case PAT_ENTITY_PROC: |
218 | printk(KERN_DEBUG "PAT_ENTITY_PROC: id_eid 0x%lx\n", | 222 | printk(KERN_DEBUG "PAT_ENTITY_PROC: id_eid 0x%lx\n", |
219 | pa_pdc_cell.mod[0]); | 223 | pa_pdc_cell->mod[0]); |
220 | break; | 224 | break; |
221 | 225 | ||
222 | case PAT_ENTITY_MEM: | 226 | case PAT_ENTITY_MEM: |
223 | printk(KERN_DEBUG | 227 | printk(KERN_DEBUG |
224 | "PAT_ENTITY_MEM: amount 0x%lx min_gni_base 0x%lx min_gni_len 0x%lx\n", | 228 | "PAT_ENTITY_MEM: amount 0x%lx min_gni_base 0x%lx min_gni_len 0x%lx\n", |
225 | pa_pdc_cell.mod[0], pa_pdc_cell.mod[1], | 229 | pa_pdc_cell->mod[0], pa_pdc_cell->mod[1], |
226 | pa_pdc_cell.mod[2]); | 230 | pa_pdc_cell->mod[2]); |
227 | break; | 231 | break; |
228 | case PAT_ENTITY_CA: | 232 | case PAT_ENTITY_CA: |
229 | printk(KERN_DEBUG "PAT_ENTITY_CA: %ld\n", pcell_loc); | 233 | printk(KERN_DEBUG "PAT_ENTITY_CA: %ld\n", pcell_loc); |
@@ -243,23 +247,26 @@ pat_query_module(ulong pcell_loc, ulong mod_index) | |||
243 | print_ranges: | 247 | print_ranges: |
244 | pdc_pat_cell_module(&bytecnt, pcell_loc, mod_index, | 248 | pdc_pat_cell_module(&bytecnt, pcell_loc, mod_index, |
245 | IO_VIEW, &io_pdc_cell); | 249 | IO_VIEW, &io_pdc_cell); |
246 | printk(KERN_DEBUG "ranges %ld\n", pa_pdc_cell.mod[1]); | 250 | printk(KERN_DEBUG "ranges %ld\n", pa_pdc_cell->mod[1]); |
247 | for (i = 0; i < pa_pdc_cell.mod[1]; i++) { | 251 | for (i = 0; i < pa_pdc_cell->mod[1]; i++) { |
248 | printk(KERN_DEBUG | 252 | printk(KERN_DEBUG |
249 | " PA_VIEW %ld: 0x%016lx 0x%016lx 0x%016lx\n", | 253 | " PA_VIEW %ld: 0x%016lx 0x%016lx 0x%016lx\n", |
250 | i, pa_pdc_cell.mod[2 + i * 3], /* type */ | 254 | i, pa_pdc_cell->mod[2 + i * 3], /* type */ |
251 | pa_pdc_cell.mod[3 + i * 3], /* start */ | 255 | pa_pdc_cell->mod[3 + i * 3], /* start */ |
252 | pa_pdc_cell.mod[4 + i * 3]); /* finish (ie end) */ | 256 | pa_pdc_cell->mod[4 + i * 3]); /* finish (ie end) */ |
253 | printk(KERN_DEBUG | 257 | printk(KERN_DEBUG |
254 | " IO_VIEW %ld: 0x%016lx 0x%016lx 0x%016lx\n", | 258 | " IO_VIEW %ld: 0x%016lx 0x%016lx 0x%016lx\n", |
255 | i, io_pdc_cell.mod[2 + i * 3], /* type */ | 259 | i, io_pdc_cell->mod[2 + i * 3], /* type */ |
256 | io_pdc_cell.mod[3 + i * 3], /* start */ | 260 | io_pdc_cell->mod[3 + i * 3], /* start */ |
257 | io_pdc_cell.mod[4 + i * 3]); /* finish (ie end) */ | 261 | io_pdc_cell->mod[4 + i * 3]); /* finish (ie end) */ |
258 | } | 262 | } |
259 | printk(KERN_DEBUG "\n"); | 263 | printk(KERN_DEBUG "\n"); |
260 | break; | 264 | break; |
261 | } | 265 | } |
262 | #endif /* DEBUG_PAT */ | 266 | #endif /* DEBUG_PAT */ |
267 | |||
268 | kfree(pa_pdc_cell); | ||
269 | |||
263 | return PDC_OK; | 270 | return PDC_OK; |
264 | } | 271 | } |
265 | 272 | ||