diff options
author | Suresh Siddha <suresh.b.siddha@intel.com> | 2008-07-10 14:16:38 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-12 02:44:49 -0400 |
commit | aaa9d1dd63bf89b62f4ea9f46de376ab1a3fbc6c (patch) | |
tree | 918c5fc937ea45f26660742a0a9a0d6c22df68f1 /drivers/pci/dmar.c | |
parent | 1886e8a90a580f3ad343f2065c84c1b9e1dac9ef (diff) |
x64, x2apic/intr-remap: use CONFIG_DMAR for DMA-remapping specific code
DMA remapping specific code covered with CONFIG_DMAR in
the generic code which will also be used later for enabling Interrupt-remapping.
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: akpm@linux-foundation.org
Cc: arjan@linux.intel.com
Cc: andi@firstfloor.org
Cc: ebiederm@xmission.com
Cc: jbarnes@virtuousgeek.org
Cc: steiner@sgi.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/pci/dmar.c')
-rw-r--r-- | drivers/pci/dmar.c | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/drivers/pci/dmar.c b/drivers/pci/dmar.c index 158bc5bfcf75..5c99f9973987 100644 --- a/drivers/pci/dmar.c +++ b/drivers/pci/dmar.c | |||
@@ -39,7 +39,6 @@ | |||
39 | * these units are not supported by the architecture. | 39 | * these units are not supported by the architecture. |
40 | */ | 40 | */ |
41 | LIST_HEAD(dmar_drhd_units); | 41 | LIST_HEAD(dmar_drhd_units); |
42 | LIST_HEAD(dmar_rmrr_units); | ||
43 | 42 | ||
44 | static struct acpi_table_header * __initdata dmar_tbl; | 43 | static struct acpi_table_header * __initdata dmar_tbl; |
45 | 44 | ||
@@ -55,11 +54,6 @@ static void __init dmar_register_drhd_unit(struct dmar_drhd_unit *drhd) | |||
55 | list_add(&drhd->list, &dmar_drhd_units); | 54 | list_add(&drhd->list, &dmar_drhd_units); |
56 | } | 55 | } |
57 | 56 | ||
58 | static void __init dmar_register_rmrr_unit(struct dmar_rmrr_unit *rmrr) | ||
59 | { | ||
60 | list_add(&rmrr->list, &dmar_rmrr_units); | ||
61 | } | ||
62 | |||
63 | static int __init dmar_parse_one_dev_scope(struct acpi_dmar_device_scope *scope, | 57 | static int __init dmar_parse_one_dev_scope(struct acpi_dmar_device_scope *scope, |
64 | struct pci_dev **dev, u16 segment) | 58 | struct pci_dev **dev, u16 segment) |
65 | { | 59 | { |
@@ -224,6 +218,15 @@ dmar_parse_dev(struct dmar_drhd_unit *dmaru) | |||
224 | return ret; | 218 | return ret; |
225 | } | 219 | } |
226 | 220 | ||
221 | #ifdef CONFIG_DMAR | ||
222 | LIST_HEAD(dmar_rmrr_units); | ||
223 | |||
224 | static void __init dmar_register_rmrr_unit(struct dmar_rmrr_unit *rmrr) | ||
225 | { | ||
226 | list_add(&rmrr->list, &dmar_rmrr_units); | ||
227 | } | ||
228 | |||
229 | |||
227 | static int __init | 230 | static int __init |
228 | dmar_parse_one_rmrr(struct acpi_dmar_header *header) | 231 | dmar_parse_one_rmrr(struct acpi_dmar_header *header) |
229 | { | 232 | { |
@@ -260,6 +263,7 @@ rmrr_parse_dev(struct dmar_rmrr_unit *rmrru) | |||
260 | } | 263 | } |
261 | return ret; | 264 | return ret; |
262 | } | 265 | } |
266 | #endif | ||
263 | 267 | ||
264 | static void __init | 268 | static void __init |
265 | dmar_table_print_dmar_entry(struct acpi_dmar_header *header) | 269 | dmar_table_print_dmar_entry(struct acpi_dmar_header *header) |
@@ -284,6 +288,7 @@ dmar_table_print_dmar_entry(struct acpi_dmar_header *header) | |||
284 | } | 288 | } |
285 | } | 289 | } |
286 | 290 | ||
291 | |||
287 | /** | 292 | /** |
288 | * parse_dmar_table - parses the DMA reporting table | 293 | * parse_dmar_table - parses the DMA reporting table |
289 | */ | 294 | */ |
@@ -316,7 +321,9 @@ parse_dmar_table(void) | |||
316 | ret = dmar_parse_one_drhd(entry_header); | 321 | ret = dmar_parse_one_drhd(entry_header); |
317 | break; | 322 | break; |
318 | case ACPI_DMAR_TYPE_RESERVED_MEMORY: | 323 | case ACPI_DMAR_TYPE_RESERVED_MEMORY: |
324 | #ifdef CONFIG_DMAR | ||
319 | ret = dmar_parse_one_rmrr(entry_header); | 325 | ret = dmar_parse_one_rmrr(entry_header); |
326 | #endif | ||
320 | break; | 327 | break; |
321 | default: | 328 | default: |
322 | printk(KERN_WARNING PREFIX | 329 | printk(KERN_WARNING PREFIX |
@@ -366,7 +373,6 @@ dmar_find_matched_drhd_unit(struct pci_dev *dev) | |||
366 | int __init dmar_dev_scope_init(void) | 373 | int __init dmar_dev_scope_init(void) |
367 | { | 374 | { |
368 | struct dmar_drhd_unit *drhd; | 375 | struct dmar_drhd_unit *drhd; |
369 | struct dmar_rmrr_unit *rmrr; | ||
370 | int ret = -ENODEV; | 376 | int ret = -ENODEV; |
371 | 377 | ||
372 | for_each_drhd_unit(drhd) { | 378 | for_each_drhd_unit(drhd) { |
@@ -375,11 +381,16 @@ int __init dmar_dev_scope_init(void) | |||
375 | return ret; | 381 | return ret; |
376 | } | 382 | } |
377 | 383 | ||
378 | for_each_rmrr_units(rmrr) { | 384 | #ifdef CONFIG_DMAR |
379 | ret = rmrr_parse_dev(rmrr); | 385 | { |
380 | if (ret) | 386 | struct dmar_rmrr_unit *rmrr; |
381 | return ret; | 387 | for_each_rmrr_units(rmrr) { |
388 | ret = rmrr_parse_dev(rmrr); | ||
389 | if (ret) | ||
390 | return ret; | ||
391 | } | ||
382 | } | 392 | } |
393 | #endif | ||
383 | 394 | ||
384 | return ret; | 395 | return ret; |
385 | } | 396 | } |
@@ -407,10 +418,12 @@ int __init dmar_table_init(void) | |||
407 | return -ENODEV; | 418 | return -ENODEV; |
408 | } | 419 | } |
409 | 420 | ||
421 | #ifdef CONFIG_DMAR | ||
410 | if (list_empty(&dmar_rmrr_units)) { | 422 | if (list_empty(&dmar_rmrr_units)) { |
411 | printk(KERN_INFO PREFIX "No RMRR found\n"); | 423 | printk(KERN_INFO PREFIX "No RMRR found\n"); |
412 | return -ENODEV; | 424 | return -ENODEV; |
413 | } | 425 | } |
426 | #endif | ||
414 | 427 | ||
415 | return 0; | 428 | return 0; |
416 | } | 429 | } |