2005-04-17 00:20:36 +02:00
|
|
|
/*
|
|
|
|
* pnpacpi -- PnP ACPI driver
|
|
|
|
*
|
|
|
|
* Copyright (c) 2004 Matthieu Castet <castet.matthieu@free.fr>
|
|
|
|
* Copyright (c) 2004 Li Shaohua <shaohua.li@intel.com>
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
*
|
2005-04-17 00:20:36 +02:00
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation; either version 2, or (at your option) any
|
|
|
|
* later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/acpi.h>
|
|
|
|
#include <linux/pci.h>
|
|
|
|
#include "pnpacpi.h"
|
|
|
|
|
|
|
|
#ifdef CONFIG_IA64
|
|
|
|
#define valid_IRQ(i) (1)
|
|
|
|
#else
|
|
|
|
#define valid_IRQ(i) (((i) != 0) && ((i) != 2))
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Allocated Resources
|
|
|
|
*/
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
static int irq_flags(int triggering, int polarity)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
if (triggering == ACPI_LEVEL_SENSITIVE) {
|
2006-03-29 00:04:00 +02:00
|
|
|
if (polarity == ACPI_ACTIVE_LOW)
|
2007-08-15 18:32:09 +02:00
|
|
|
return IORESOURCE_IRQ_LOWLEVEL;
|
2005-04-17 00:20:36 +02:00
|
|
|
else
|
2007-08-15 18:32:09 +02:00
|
|
|
return IORESOURCE_IRQ_HIGHLEVEL;
|
2007-07-26 19:41:20 +02:00
|
|
|
} else {
|
2006-03-29 00:04:00 +02:00
|
|
|
if (polarity == ACPI_ACTIVE_LOW)
|
2007-08-15 18:32:09 +02:00
|
|
|
return IORESOURCE_IRQ_LOWEDGE;
|
2005-04-17 00:20:36 +02:00
|
|
|
else
|
2007-08-15 18:32:09 +02:00
|
|
|
return IORESOURCE_IRQ_HIGHEDGE;
|
2005-04-17 00:20:36 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
static void decode_irq_flags(int flag, int *triggering, int *polarity)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
|
|
|
switch (flag) {
|
|
|
|
case IORESOURCE_IRQ_LOWLEVEL:
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
*triggering = ACPI_LEVEL_SENSITIVE;
|
|
|
|
*polarity = ACPI_ACTIVE_LOW;
|
2005-04-17 00:20:36 +02:00
|
|
|
break;
|
2006-03-29 00:04:00 +02:00
|
|
|
case IORESOURCE_IRQ_HIGHLEVEL:
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
*triggering = ACPI_LEVEL_SENSITIVE;
|
|
|
|
*polarity = ACPI_ACTIVE_HIGH;
|
2005-04-17 00:20:36 +02:00
|
|
|
break;
|
|
|
|
case IORESOURCE_IRQ_LOWEDGE:
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
*triggering = ACPI_EDGE_SENSITIVE;
|
|
|
|
*polarity = ACPI_ACTIVE_LOW;
|
2005-04-17 00:20:36 +02:00
|
|
|
break;
|
|
|
|
case IORESOURCE_IRQ_HIGHEDGE:
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
*triggering = ACPI_EDGE_SENSITIVE;
|
|
|
|
*polarity = ACPI_ACTIVE_HIGH;
|
2005-04-17 00:20:36 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-07-26 19:41:21 +02:00
|
|
|
static void pnpacpi_parse_allocated_irqresource(struct pnp_resource_table *res,
|
|
|
|
u32 gsi, int triggering,
|
|
|
|
int polarity, int shareable)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
|
|
|
int i = 0;
|
2005-09-03 06:37:56 +02:00
|
|
|
int irq;
|
|
|
|
|
|
|
|
if (!valid_IRQ(gsi))
|
|
|
|
return;
|
|
|
|
|
2005-04-17 00:20:36 +02:00
|
|
|
while (!(res->irq_resource[i].flags & IORESOURCE_UNSET) &&
|
2007-07-26 19:41:20 +02:00
|
|
|
i < PNP_MAX_IRQ)
|
2005-04-17 00:20:36 +02:00
|
|
|
i++;
|
2005-09-03 06:37:56 +02:00
|
|
|
if (i >= PNP_MAX_IRQ)
|
|
|
|
return;
|
|
|
|
|
2007-07-26 19:41:20 +02:00
|
|
|
res->irq_resource[i].flags = IORESOURCE_IRQ; // Also clears _UNSET flag
|
2007-03-09 05:29:29 +01:00
|
|
|
res->irq_resource[i].flags |= irq_flags(triggering, polarity);
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
irq = acpi_register_gsi(gsi, triggering, polarity);
|
2005-09-03 06:37:56 +02:00
|
|
|
if (irq < 0) {
|
|
|
|
res->irq_resource[i].flags |= IORESOURCE_DISABLED;
|
|
|
|
return;
|
2005-04-17 00:20:36 +02:00
|
|
|
}
|
2005-09-03 06:37:56 +02:00
|
|
|
|
2006-07-03 09:24:10 +02:00
|
|
|
if (shareable)
|
|
|
|
res->irq_resource[i].flags |= IORESOURCE_IRQ_SHAREABLE;
|
|
|
|
|
2005-09-03 06:37:56 +02:00
|
|
|
res->irq_resource[i].start = irq;
|
|
|
|
res->irq_resource[i].end = irq;
|
|
|
|
pcibios_penalize_isa_irq(irq, 1);
|
2005-04-17 00:20:36 +02:00
|
|
|
}
|
|
|
|
|
2007-03-09 05:29:29 +01:00
|
|
|
static int dma_flags(int type, int bus_master, int transfer)
|
|
|
|
{
|
|
|
|
int flags = 0;
|
|
|
|
|
|
|
|
if (bus_master)
|
|
|
|
flags |= IORESOURCE_DMA_MASTER;
|
|
|
|
switch (type) {
|
|
|
|
case ACPI_COMPATIBILITY:
|
|
|
|
flags |= IORESOURCE_DMA_COMPATIBLE;
|
|
|
|
break;
|
|
|
|
case ACPI_TYPE_A:
|
|
|
|
flags |= IORESOURCE_DMA_TYPEA;
|
|
|
|
break;
|
|
|
|
case ACPI_TYPE_B:
|
|
|
|
flags |= IORESOURCE_DMA_TYPEB;
|
|
|
|
break;
|
|
|
|
case ACPI_TYPE_F:
|
|
|
|
flags |= IORESOURCE_DMA_TYPEF;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
/* Set a default value ? */
|
|
|
|
flags |= IORESOURCE_DMA_COMPATIBLE;
|
|
|
|
pnp_err("Invalid DMA type");
|
|
|
|
}
|
|
|
|
switch (transfer) {
|
|
|
|
case ACPI_TRANSFER_8:
|
|
|
|
flags |= IORESOURCE_DMA_8BIT;
|
|
|
|
break;
|
|
|
|
case ACPI_TRANSFER_8_16:
|
|
|
|
flags |= IORESOURCE_DMA_8AND16BIT;
|
|
|
|
break;
|
|
|
|
case ACPI_TRANSFER_16:
|
|
|
|
flags |= IORESOURCE_DMA_16BIT;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
/* Set a default value ? */
|
|
|
|
flags |= IORESOURCE_DMA_8AND16BIT;
|
|
|
|
pnp_err("Invalid DMA transfer type");
|
|
|
|
}
|
|
|
|
|
|
|
|
return flags;
|
|
|
|
}
|
|
|
|
|
2007-07-26 19:41:21 +02:00
|
|
|
static void pnpacpi_parse_allocated_dmaresource(struct pnp_resource_table *res,
|
|
|
|
u32 dma, int type,
|
|
|
|
int bus_master, int transfer)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
|
|
|
int i = 0;
|
2007-07-26 19:41:21 +02:00
|
|
|
|
2005-05-01 17:59:30 +02:00
|
|
|
while (i < PNP_MAX_DMA &&
|
2007-07-26 19:41:20 +02:00
|
|
|
!(res->dma_resource[i].flags & IORESOURCE_UNSET))
|
2005-04-17 00:20:36 +02:00
|
|
|
i++;
|
|
|
|
if (i < PNP_MAX_DMA) {
|
2007-07-26 19:41:20 +02:00
|
|
|
res->dma_resource[i].flags = IORESOURCE_DMA; // Also clears _UNSET flag
|
|
|
|
res->dma_resource[i].flags |=
|
|
|
|
dma_flags(type, bus_master, transfer);
|
2005-04-17 00:20:36 +02:00
|
|
|
if (dma == -1) {
|
|
|
|
res->dma_resource[i].flags |= IORESOURCE_DISABLED;
|
|
|
|
return;
|
|
|
|
}
|
2005-09-03 06:37:56 +02:00
|
|
|
res->dma_resource[i].start = dma;
|
|
|
|
res->dma_resource[i].end = dma;
|
2005-04-17 00:20:36 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-07-26 19:41:21 +02:00
|
|
|
static void pnpacpi_parse_allocated_ioresource(struct pnp_resource_table *res,
|
|
|
|
u64 io, u64 len, int io_decode)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
|
|
|
int i = 0;
|
2007-07-26 19:41:21 +02:00
|
|
|
|
2005-04-17 00:20:36 +02:00
|
|
|
while (!(res->port_resource[i].flags & IORESOURCE_UNSET) &&
|
2007-07-26 19:41:20 +02:00
|
|
|
i < PNP_MAX_PORT)
|
2005-04-17 00:20:36 +02:00
|
|
|
i++;
|
|
|
|
if (i < PNP_MAX_PORT) {
|
2007-07-26 19:41:20 +02:00
|
|
|
res->port_resource[i].flags = IORESOURCE_IO; // Also clears _UNSET flag
|
2007-03-09 05:29:29 +01:00
|
|
|
if (io_decode == ACPI_DECODE_16)
|
|
|
|
res->port_resource[i].flags |= PNP_PORT_FLAG_16BITADDR;
|
2007-07-26 19:41:20 +02:00
|
|
|
if (len <= 0 || (io + len - 1) >= 0x10003) {
|
2005-04-17 00:20:36 +02:00
|
|
|
res->port_resource[i].flags |= IORESOURCE_DISABLED;
|
|
|
|
return;
|
|
|
|
}
|
2005-09-03 06:37:56 +02:00
|
|
|
res->port_resource[i].start = io;
|
|
|
|
res->port_resource[i].end = io + len - 1;
|
2005-04-17 00:20:36 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-07-26 19:41:21 +02:00
|
|
|
static void pnpacpi_parse_allocated_memresource(struct pnp_resource_table *res,
|
|
|
|
u64 mem, u64 len,
|
|
|
|
int write_protect)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
|
|
|
int i = 0;
|
2007-07-26 19:41:21 +02:00
|
|
|
|
2005-04-17 00:20:36 +02:00
|
|
|
while (!(res->mem_resource[i].flags & IORESOURCE_UNSET) &&
|
2007-07-26 19:41:20 +02:00
|
|
|
(i < PNP_MAX_MEM))
|
2005-04-17 00:20:36 +02:00
|
|
|
i++;
|
|
|
|
if (i < PNP_MAX_MEM) {
|
2007-07-26 19:41:20 +02:00
|
|
|
res->mem_resource[i].flags = IORESOURCE_MEM; // Also clears _UNSET flag
|
2005-04-17 00:20:36 +02:00
|
|
|
if (len <= 0) {
|
|
|
|
res->mem_resource[i].flags |= IORESOURCE_DISABLED;
|
|
|
|
return;
|
|
|
|
}
|
2007-07-26 19:41:20 +02:00
|
|
|
if (write_protect == ACPI_READ_WRITE_MEMORY)
|
2007-03-09 05:29:29 +01:00
|
|
|
res->mem_resource[i].flags |= IORESOURCE_MEM_WRITEABLE;
|
|
|
|
|
2005-09-03 06:37:56 +02:00
|
|
|
res->mem_resource[i].start = mem;
|
|
|
|
res->mem_resource[i].end = mem + len - 1;
|
2005-04-17 00:20:36 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-07-26 19:41:21 +02:00
|
|
|
static void pnpacpi_parse_allocated_address_space(struct pnp_resource_table *res_table,
|
|
|
|
struct acpi_resource *res)
|
2006-03-29 00:03:00 +02:00
|
|
|
{
|
|
|
|
struct acpi_resource_address64 addr, *p = &addr;
|
|
|
|
acpi_status status;
|
|
|
|
|
|
|
|
status = acpi_resource_to_address64(res, p);
|
|
|
|
if (!ACPI_SUCCESS(status)) {
|
|
|
|
pnp_warn("PnPACPI: failed to convert resource type %d",
|
2007-07-26 19:41:20 +02:00
|
|
|
res->type);
|
2006-03-29 00:03:00 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2006-08-05 21:15:12 +02:00
|
|
|
if (p->producer_consumer == ACPI_PRODUCER)
|
|
|
|
return;
|
|
|
|
|
2006-03-29 00:03:00 +02:00
|
|
|
if (p->resource_type == ACPI_MEMORY_RANGE)
|
|
|
|
pnpacpi_parse_allocated_memresource(res_table,
|
2007-07-26 19:41:21 +02:00
|
|
|
p->minimum, p->address_length,
|
|
|
|
p->info.mem.write_protect);
|
2006-03-29 00:03:00 +02:00
|
|
|
else if (p->resource_type == ACPI_IO_RANGE)
|
|
|
|
pnpacpi_parse_allocated_ioresource(res_table,
|
2007-07-26 19:41:21 +02:00
|
|
|
p->minimum, p->address_length,
|
|
|
|
p->granularity == 0xfff ? ACPI_DECODE_10 :
|
|
|
|
ACPI_DECODE_16);
|
2006-03-29 00:03:00 +02:00
|
|
|
}
|
2005-04-17 00:20:36 +02:00
|
|
|
|
|
|
|
static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
|
2007-07-26 19:41:20 +02:00
|
|
|
void *data)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
2007-07-26 19:41:20 +02:00
|
|
|
struct pnp_resource_table *res_table =
|
|
|
|
(struct pnp_resource_table *)data;
|
2005-09-03 06:37:56 +02:00
|
|
|
int i;
|
2005-04-17 00:20:36 +02:00
|
|
|
|
2005-09-22 06:25:18 +02:00
|
|
|
switch (res->type) {
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
case ACPI_RESOURCE_TYPE_IRQ:
|
2005-09-03 06:37:56 +02:00
|
|
|
/*
|
|
|
|
* Per spec, only one interrupt per descriptor is allowed in
|
|
|
|
* _CRS, but some firmware violates this, so parse them all.
|
|
|
|
*/
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
for (i = 0; i < res->data.irq.interrupt_count; i++) {
|
2005-09-03 06:37:56 +02:00
|
|
|
pnpacpi_parse_allocated_irqresource(res_table,
|
2007-07-26 19:41:21 +02:00
|
|
|
res->data.irq.interrupts[i],
|
|
|
|
res->data.irq.triggering,
|
|
|
|
res->data.irq.polarity,
|
|
|
|
res->data.irq.sharable);
|
2005-04-17 00:20:36 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
case ACPI_RESOURCE_TYPE_DMA:
|
|
|
|
if (res->data.dma.channel_count > 0)
|
|
|
|
pnpacpi_parse_allocated_dmaresource(res_table,
|
2007-07-26 19:41:21 +02:00
|
|
|
res->data.dma.channels[0],
|
|
|
|
res->data.dma.type,
|
|
|
|
res->data.dma.bus_master,
|
|
|
|
res->data.dma.transfer);
|
2005-04-17 00:20:36 +02:00
|
|
|
break;
|
2006-01-20 07:11:37 +01:00
|
|
|
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
case ACPI_RESOURCE_TYPE_IO:
|
|
|
|
pnpacpi_parse_allocated_ioresource(res_table,
|
2007-07-26 19:41:21 +02:00
|
|
|
res->data.io.minimum,
|
|
|
|
res->data.io.address_length,
|
|
|
|
res->data.io.io_decode);
|
2005-04-17 00:20:36 +02:00
|
|
|
break;
|
2006-01-20 07:11:37 +01:00
|
|
|
|
|
|
|
case ACPI_RESOURCE_TYPE_START_DEPENDENT:
|
|
|
|
case ACPI_RESOURCE_TYPE_END_DEPENDENT:
|
|
|
|
break;
|
|
|
|
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
case ACPI_RESOURCE_TYPE_FIXED_IO:
|
|
|
|
pnpacpi_parse_allocated_ioresource(res_table,
|
2007-07-26 19:41:21 +02:00
|
|
|
res->data.fixed_io.address,
|
|
|
|
res->data.fixed_io.address_length,
|
|
|
|
ACPI_DECODE_10);
|
2005-04-17 00:20:36 +02:00
|
|
|
break;
|
2006-01-20 07:11:37 +01:00
|
|
|
|
|
|
|
case ACPI_RESOURCE_TYPE_VENDOR:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ACPI_RESOURCE_TYPE_END_TAG:
|
|
|
|
break;
|
|
|
|
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
case ACPI_RESOURCE_TYPE_MEMORY24:
|
|
|
|
pnpacpi_parse_allocated_memresource(res_table,
|
2007-07-26 19:41:21 +02:00
|
|
|
res->data.memory24.minimum,
|
|
|
|
res->data.memory24.address_length,
|
|
|
|
res->data.memory24.write_protect);
|
2005-04-17 00:20:36 +02:00
|
|
|
break;
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
case ACPI_RESOURCE_TYPE_MEMORY32:
|
|
|
|
pnpacpi_parse_allocated_memresource(res_table,
|
2007-07-26 19:41:21 +02:00
|
|
|
res->data.memory32.minimum,
|
|
|
|
res->data.memory32.address_length,
|
|
|
|
res->data.memory32.write_protect);
|
2005-04-17 00:20:36 +02:00
|
|
|
break;
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
case ACPI_RESOURCE_TYPE_FIXED_MEMORY32:
|
|
|
|
pnpacpi_parse_allocated_memresource(res_table,
|
2007-07-26 19:41:21 +02:00
|
|
|
res->data.fixed_memory32.address,
|
|
|
|
res->data.fixed_memory32.address_length,
|
|
|
|
res->data.fixed_memory32.write_protect);
|
2005-04-17 00:20:36 +02:00
|
|
|
break;
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
case ACPI_RESOURCE_TYPE_ADDRESS16:
|
|
|
|
case ACPI_RESOURCE_TYPE_ADDRESS32:
|
|
|
|
case ACPI_RESOURCE_TYPE_ADDRESS64:
|
2006-03-29 00:03:00 +02:00
|
|
|
pnpacpi_parse_allocated_address_space(res_table, res);
|
2005-04-17 00:20:36 +02:00
|
|
|
break;
|
2006-01-20 07:11:37 +01:00
|
|
|
|
|
|
|
case ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64:
|
2006-08-05 21:15:12 +02:00
|
|
|
if (res->data.ext_address64.producer_consumer == ACPI_PRODUCER)
|
|
|
|
return AE_OK;
|
2006-01-20 07:11:37 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
|
2006-08-05 21:15:12 +02:00
|
|
|
if (res->data.extended_irq.producer_consumer == ACPI_PRODUCER)
|
|
|
|
return AE_OK;
|
|
|
|
|
2006-01-20 07:11:37 +01:00
|
|
|
for (i = 0; i < res->data.extended_irq.interrupt_count; i++) {
|
|
|
|
pnpacpi_parse_allocated_irqresource(res_table,
|
2007-07-26 19:41:21 +02:00
|
|
|
res->data.extended_irq.interrupts[i],
|
|
|
|
res->data.extended_irq.triggering,
|
|
|
|
res->data.extended_irq.polarity,
|
|
|
|
res->data.extended_irq.sharable);
|
2006-01-20 07:11:37 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ACPI_RESOURCE_TYPE_GENERIC_REGISTER:
|
2005-04-17 00:20:36 +02:00
|
|
|
break;
|
2006-01-20 07:11:37 +01:00
|
|
|
|
2005-04-17 00:20:36 +02:00
|
|
|
default:
|
2005-09-22 06:25:18 +02:00
|
|
|
pnp_warn("PnPACPI: unknown resource type %d", res->type);
|
2005-04-17 00:20:36 +02:00
|
|
|
return AE_ERROR;
|
|
|
|
}
|
2006-03-29 00:04:00 +02:00
|
|
|
|
2005-04-17 00:20:36 +02:00
|
|
|
return AE_OK;
|
|
|
|
}
|
|
|
|
|
2007-07-26 19:41:20 +02:00
|
|
|
acpi_status pnpacpi_parse_allocated_resource(acpi_handle handle,
|
|
|
|
struct pnp_resource_table * res)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
|
|
|
/* Blank the resource table values */
|
|
|
|
pnp_init_resource_table(res);
|
|
|
|
|
2007-07-26 19:41:20 +02:00
|
|
|
return acpi_walk_resources(handle, METHOD_NAME__CRS,
|
|
|
|
pnpacpi_allocated_resource, res);
|
2005-04-17 00:20:36 +02:00
|
|
|
}
|
|
|
|
|
2007-07-26 19:41:20 +02:00
|
|
|
static void pnpacpi_parse_dma_option(struct pnp_option *option,
|
|
|
|
struct acpi_resource_dma *p)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
|
|
|
int i;
|
2007-07-26 19:41:20 +02:00
|
|
|
struct pnp_dma *dma;
|
2005-04-17 00:20:36 +02:00
|
|
|
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
if (p->channel_count == 0)
|
2005-04-17 00:20:36 +02:00
|
|
|
return;
|
2006-12-13 09:34:52 +01:00
|
|
|
dma = kzalloc(sizeof(struct pnp_dma), GFP_KERNEL);
|
2005-04-17 00:20:36 +02:00
|
|
|
if (!dma)
|
|
|
|
return;
|
|
|
|
|
2007-07-26 19:41:20 +02:00
|
|
|
for (i = 0; i < p->channel_count; i++)
|
2005-04-17 00:20:36 +02:00
|
|
|
dma->map |= 1 << p->channels[i];
|
2007-03-09 05:29:29 +01:00
|
|
|
|
|
|
|
dma->flags = dma_flags(p->type, p->bus_master, p->transfer);
|
2005-04-17 00:20:36 +02:00
|
|
|
|
2006-03-29 00:04:00 +02:00
|
|
|
pnp_register_dma_resource(option, dma);
|
2005-04-17 00:20:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void pnpacpi_parse_irq_option(struct pnp_option *option,
|
2007-07-26 19:41:20 +02:00
|
|
|
struct acpi_resource_irq *p)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
|
|
|
int i;
|
2006-03-29 00:04:00 +02:00
|
|
|
struct pnp_irq *irq;
|
|
|
|
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
if (p->interrupt_count == 0)
|
2005-04-17 00:20:36 +02:00
|
|
|
return;
|
2006-12-13 09:34:52 +01:00
|
|
|
irq = kzalloc(sizeof(struct pnp_irq), GFP_KERNEL);
|
2005-04-17 00:20:36 +02:00
|
|
|
if (!irq)
|
|
|
|
return;
|
|
|
|
|
2007-07-26 19:41:20 +02:00
|
|
|
for (i = 0; i < p->interrupt_count; i++)
|
2005-04-17 00:20:36 +02:00
|
|
|
if (p->interrupts[i])
|
|
|
|
__set_bit(p->interrupts[i], irq->map);
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
irq->flags = irq_flags(p->triggering, p->polarity);
|
2005-04-17 00:20:36 +02:00
|
|
|
|
|
|
|
pnp_register_irq_resource(option, irq);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void pnpacpi_parse_ext_irq_option(struct pnp_option *option,
|
2007-07-26 19:41:20 +02:00
|
|
|
struct acpi_resource_extended_irq *p)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
|
|
|
int i;
|
2006-03-29 00:04:00 +02:00
|
|
|
struct pnp_irq *irq;
|
2005-04-17 00:20:36 +02:00
|
|
|
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
if (p->interrupt_count == 0)
|
2005-04-17 00:20:36 +02:00
|
|
|
return;
|
2006-12-13 09:34:52 +01:00
|
|
|
irq = kzalloc(sizeof(struct pnp_irq), GFP_KERNEL);
|
2005-04-17 00:20:36 +02:00
|
|
|
if (!irq)
|
|
|
|
return;
|
|
|
|
|
2007-07-26 19:41:20 +02:00
|
|
|
for (i = 0; i < p->interrupt_count; i++)
|
2005-04-17 00:20:36 +02:00
|
|
|
if (p->interrupts[i])
|
|
|
|
__set_bit(p->interrupts[i], irq->map);
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
irq->flags = irq_flags(p->triggering, p->polarity);
|
2005-04-17 00:20:36 +02:00
|
|
|
|
|
|
|
pnp_register_irq_resource(option, irq);
|
|
|
|
}
|
|
|
|
|
2007-07-26 19:41:21 +02:00
|
|
|
static void pnpacpi_parse_port_option(struct pnp_option *option,
|
|
|
|
struct acpi_resource_io *io)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
2006-03-29 00:04:00 +02:00
|
|
|
struct pnp_port *port;
|
2005-04-17 00:20:36 +02:00
|
|
|
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
if (io->address_length == 0)
|
2005-04-17 00:20:36 +02:00
|
|
|
return;
|
2006-12-13 09:34:52 +01:00
|
|
|
port = kzalloc(sizeof(struct pnp_port), GFP_KERNEL);
|
2005-04-17 00:20:36 +02:00
|
|
|
if (!port)
|
|
|
|
return;
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
port->min = io->minimum;
|
|
|
|
port->max = io->maximum;
|
2005-04-17 00:20:36 +02:00
|
|
|
port->align = io->alignment;
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
port->size = io->address_length;
|
|
|
|
port->flags = ACPI_DECODE_16 == io->io_decode ?
|
2007-07-26 19:41:20 +02:00
|
|
|
PNP_PORT_FLAG_16BITADDR : 0;
|
2006-03-29 00:04:00 +02:00
|
|
|
pnp_register_port_resource(option, port);
|
2005-04-17 00:20:36 +02:00
|
|
|
}
|
|
|
|
|
2007-07-26 19:41:21 +02:00
|
|
|
static void pnpacpi_parse_fixed_port_option(struct pnp_option *option,
|
|
|
|
struct acpi_resource_fixed_io *io)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
2006-03-29 00:04:00 +02:00
|
|
|
struct pnp_port *port;
|
2005-04-17 00:20:36 +02:00
|
|
|
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
if (io->address_length == 0)
|
2005-04-17 00:20:36 +02:00
|
|
|
return;
|
2006-12-13 09:34:52 +01:00
|
|
|
port = kzalloc(sizeof(struct pnp_port), GFP_KERNEL);
|
2005-04-17 00:20:36 +02:00
|
|
|
if (!port)
|
|
|
|
return;
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
port->min = port->max = io->address;
|
|
|
|
port->size = io->address_length;
|
2005-04-17 00:20:36 +02:00
|
|
|
port->align = 0;
|
|
|
|
port->flags = PNP_PORT_FLAG_FIXED;
|
2006-03-29 00:04:00 +02:00
|
|
|
pnp_register_port_resource(option, port);
|
2005-04-17 00:20:36 +02:00
|
|
|
}
|
|
|
|
|
2007-07-26 19:41:21 +02:00
|
|
|
static void pnpacpi_parse_mem24_option(struct pnp_option *option,
|
|
|
|
struct acpi_resource_memory24 *p)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
2006-03-29 00:04:00 +02:00
|
|
|
struct pnp_mem *mem;
|
2005-04-17 00:20:36 +02:00
|
|
|
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
if (p->address_length == 0)
|
2005-04-17 00:20:36 +02:00
|
|
|
return;
|
2006-12-13 09:34:52 +01:00
|
|
|
mem = kzalloc(sizeof(struct pnp_mem), GFP_KERNEL);
|
2005-04-17 00:20:36 +02:00
|
|
|
if (!mem)
|
|
|
|
return;
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
mem->min = p->minimum;
|
|
|
|
mem->max = p->maximum;
|
2005-04-17 00:20:36 +02:00
|
|
|
mem->align = p->alignment;
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
mem->size = p->address_length;
|
2005-04-17 00:20:36 +02:00
|
|
|
|
2005-10-21 06:00:00 +02:00
|
|
|
mem->flags = (ACPI_READ_WRITE_MEMORY == p->write_protect) ?
|
2007-07-26 19:41:20 +02:00
|
|
|
IORESOURCE_MEM_WRITEABLE : 0;
|
2005-04-17 00:20:36 +02:00
|
|
|
|
2006-03-29 00:04:00 +02:00
|
|
|
pnp_register_mem_resource(option, mem);
|
2005-04-17 00:20:36 +02:00
|
|
|
}
|
|
|
|
|
2007-07-26 19:41:21 +02:00
|
|
|
static void pnpacpi_parse_mem32_option(struct pnp_option *option,
|
|
|
|
struct acpi_resource_memory32 *p)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
2006-03-29 00:04:00 +02:00
|
|
|
struct pnp_mem *mem;
|
2005-04-17 00:20:36 +02:00
|
|
|
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
if (p->address_length == 0)
|
2005-04-17 00:20:36 +02:00
|
|
|
return;
|
2006-12-13 09:34:52 +01:00
|
|
|
mem = kzalloc(sizeof(struct pnp_mem), GFP_KERNEL);
|
2005-04-17 00:20:36 +02:00
|
|
|
if (!mem)
|
|
|
|
return;
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
mem->min = p->minimum;
|
|
|
|
mem->max = p->maximum;
|
2005-04-17 00:20:36 +02:00
|
|
|
mem->align = p->alignment;
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
mem->size = p->address_length;
|
2005-04-17 00:20:36 +02:00
|
|
|
|
2005-10-21 06:00:00 +02:00
|
|
|
mem->flags = (ACPI_READ_WRITE_MEMORY == p->write_protect) ?
|
2007-07-26 19:41:20 +02:00
|
|
|
IORESOURCE_MEM_WRITEABLE : 0;
|
2005-04-17 00:20:36 +02:00
|
|
|
|
2006-03-29 00:04:00 +02:00
|
|
|
pnp_register_mem_resource(option, mem);
|
2005-04-17 00:20:36 +02:00
|
|
|
}
|
|
|
|
|
2007-07-26 19:41:21 +02:00
|
|
|
static void pnpacpi_parse_fixed_mem32_option(struct pnp_option *option,
|
|
|
|
struct acpi_resource_fixed_memory32 *p)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
2006-03-29 00:04:00 +02:00
|
|
|
struct pnp_mem *mem;
|
2005-04-17 00:20:36 +02:00
|
|
|
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
if (p->address_length == 0)
|
2005-04-17 00:20:36 +02:00
|
|
|
return;
|
2006-12-13 09:34:52 +01:00
|
|
|
mem = kzalloc(sizeof(struct pnp_mem), GFP_KERNEL);
|
2005-04-17 00:20:36 +02:00
|
|
|
if (!mem)
|
|
|
|
return;
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
mem->min = mem->max = p->address;
|
|
|
|
mem->size = p->address_length;
|
2005-04-17 00:20:36 +02:00
|
|
|
mem->align = 0;
|
|
|
|
|
2005-10-21 06:00:00 +02:00
|
|
|
mem->flags = (ACPI_READ_WRITE_MEMORY == p->write_protect) ?
|
2007-07-26 19:41:20 +02:00
|
|
|
IORESOURCE_MEM_WRITEABLE : 0;
|
2005-04-17 00:20:36 +02:00
|
|
|
|
2006-03-29 00:04:00 +02:00
|
|
|
pnp_register_mem_resource(option, mem);
|
2005-04-17 00:20:36 +02:00
|
|
|
}
|
|
|
|
|
2007-07-26 19:41:21 +02:00
|
|
|
static void pnpacpi_parse_address_option(struct pnp_option *option,
|
|
|
|
struct acpi_resource *r)
|
2005-09-20 21:26:00 +02:00
|
|
|
{
|
|
|
|
struct acpi_resource_address64 addr, *p = &addr;
|
|
|
|
acpi_status status;
|
2006-03-29 00:04:00 +02:00
|
|
|
struct pnp_mem *mem;
|
|
|
|
struct pnp_port *port;
|
2005-09-20 21:26:00 +02:00
|
|
|
|
|
|
|
status = acpi_resource_to_address64(r, p);
|
|
|
|
if (!ACPI_SUCCESS(status)) {
|
2007-07-26 19:41:20 +02:00
|
|
|
pnp_warn("PnPACPI: failed to convert resource type %d",
|
|
|
|
r->type);
|
2005-09-20 21:26:00 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (p->address_length == 0)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (p->resource_type == ACPI_MEMORY_RANGE) {
|
2006-12-13 09:34:52 +01:00
|
|
|
mem = kzalloc(sizeof(struct pnp_mem), GFP_KERNEL);
|
2005-09-20 21:26:00 +02:00
|
|
|
if (!mem)
|
|
|
|
return;
|
2006-01-07 09:50:18 +01:00
|
|
|
mem->min = mem->max = p->minimum;
|
2005-09-20 21:26:00 +02:00
|
|
|
mem->size = p->address_length;
|
|
|
|
mem->align = 0;
|
2006-01-07 09:50:18 +01:00
|
|
|
mem->flags = (p->info.mem.write_protect ==
|
2007-07-26 19:41:20 +02:00
|
|
|
ACPI_READ_WRITE_MEMORY) ? IORESOURCE_MEM_WRITEABLE
|
|
|
|
: 0;
|
2006-03-29 00:04:00 +02:00
|
|
|
pnp_register_mem_resource(option, mem);
|
2005-09-20 21:26:00 +02:00
|
|
|
} else if (p->resource_type == ACPI_IO_RANGE) {
|
2006-12-13 09:34:52 +01:00
|
|
|
port = kzalloc(sizeof(struct pnp_port), GFP_KERNEL);
|
2005-09-20 21:26:00 +02:00
|
|
|
if (!port)
|
|
|
|
return;
|
2006-01-07 09:50:18 +01:00
|
|
|
port->min = port->max = p->minimum;
|
2005-09-20 21:26:00 +02:00
|
|
|
port->size = p->address_length;
|
|
|
|
port->align = 0;
|
|
|
|
port->flags = PNP_PORT_FLAG_FIXED;
|
2006-03-29 00:04:00 +02:00
|
|
|
pnp_register_port_resource(option, port);
|
2005-09-20 21:26:00 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-04-17 00:20:36 +02:00
|
|
|
struct acpipnp_parse_option_s {
|
|
|
|
struct pnp_option *option;
|
2005-03-25 18:03:15 +01:00
|
|
|
struct pnp_option *option_independent;
|
2005-04-17 00:20:36 +02:00
|
|
|
struct pnp_dev *dev;
|
|
|
|
};
|
|
|
|
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
static acpi_status pnpacpi_option_resource(struct acpi_resource *res,
|
2007-07-26 19:41:20 +02:00
|
|
|
void *data)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
|
|
|
int priority = 0;
|
2007-07-26 19:41:20 +02:00
|
|
|
struct acpipnp_parse_option_s *parse_data =
|
|
|
|
(struct acpipnp_parse_option_s *)data;
|
2005-04-17 00:20:36 +02:00
|
|
|
struct pnp_dev *dev = parse_data->dev;
|
|
|
|
struct pnp_option *option = parse_data->option;
|
|
|
|
|
2005-09-22 06:25:18 +02:00
|
|
|
switch (res->type) {
|
2007-07-26 19:41:20 +02:00
|
|
|
case ACPI_RESOURCE_TYPE_IRQ:
|
|
|
|
pnpacpi_parse_irq_option(option, &res->data.irq);
|
|
|
|
break;
|
2006-01-20 07:11:37 +01:00
|
|
|
|
2007-07-26 19:41:20 +02:00
|
|
|
case ACPI_RESOURCE_TYPE_DMA:
|
|
|
|
pnpacpi_parse_dma_option(option, &res->data.dma);
|
|
|
|
break;
|
2006-01-20 07:11:37 +01:00
|
|
|
|
2007-07-26 19:41:20 +02:00
|
|
|
case ACPI_RESOURCE_TYPE_START_DEPENDENT:
|
|
|
|
switch (res->data.start_dpf.compatibility_priority) {
|
|
|
|
case ACPI_GOOD_CONFIGURATION:
|
|
|
|
priority = PNP_RES_PRIORITY_PREFERRED;
|
2005-04-17 00:20:36 +02:00
|
|
|
break;
|
2006-01-20 07:11:37 +01:00
|
|
|
|
2007-07-26 19:41:20 +02:00
|
|
|
case ACPI_ACCEPTABLE_CONFIGURATION:
|
|
|
|
priority = PNP_RES_PRIORITY_ACCEPTABLE;
|
2005-03-25 18:03:15 +01:00
|
|
|
break;
|
2006-01-20 07:11:37 +01:00
|
|
|
|
2007-07-26 19:41:20 +02:00
|
|
|
case ACPI_SUB_OPTIMAL_CONFIGURATION:
|
|
|
|
priority = PNP_RES_PRIORITY_FUNCTIONAL;
|
2006-01-20 07:11:37 +01:00
|
|
|
break;
|
2007-07-26 19:41:20 +02:00
|
|
|
default:
|
|
|
|
priority = PNP_RES_PRIORITY_INVALID;
|
2006-01-20 07:11:37 +01:00
|
|
|
break;
|
2007-07-26 19:41:20 +02:00
|
|
|
}
|
2007-07-26 19:41:21 +02:00
|
|
|
/* TBD: Consider performance/robustness bits */
|
2007-07-26 19:41:20 +02:00
|
|
|
option = pnp_register_dependent_option(dev, priority);
|
|
|
|
if (!option)
|
|
|
|
return AE_ERROR;
|
|
|
|
parse_data->option = option;
|
|
|
|
break;
|
2006-01-20 07:11:37 +01:00
|
|
|
|
2007-07-26 19:41:20 +02:00
|
|
|
case ACPI_RESOURCE_TYPE_END_DEPENDENT:
|
|
|
|
/*only one EndDependentFn is allowed */
|
|
|
|
if (!parse_data->option_independent) {
|
|
|
|
pnp_warn("PnPACPI: more than one EndDependentFn");
|
|
|
|
return AE_ERROR;
|
|
|
|
}
|
|
|
|
parse_data->option = parse_data->option_independent;
|
|
|
|
parse_data->option_independent = NULL;
|
|
|
|
break;
|
2006-01-20 07:11:37 +01:00
|
|
|
|
2007-07-26 19:41:20 +02:00
|
|
|
case ACPI_RESOURCE_TYPE_IO:
|
|
|
|
pnpacpi_parse_port_option(option, &res->data.io);
|
|
|
|
break;
|
2006-01-20 07:11:37 +01:00
|
|
|
|
2007-07-26 19:41:20 +02:00
|
|
|
case ACPI_RESOURCE_TYPE_FIXED_IO:
|
|
|
|
pnpacpi_parse_fixed_port_option(option, &res->data.fixed_io);
|
|
|
|
break;
|
2006-01-20 07:11:37 +01:00
|
|
|
|
2007-07-26 19:41:20 +02:00
|
|
|
case ACPI_RESOURCE_TYPE_VENDOR:
|
|
|
|
case ACPI_RESOURCE_TYPE_END_TAG:
|
|
|
|
break;
|
2006-01-20 07:11:37 +01:00
|
|
|
|
2007-07-26 19:41:20 +02:00
|
|
|
case ACPI_RESOURCE_TYPE_MEMORY24:
|
|
|
|
pnpacpi_parse_mem24_option(option, &res->data.memory24);
|
|
|
|
break;
|
2006-01-20 07:11:37 +01:00
|
|
|
|
2007-07-26 19:41:20 +02:00
|
|
|
case ACPI_RESOURCE_TYPE_MEMORY32:
|
|
|
|
pnpacpi_parse_mem32_option(option, &res->data.memory32);
|
|
|
|
break;
|
2006-01-20 07:11:37 +01:00
|
|
|
|
2007-07-26 19:41:20 +02:00
|
|
|
case ACPI_RESOURCE_TYPE_FIXED_MEMORY32:
|
|
|
|
pnpacpi_parse_fixed_mem32_option(option,
|
|
|
|
&res->data.fixed_memory32);
|
|
|
|
break;
|
2006-01-20 07:11:37 +01:00
|
|
|
|
2007-07-26 19:41:20 +02:00
|
|
|
case ACPI_RESOURCE_TYPE_ADDRESS16:
|
|
|
|
case ACPI_RESOURCE_TYPE_ADDRESS32:
|
|
|
|
case ACPI_RESOURCE_TYPE_ADDRESS64:
|
|
|
|
pnpacpi_parse_address_option(option, res);
|
|
|
|
break;
|
2006-01-20 07:11:37 +01:00
|
|
|
|
2007-07-26 19:41:20 +02:00
|
|
|
case ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
|
|
|
|
pnpacpi_parse_ext_irq_option(option, &res->data.extended_irq);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ACPI_RESOURCE_TYPE_GENERIC_REGISTER:
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
pnp_warn("PnPACPI: unknown resource type %d", res->type);
|
|
|
|
return AE_ERROR;
|
2005-04-17 00:20:36 +02:00
|
|
|
}
|
2006-03-29 00:04:00 +02:00
|
|
|
|
2005-04-17 00:20:36 +02:00
|
|
|
return AE_OK;
|
|
|
|
}
|
|
|
|
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
acpi_status pnpacpi_parse_resource_option_data(acpi_handle handle,
|
2007-07-26 19:41:20 +02:00
|
|
|
struct pnp_dev * dev)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
|
|
|
acpi_status status;
|
|
|
|
struct acpipnp_parse_option_s parse_data;
|
|
|
|
|
|
|
|
parse_data.option = pnp_register_independent_option(dev);
|
|
|
|
if (!parse_data.option)
|
|
|
|
return AE_ERROR;
|
2005-03-25 18:03:15 +01:00
|
|
|
parse_data.option_independent = parse_data.option;
|
2005-04-17 00:20:36 +02:00
|
|
|
parse_data.dev = dev;
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
status = acpi_walk_resources(handle, METHOD_NAME__PRS,
|
2007-07-26 19:41:20 +02:00
|
|
|
pnpacpi_option_resource, &parse_data);
|
2005-04-17 00:20:36 +02:00
|
|
|
|
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2006-03-29 00:04:00 +02:00
|
|
|
static int pnpacpi_supported_resource(struct acpi_resource *res)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
2005-09-22 06:25:18 +02:00
|
|
|
switch (res->type) {
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
case ACPI_RESOURCE_TYPE_IRQ:
|
|
|
|
case ACPI_RESOURCE_TYPE_DMA:
|
|
|
|
case ACPI_RESOURCE_TYPE_IO:
|
|
|
|
case ACPI_RESOURCE_TYPE_FIXED_IO:
|
|
|
|
case ACPI_RESOURCE_TYPE_MEMORY24:
|
|
|
|
case ACPI_RESOURCE_TYPE_MEMORY32:
|
|
|
|
case ACPI_RESOURCE_TYPE_FIXED_MEMORY32:
|
|
|
|
case ACPI_RESOURCE_TYPE_ADDRESS16:
|
|
|
|
case ACPI_RESOURCE_TYPE_ADDRESS32:
|
|
|
|
case ACPI_RESOURCE_TYPE_ADDRESS64:
|
2006-01-20 07:11:37 +01:00
|
|
|
case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
|
2006-03-29 00:04:00 +02:00
|
|
|
return 1;
|
2005-04-17 00:20:36 +02:00
|
|
|
}
|
2006-03-29 00:04:00 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Set resource
|
|
|
|
*/
|
|
|
|
static acpi_status pnpacpi_count_resources(struct acpi_resource *res,
|
2007-07-26 19:41:20 +02:00
|
|
|
void *data)
|
2006-03-29 00:04:00 +02:00
|
|
|
{
|
|
|
|
int *res_cnt = (int *)data;
|
|
|
|
|
|
|
|
if (pnpacpi_supported_resource(res))
|
|
|
|
(*res_cnt)++;
|
2005-04-17 00:20:36 +02:00
|
|
|
return AE_OK;
|
|
|
|
}
|
|
|
|
|
2006-03-29 00:04:00 +02:00
|
|
|
static acpi_status pnpacpi_type_resources(struct acpi_resource *res, void *data)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
2006-03-29 00:04:00 +02:00
|
|
|
struct acpi_resource **resource = (struct acpi_resource **)data;
|
2006-03-29 00:04:00 +02:00
|
|
|
|
|
|
|
if (pnpacpi_supported_resource(res)) {
|
2005-09-22 06:25:18 +02:00
|
|
|
(*resource)->type = res->type;
|
2006-03-29 00:04:00 +02:00
|
|
|
(*resource)->length = sizeof(struct acpi_resource);
|
2005-04-17 00:20:36 +02:00
|
|
|
(*resource)++;
|
|
|
|
}
|
|
|
|
|
|
|
|
return AE_OK;
|
|
|
|
}
|
|
|
|
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
int pnpacpi_build_resource_template(acpi_handle handle,
|
2007-07-26 19:41:20 +02:00
|
|
|
struct acpi_buffer *buffer)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
|
|
|
struct acpi_resource *resource;
|
|
|
|
int res_cnt = 0;
|
|
|
|
acpi_status status;
|
|
|
|
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
status = acpi_walk_resources(handle, METHOD_NAME__CRS,
|
2007-07-26 19:41:20 +02:00
|
|
|
pnpacpi_count_resources, &res_cnt);
|
2005-04-17 00:20:36 +02:00
|
|
|
if (ACPI_FAILURE(status)) {
|
|
|
|
pnp_err("Evaluate _CRS failed");
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
if (!res_cnt)
|
|
|
|
return -EINVAL;
|
|
|
|
buffer->length = sizeof(struct acpi_resource) * (res_cnt + 1) + 1;
|
2006-12-13 09:34:52 +01:00
|
|
|
buffer->pointer = kzalloc(buffer->length - 1, GFP_KERNEL);
|
2005-04-17 00:20:36 +02:00
|
|
|
if (!buffer->pointer)
|
|
|
|
return -ENOMEM;
|
|
|
|
pnp_dbg("Res cnt %d", res_cnt);
|
|
|
|
resource = (struct acpi_resource *)buffer->pointer;
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
status = acpi_walk_resources(handle, METHOD_NAME__CRS,
|
2007-07-26 19:41:20 +02:00
|
|
|
pnpacpi_type_resources, &resource);
|
2005-04-17 00:20:36 +02:00
|
|
|
if (ACPI_FAILURE(status)) {
|
|
|
|
kfree(buffer->pointer);
|
|
|
|
pnp_err("Evaluate _CRS failed");
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
/* resource will pointer the end resource now */
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
resource->type = ACPI_RESOURCE_TYPE_END_TAG;
|
2005-04-17 00:20:36 +02:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
static void pnpacpi_encode_irq(struct acpi_resource *resource,
|
2007-07-26 19:41:20 +02:00
|
|
|
struct resource *p)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
int triggering, polarity;
|
2006-03-29 00:04:00 +02:00
|
|
|
|
|
|
|
decode_irq_flags(p->flags & IORESOURCE_BITS, &triggering, &polarity);
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
resource->data.irq.triggering = triggering;
|
|
|
|
resource->data.irq.polarity = polarity;
|
|
|
|
if (triggering == ACPI_EDGE_SENSITIVE)
|
|
|
|
resource->data.irq.sharable = ACPI_EXCLUSIVE;
|
2005-04-17 00:20:36 +02:00
|
|
|
else
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
resource->data.irq.sharable = ACPI_SHARED;
|
|
|
|
resource->data.irq.interrupt_count = 1;
|
2005-04-17 00:20:36 +02:00
|
|
|
resource->data.irq.interrupts[0] = p->start;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void pnpacpi_encode_ext_irq(struct acpi_resource *resource,
|
2007-07-26 19:41:20 +02:00
|
|
|
struct resource *p)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
int triggering, polarity;
|
2006-03-29 00:04:00 +02:00
|
|
|
|
|
|
|
decode_irq_flags(p->flags & IORESOURCE_BITS, &triggering, &polarity);
|
2005-04-17 00:20:36 +02:00
|
|
|
resource->data.extended_irq.producer_consumer = ACPI_CONSUMER;
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
resource->data.extended_irq.triggering = triggering;
|
|
|
|
resource->data.extended_irq.polarity = polarity;
|
|
|
|
if (triggering == ACPI_EDGE_SENSITIVE)
|
|
|
|
resource->data.irq.sharable = ACPI_EXCLUSIVE;
|
2005-04-17 00:20:36 +02:00
|
|
|
else
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
resource->data.irq.sharable = ACPI_SHARED;
|
|
|
|
resource->data.extended_irq.interrupt_count = 1;
|
2005-04-17 00:20:36 +02:00
|
|
|
resource->data.extended_irq.interrupts[0] = p->start;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void pnpacpi_encode_dma(struct acpi_resource *resource,
|
2007-07-26 19:41:20 +02:00
|
|
|
struct resource *p)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
|
|
|
/* Note: pnp_assign_dma will copy pnp_dma->flags into p->flags */
|
2006-04-07 20:00:27 +02:00
|
|
|
switch (p->flags & IORESOURCE_DMA_SPEED_MASK) {
|
2007-07-26 19:41:20 +02:00
|
|
|
case IORESOURCE_DMA_TYPEA:
|
|
|
|
resource->data.dma.type = ACPI_TYPE_A;
|
|
|
|
break;
|
|
|
|
case IORESOURCE_DMA_TYPEB:
|
|
|
|
resource->data.dma.type = ACPI_TYPE_B;
|
|
|
|
break;
|
|
|
|
case IORESOURCE_DMA_TYPEF:
|
|
|
|
resource->data.dma.type = ACPI_TYPE_F;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
resource->data.dma.type = ACPI_COMPATIBILITY;
|
2006-04-07 20:00:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
switch (p->flags & IORESOURCE_DMA_TYPE_MASK) {
|
2007-07-26 19:41:20 +02:00
|
|
|
case IORESOURCE_DMA_8BIT:
|
|
|
|
resource->data.dma.transfer = ACPI_TRANSFER_8;
|
|
|
|
break;
|
|
|
|
case IORESOURCE_DMA_8AND16BIT:
|
|
|
|
resource->data.dma.transfer = ACPI_TRANSFER_8_16;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
resource->data.dma.transfer = ACPI_TRANSFER_16;
|
2006-04-07 20:00:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
resource->data.dma.bus_master = !!(p->flags & IORESOURCE_DMA_MASTER);
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
resource->data.dma.channel_count = 1;
|
2005-04-17 00:20:36 +02:00
|
|
|
resource->data.dma.channels[0] = p->start;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void pnpacpi_encode_io(struct acpi_resource *resource,
|
2007-07-26 19:41:20 +02:00
|
|
|
struct resource *p)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
|
|
|
/* Note: pnp_assign_port will copy pnp_port->flags into p->flags */
|
2007-07-26 19:41:20 +02:00
|
|
|
resource->data.io.io_decode = (p->flags & PNP_PORT_FLAG_16BITADDR) ?
|
|
|
|
ACPI_DECODE_16 : ACPI_DECODE_10;
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
resource->data.io.minimum = p->start;
|
|
|
|
resource->data.io.maximum = p->end;
|
2007-07-26 19:41:20 +02:00
|
|
|
resource->data.io.alignment = 0; /* Correct? */
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
resource->data.io.address_length = p->end - p->start + 1;
|
2005-04-17 00:20:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void pnpacpi_encode_fixed_io(struct acpi_resource *resource,
|
2007-07-26 19:41:20 +02:00
|
|
|
struct resource *p)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
resource->data.fixed_io.address = p->start;
|
|
|
|
resource->data.fixed_io.address_length = p->end - p->start + 1;
|
2005-04-17 00:20:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void pnpacpi_encode_mem24(struct acpi_resource *resource,
|
2007-07-26 19:41:20 +02:00
|
|
|
struct resource *p)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
|
|
|
/* Note: pnp_assign_mem will copy pnp_mem->flags into p->flags */
|
2005-10-21 06:00:00 +02:00
|
|
|
resource->data.memory24.write_protect =
|
2007-07-26 19:41:20 +02:00
|
|
|
(p->flags & IORESOURCE_MEM_WRITEABLE) ?
|
|
|
|
ACPI_READ_WRITE_MEMORY : ACPI_READ_ONLY_MEMORY;
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
resource->data.memory24.minimum = p->start;
|
|
|
|
resource->data.memory24.maximum = p->end;
|
2005-04-17 00:20:36 +02:00
|
|
|
resource->data.memory24.alignment = 0;
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
resource->data.memory24.address_length = p->end - p->start + 1;
|
2005-04-17 00:20:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void pnpacpi_encode_mem32(struct acpi_resource *resource,
|
2007-07-26 19:41:20 +02:00
|
|
|
struct resource *p)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
2005-10-21 06:00:00 +02:00
|
|
|
resource->data.memory32.write_protect =
|
2007-07-26 19:41:20 +02:00
|
|
|
(p->flags & IORESOURCE_MEM_WRITEABLE) ?
|
|
|
|
ACPI_READ_WRITE_MEMORY : ACPI_READ_ONLY_MEMORY;
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
resource->data.memory32.minimum = p->start;
|
|
|
|
resource->data.memory32.maximum = p->end;
|
2005-04-17 00:20:36 +02:00
|
|
|
resource->data.memory32.alignment = 0;
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
resource->data.memory32.address_length = p->end - p->start + 1;
|
2005-04-17 00:20:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void pnpacpi_encode_fixed_mem32(struct acpi_resource *resource,
|
2007-07-26 19:41:20 +02:00
|
|
|
struct resource *p)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
2005-10-21 06:00:00 +02:00
|
|
|
resource->data.fixed_memory32.write_protect =
|
2007-07-26 19:41:20 +02:00
|
|
|
(p->flags & IORESOURCE_MEM_WRITEABLE) ?
|
|
|
|
ACPI_READ_WRITE_MEMORY : ACPI_READ_ONLY_MEMORY;
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
resource->data.fixed_memory32.address = p->start;
|
|
|
|
resource->data.fixed_memory32.address_length = p->end - p->start + 1;
|
2005-04-17 00:20:36 +02:00
|
|
|
}
|
|
|
|
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
int pnpacpi_encode_resources(struct pnp_resource_table *res_table,
|
2007-07-26 19:41:20 +02:00
|
|
|
struct acpi_buffer *buffer)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
|
|
|
int i = 0;
|
|
|
|
/* pnpacpi_build_resource_template allocates extra mem */
|
2007-07-26 19:41:20 +02:00
|
|
|
int res_cnt = (buffer->length - 1) / sizeof(struct acpi_resource) - 1;
|
|
|
|
struct acpi_resource *resource =
|
|
|
|
(struct acpi_resource *)buffer->pointer;
|
2005-04-17 00:20:36 +02:00
|
|
|
int port = 0, irq = 0, dma = 0, mem = 0;
|
|
|
|
|
|
|
|
pnp_dbg("res cnt %d", res_cnt);
|
|
|
|
while (i < res_cnt) {
|
2007-07-26 19:41:20 +02:00
|
|
|
switch (resource->type) {
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
case ACPI_RESOURCE_TYPE_IRQ:
|
2005-04-17 00:20:36 +02:00
|
|
|
pnp_dbg("Encode irq");
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
pnpacpi_encode_irq(resource,
|
2007-07-26 19:41:20 +02:00
|
|
|
&res_table->irq_resource[irq]);
|
2005-04-17 00:20:36 +02:00
|
|
|
irq++;
|
|
|
|
break;
|
|
|
|
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
case ACPI_RESOURCE_TYPE_DMA:
|
2005-04-17 00:20:36 +02:00
|
|
|
pnp_dbg("Encode dma");
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
pnpacpi_encode_dma(resource,
|
2007-07-26 19:41:20 +02:00
|
|
|
&res_table->dma_resource[dma]);
|
2006-03-29 00:04:00 +02:00
|
|
|
dma++;
|
2005-04-17 00:20:36 +02:00
|
|
|
break;
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
case ACPI_RESOURCE_TYPE_IO:
|
2005-04-17 00:20:36 +02:00
|
|
|
pnp_dbg("Encode io");
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
pnpacpi_encode_io(resource,
|
2007-07-26 19:41:20 +02:00
|
|
|
&res_table->port_resource[port]);
|
2006-03-29 00:04:00 +02:00
|
|
|
port++;
|
2005-04-17 00:20:36 +02:00
|
|
|
break;
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
case ACPI_RESOURCE_TYPE_FIXED_IO:
|
2005-04-17 00:20:36 +02:00
|
|
|
pnp_dbg("Encode fixed io");
|
|
|
|
pnpacpi_encode_fixed_io(resource,
|
2007-07-26 19:41:20 +02:00
|
|
|
&res_table->
|
|
|
|
port_resource[port]);
|
2006-03-29 00:04:00 +02:00
|
|
|
port++;
|
2005-04-17 00:20:36 +02:00
|
|
|
break;
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
case ACPI_RESOURCE_TYPE_MEMORY24:
|
2005-04-17 00:20:36 +02:00
|
|
|
pnp_dbg("Encode mem24");
|
|
|
|
pnpacpi_encode_mem24(resource,
|
2007-07-26 19:41:20 +02:00
|
|
|
&res_table->mem_resource[mem]);
|
2006-03-29 00:04:00 +02:00
|
|
|
mem++;
|
2005-04-17 00:20:36 +02:00
|
|
|
break;
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
case ACPI_RESOURCE_TYPE_MEMORY32:
|
2005-04-17 00:20:36 +02:00
|
|
|
pnp_dbg("Encode mem32");
|
|
|
|
pnpacpi_encode_mem32(resource,
|
2007-07-26 19:41:20 +02:00
|
|
|
&res_table->mem_resource[mem]);
|
2006-03-29 00:04:00 +02:00
|
|
|
mem++;
|
2005-04-17 00:20:36 +02:00
|
|
|
break;
|
[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>
2005-10-01 01:03:00 +02:00
|
|
|
case ACPI_RESOURCE_TYPE_FIXED_MEMORY32:
|
2005-04-17 00:20:36 +02:00
|
|
|
pnp_dbg("Encode fixed mem32");
|
|
|
|
pnpacpi_encode_fixed_mem32(resource,
|
2007-07-26 19:41:20 +02:00
|
|
|
&res_table->
|
|
|
|
mem_resource[mem]);
|
2006-03-29 00:04:00 +02:00
|
|
|
mem++;
|
2005-04-17 00:20:36 +02:00
|
|
|
break;
|
2006-01-20 07:11:37 +01:00
|
|
|
case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
|
|
|
|
pnp_dbg("Encode ext irq");
|
|
|
|
pnpacpi_encode_ext_irq(resource,
|
2007-07-26 19:41:20 +02:00
|
|
|
&res_table->irq_resource[irq]);
|
2006-01-20 07:11:37 +01:00
|
|
|
irq++;
|
|
|
|
break;
|
|
|
|
case ACPI_RESOURCE_TYPE_START_DEPENDENT:
|
|
|
|
case ACPI_RESOURCE_TYPE_END_DEPENDENT:
|
|
|
|
case ACPI_RESOURCE_TYPE_VENDOR:
|
|
|
|
case ACPI_RESOURCE_TYPE_END_TAG:
|
|
|
|
case ACPI_RESOURCE_TYPE_ADDRESS16:
|
|
|
|
case ACPI_RESOURCE_TYPE_ADDRESS32:
|
|
|
|
case ACPI_RESOURCE_TYPE_ADDRESS64:
|
|
|
|
case ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64:
|
|
|
|
case ACPI_RESOURCE_TYPE_GENERIC_REGISTER:
|
2007-07-26 19:41:20 +02:00
|
|
|
default: /* other type */
|
2005-09-22 06:25:18 +02:00
|
|
|
pnp_warn("unknown resource type %d", resource->type);
|
2005-04-17 00:20:36 +02:00
|
|
|
return -EINVAL;
|
|
|
|
}
|
2006-03-29 00:04:00 +02:00
|
|
|
resource++;
|
|
|
|
i++;
|
2005-04-17 00:20:36 +02:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|