diff options
author | njl <njl@FreeBSD.org> | 2003-07-13 22:57:16 +0000 |
---|---|---|
committer | njl <njl@FreeBSD.org> | 2003-07-13 22:57:16 +0000 |
commit | bce9717b4643784c8c7781798956e458c2a831ea (patch) | |
tree | a1485388131287815461bcf2de309d011715dbd0 /sys/dev/acpica/Osd | |
parent | 17dd0864eb9c81bb222c6fa5670d3666dbbe2068 (diff) | |
download | FreeBSD-src-bce9717b4643784c8c7781798956e458c2a831ea.zip FreeBSD-src-bce9717b4643784c8c7781798956e458c2a831ea.tar.gz |
Update code to work with 0619 dist
* Use ACPI_BUFFER as the type for AcpiGetObjectInfo
* Remove AcpiEnableEvent/AcpiClearEvent for ACPI_EVENT_FIXED (power/sleep
buttons) as they are no longer needed
* Change calls to use the new GPE functions
* Add AcpiOs*Lock functions
Diffstat (limited to 'sys/dev/acpica/Osd')
-rw-r--r-- | sys/dev/acpica/Osd/OsdHardware.c | 4 | ||||
-rw-r--r-- | sys/dev/acpica/Osd/OsdMemory.c | 4 | ||||
-rw-r--r-- | sys/dev/acpica/Osd/OsdSynch.c | 51 |
3 files changed, 55 insertions, 4 deletions
diff --git a/sys/dev/acpica/Osd/OsdHardware.c b/sys/dev/acpica/Osd/OsdHardware.c index ab996c6..afc32e8 100644 --- a/sys/dev/acpica/Osd/OsdHardware.c +++ b/sys/dev/acpica/Osd/OsdHardware.c @@ -69,7 +69,7 @@ ACPI_STATUS AcpiOsReadPort ( ACPI_IO_ADDRESS InPort, - void *Value, + UINT32 *Value, UINT32 Width) { switch (Width) { @@ -93,7 +93,7 @@ AcpiOsReadPort ( ACPI_STATUS AcpiOsWritePort ( ACPI_IO_ADDRESS OutPort, - ACPI_INTEGER Value, + UINT32 Value, UINT32 Width) { switch (Width) { diff --git a/sys/dev/acpica/Osd/OsdMemory.c b/sys/dev/acpica/Osd/OsdMemory.c index 2bb13cb..95d84fb 100644 --- a/sys/dev/acpica/Osd/OsdMemory.c +++ b/sys/dev/acpica/Osd/OsdMemory.c @@ -94,7 +94,7 @@ AcpiOsWritable (void *Pointer, UINT32 Length) ACPI_STATUS AcpiOsReadMemory ( ACPI_PHYSICAL_ADDRESS Address, - void *Value, + UINT32 *Value, UINT32 Width) { void *LogicalAddress; @@ -129,7 +129,7 @@ AcpiOsReadMemory ( ACPI_STATUS AcpiOsWriteMemory ( ACPI_PHYSICAL_ADDRESS Address, - ACPI_INTEGER Value, + UINT32 Value, UINT32 Width) { void *LogicalAddress; diff --git a/sys/dev/acpica/Osd/OsdSynch.c b/sys/dev/acpica/Osd/OsdSynch.c index 718e3c7..6b791e6 100644 --- a/sys/dev/acpica/Osd/OsdSynch.c +++ b/sys/dev/acpica/Osd/OsdSynch.c @@ -338,3 +338,54 @@ AcpiOsSignalSemaphore(ACPI_HANDLE Handle, UINT32 Units) return(AE_OK); #endif } + +ACPI_STATUS +AcpiOsCreateLock (ACPI_HANDLE *OutHandle) +{ + struct mtx *m; + + if (OutHandle == NULL) + return (AE_BAD_PARAMETER); + MALLOC(m, struct mtx *, sizeof(*m), M_ACPISEM, M_NOWAIT | M_ZERO); + if (m == NULL) + return (AE_NO_MEMORY); + + mtx_init(m, "acpica subsystem lock", NULL, MTX_DEF); + *OutHandle = (ACPI_HANDLE)m; + return (AE_OK); +} + +void +AcpiOsDeleteLock (ACPI_HANDLE Handle) +{ + struct mtx *m = (struct mtx *)Handle; + + if (Handle == NULL) + return; + mtx_destroy(m); +} + +/* + * The Flags parameter seems to state whether or not caller is an ISR + * (and thus can't block) but since we have ithreads, we don't worry + * about potentially blocking. + */ +void +AcpiOsAcquireLock (ACPI_HANDLE Handle, UINT32 Flags) +{ + struct mtx *m = (struct mtx *)Handle; + + if (Handle == NULL) + return; + mtx_lock(m); +} + +void +AcpiOsReleaseLock (ACPI_HANDLE Handle, UINT32 Flags) +{ + struct mtx *m = (struct mtx *)Handle; + + if (Handle == NULL) + return; + mtx_unlock(m); +} |