aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/pci_irq.c
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2005-09-30 19:03:00 -0400
committerLen Brown <len.brown@intel.com>2005-12-10 00:20:25 -0500
commit50eca3eb89d73d9f0aa070b126c7ee6a616016ab (patch)
treeb2d06d21b34b9bd17eea4c53cff1f3866fa1b21d /drivers/acpi/pci_irq.c
parent3d5271f9883cba7b54762bc4fe027d4172f06db7 (diff)
[ACPI] ACPICA 20050930
Completed a major overhaul of the Resource Manager code - specifically, optimizations in the area of the AML/internal resource conversion code. The code has been optimized to simplify and eliminate duplicated code, CPU stack use has been decreased by optimizing function parameters and local variables, and naming conventions across the manager have been standardized for clarity and ease of maintenance (this includes function, parameter, variable, and struct/typedef names.) All Resource Manager dispatch and information tables have been moved to a single location for clarity and ease of maintenance. One new file was created, named "rsinfo.c". The ACPI return macros (return_ACPI_STATUS, etc.) have been modified to guarantee that the argument is not evaluated twice, making them less prone to macro side-effects. However, since there exists the possibility of additional stack use if a particular compiler cannot optimize them (such as in the debug generation case), the original macros are optionally available. Note that some invocations of the return_VALUE macro may now cause size mismatch warnings; the return_UINT8 and return_UINT32 macros are provided to eliminate these. (From Randy Dunlap) Implemented a new mechanism to enable debug tracing for individual control methods. A new external interface, acpi_debug_trace(), is provided to enable this mechanism. The intent is to allow the host OS to easily enable and disable tracing for problematic control methods. This interface can be easily exposed to a user or debugger interface if desired. See the file psxface.c for details. acpi_ut_callocate() will now return a valid pointer if a length of zero is specified - a length of one is used and a warning is issued. This matches the behavior of acpi_ut_allocate(). Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/pci_irq.c')
-rw-r--r--drivers/acpi/pci_irq.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
index 09567c2edcfb..726dda1fce1c 100644
--- a/drivers/acpi/pci_irq.c
+++ b/drivers/acpi/pci_irq.c
@@ -258,7 +258,7 @@ typedef int (*irq_lookup_func) (struct acpi_prt_entry *, int *, int *, char **);
258 258
259static int 259static int
260acpi_pci_allocate_irq(struct acpi_prt_entry *entry, 260acpi_pci_allocate_irq(struct acpi_prt_entry *entry,
261 int *edge_level, int *active_high_low, char **link) 261 int *triggering, int *polarity, char **link)
262{ 262{
263 int irq; 263 int irq;
264 264
@@ -266,8 +266,8 @@ acpi_pci_allocate_irq(struct acpi_prt_entry *entry,
266 266
267 if (entry->link.handle) { 267 if (entry->link.handle) {
268 irq = acpi_pci_link_allocate_irq(entry->link.handle, 268 irq = acpi_pci_link_allocate_irq(entry->link.handle,
269 entry->link.index, edge_level, 269 entry->link.index, triggering,
270 active_high_low, link); 270 polarity, link);
271 if (irq < 0) { 271 if (irq < 0) {
272 ACPI_DEBUG_PRINT((ACPI_DB_WARN, 272 ACPI_DEBUG_PRINT((ACPI_DB_WARN,
273 "Invalid IRQ link routing entry\n")); 273 "Invalid IRQ link routing entry\n"));
@@ -275,8 +275,8 @@ acpi_pci_allocate_irq(struct acpi_prt_entry *entry,
275 } 275 }
276 } else { 276 } else {
277 irq = entry->link.index; 277 irq = entry->link.index;
278 *edge_level = ACPI_LEVEL_SENSITIVE; 278 *triggering = ACPI_LEVEL_SENSITIVE;
279 *active_high_low = ACPI_ACTIVE_LOW; 279 *polarity = ACPI_ACTIVE_LOW;
280 } 280 }
281 281
282 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found IRQ %d\n", irq)); 282 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found IRQ %d\n", irq));
@@ -285,7 +285,7 @@ acpi_pci_allocate_irq(struct acpi_prt_entry *entry,
285 285
286static int 286static int
287acpi_pci_free_irq(struct acpi_prt_entry *entry, 287acpi_pci_free_irq(struct acpi_prt_entry *entry,
288 int *edge_level, int *active_high_low, char **link) 288 int *triggering, int *polarity, char **link)
289{ 289{
290 int irq; 290 int irq;
291 291
@@ -307,8 +307,8 @@ static int
307acpi_pci_irq_lookup(struct pci_bus *bus, 307acpi_pci_irq_lookup(struct pci_bus *bus,
308 int device, 308 int device,
309 int pin, 309 int pin,
310 int *edge_level, 310 int *triggering,
311 int *active_high_low, char **link, irq_lookup_func func) 311 int *polarity, char **link, irq_lookup_func func)
312{ 312{
313 struct acpi_prt_entry *entry = NULL; 313 struct acpi_prt_entry *entry = NULL;
314 int segment = pci_domain_nr(bus); 314 int segment = pci_domain_nr(bus);
@@ -327,7 +327,7 @@ acpi_pci_irq_lookup(struct pci_bus *bus,
327 return_VALUE(-1); 327 return_VALUE(-1);
328 } 328 }
329 329
330 ret = func(entry, edge_level, active_high_low, link); 330 ret = func(entry, triggering, polarity, link);
331 return_VALUE(ret); 331 return_VALUE(ret);
332} 332}
333 333
@@ -339,8 +339,8 @@ acpi_pci_irq_lookup(struct pci_bus *bus,
339static int 339static int
340acpi_pci_irq_derive(struct pci_dev *dev, 340acpi_pci_irq_derive(struct pci_dev *dev,
341 int pin, 341 int pin,
342 int *edge_level, 342 int *triggering,
343 int *active_high_low, char **link, irq_lookup_func func) 343 int *polarity, char **link, irq_lookup_func func)
344{ 344{
345 struct pci_dev *bridge = dev; 345 struct pci_dev *bridge = dev;
346 int irq = -1; 346 int irq = -1;
@@ -375,7 +375,7 @@ acpi_pci_irq_derive(struct pci_dev *dev,
375 } 375 }
376 376
377 irq = acpi_pci_irq_lookup(bridge->bus, PCI_SLOT(bridge->devfn), 377 irq = acpi_pci_irq_lookup(bridge->bus, PCI_SLOT(bridge->devfn),
378 pin, edge_level, active_high_low, 378 pin, triggering, polarity,
379 link, func); 379 link, func);
380 } 380 }
381 381
@@ -402,8 +402,8 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
402{ 402{
403 int irq = 0; 403 int irq = 0;
404 u8 pin = 0; 404 u8 pin = 0;
405 int edge_level = ACPI_LEVEL_SENSITIVE; 405 int triggering = ACPI_LEVEL_SENSITIVE;
406 int active_high_low = ACPI_ACTIVE_LOW; 406 int polarity = ACPI_ACTIVE_LOW;
407 char *link = NULL; 407 char *link = NULL;
408 int rc; 408 int rc;
409 409
@@ -432,7 +432,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
432 * values override any BIOS-assigned IRQs set during boot. 432 * values override any BIOS-assigned IRQs set during boot.
433 */ 433 */
434 irq = acpi_pci_irq_lookup(dev->bus, PCI_SLOT(dev->devfn), pin, 434 irq = acpi_pci_irq_lookup(dev->bus, PCI_SLOT(dev->devfn), pin,
435 &edge_level, &active_high_low, &link, 435 &triggering, &polarity, &link,
436 acpi_pci_allocate_irq); 436 acpi_pci_allocate_irq);
437 437
438 /* 438 /*
@@ -440,8 +440,8 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
440 * device's parent bridge. 440 * device's parent bridge.
441 */ 441 */
442 if (irq < 0) 442 if (irq < 0)
443 irq = acpi_pci_irq_derive(dev, pin, &edge_level, 443 irq = acpi_pci_irq_derive(dev, pin, &triggering,
444 &active_high_low, &link, 444 &polarity, &link,
445 acpi_pci_allocate_irq); 445 acpi_pci_allocate_irq);
446 446
447 /* 447 /*
@@ -463,7 +463,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
463 } 463 }
464 } 464 }
465 465
466 rc = acpi_register_gsi(irq, edge_level, active_high_low); 466 rc = acpi_register_gsi(irq, triggering, polarity);
467 if (rc < 0) { 467 if (rc < 0) {
468 printk(KERN_WARNING PREFIX "PCI Interrupt %s[%c]: failed " 468 printk(KERN_WARNING PREFIX "PCI Interrupt %s[%c]: failed "
469 "to register GSI\n", pci_name(dev), ('A' + pin)); 469 "to register GSI\n", pci_name(dev), ('A' + pin));
@@ -478,8 +478,8 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
478 printk("Link [%s] -> ", link); 478 printk("Link [%s] -> ", link);
479 479
480 printk("GSI %u (%s, %s) -> IRQ %d\n", irq, 480 printk("GSI %u (%s, %s) -> IRQ %d\n", irq,
481 (edge_level == ACPI_LEVEL_SENSITIVE) ? "level" : "edge", 481 (triggering == ACPI_LEVEL_SENSITIVE) ? "level" : "edge",
482 (active_high_low == ACPI_ACTIVE_LOW) ? "low" : "high", dev->irq); 482 (polarity == ACPI_ACTIVE_LOW) ? "low" : "high", dev->irq);
483 483
484 return_VALUE(0); 484 return_VALUE(0);
485} 485}
@@ -495,8 +495,8 @@ void acpi_pci_irq_disable(struct pci_dev *dev)
495{ 495{
496 int gsi = 0; 496 int gsi = 0;
497 u8 pin = 0; 497 u8 pin = 0;
498 int edge_level = ACPI_LEVEL_SENSITIVE; 498 int triggering = ACPI_LEVEL_SENSITIVE;
499 int active_high_low = ACPI_ACTIVE_LOW; 499 int polarity = ACPI_ACTIVE_LOW;
500 500
501 ACPI_FUNCTION_TRACE("acpi_pci_irq_disable"); 501 ACPI_FUNCTION_TRACE("acpi_pci_irq_disable");
502 502
@@ -512,7 +512,7 @@ void acpi_pci_irq_disable(struct pci_dev *dev)
512 * First we check the PCI IRQ routing table (PRT) for an IRQ. 512 * First we check the PCI IRQ routing table (PRT) for an IRQ.
513 */ 513 */
514 gsi = acpi_pci_irq_lookup(dev->bus, PCI_SLOT(dev->devfn), pin, 514 gsi = acpi_pci_irq_lookup(dev->bus, PCI_SLOT(dev->devfn), pin,
515 &edge_level, &active_high_low, NULL, 515 &triggering, &polarity, NULL,
516 acpi_pci_free_irq); 516 acpi_pci_free_irq);
517 /* 517 /*
518 * If no PRT entry was found, we'll try to derive an IRQ from the 518 * If no PRT entry was found, we'll try to derive an IRQ from the
@@ -520,7 +520,7 @@ void acpi_pci_irq_disable(struct pci_dev *dev)
520 */ 520 */
521 if (gsi < 0) 521 if (gsi < 0)
522 gsi = acpi_pci_irq_derive(dev, pin, 522 gsi = acpi_pci_irq_derive(dev, pin,
523 &edge_level, &active_high_low, NULL, 523 &triggering, &polarity, NULL,
524 acpi_pci_free_irq); 524 acpi_pci_free_irq);
525 if (gsi < 0) 525 if (gsi < 0)
526 return_VOID; 526 return_VOID;