mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
uacpi: update
This commit is contained in:
+1
-1
@@ -11,7 +11,7 @@ PRINTFOPTS=-DPRINTF_DISABLE_SUPPORT_FLOAT
|
||||
# flanterm includes break if the headers are moved into the include dir in the tree
|
||||
FLANTERMINCDIR=$(shell pwd)/flanterm
|
||||
UACPIINCDIR=$(shell pwd)/io/acpi/uacpi/include
|
||||
UACPIOPTS=-DUACPI_OVERRIDE_LIBC -DUACPI_KERNEL_INITIALIZATION
|
||||
UACPIOPTS=-DUACPI_OVERRIDE_LIBC -DUACPI_KERNEL_INITIALIZATION -DUACPI_NATIVE_ALLOC_ZEROED
|
||||
KERNELCONFIG=#-DX86_64_ENABLE_E9 -DSYSCALL_LOGGING
|
||||
CFLAGS=-g -ffreestanding -mcmodel=kernel -O2 -mno-red-zone -mgeneral-regs-only -mno-mmx -mno-sse -mno-sse2 -nostdlib -Wall -MMD -I "${INCDIR}" -I "$(ARCHINCDIR)" -I "$(FLANTERMINCDIR)" -I "$(UACPIINCDIR)" $(UACPIOPTS) $(PRINTFOPTS) $(KERNELCONFIG)
|
||||
ASFLAGS=-felf64
|
||||
|
||||
@@ -49,8 +49,8 @@ void *uacpi_kernel_alloc(uacpi_size size) {
|
||||
return alloc(size);
|
||||
}
|
||||
|
||||
void *uacpi_kernel_calloc(uacpi_size count, uacpi_size size) {
|
||||
return alloc(count * size);
|
||||
void *uacpi_kernel_alloc_zeroed(uacpi_size size) {
|
||||
return alloc(size);
|
||||
}
|
||||
|
||||
void uacpi_kernel_free(void *ptr) {
|
||||
@@ -207,7 +207,25 @@ uacpi_status uacpi_kernel_io_write(uacpi_handle handle, uacpi_size offset, uacpi
|
||||
return uacpi_kernel_raw_io_write((uacpi_io_addr)handle + offset, width, value);
|
||||
}
|
||||
|
||||
uacpi_status uacpi_kernel_pci_read(uacpi_pci_address *address, uacpi_size offset, uacpi_u8 width, uacpi_u64 *out) {
|
||||
uacpi_status uacpi_kernel_pci_device_open(
|
||||
uacpi_pci_address address, uacpi_handle *out_handle
|
||||
) {
|
||||
uacpi_pci_address *p = alloc(sizeof(uacpi_pci_address));
|
||||
if (uacpi_unlikely(p == NULL))
|
||||
return UACPI_STATUS_OUT_OF_MEMORY;
|
||||
|
||||
memcpy(p, &address, sizeof(uacpi_pci_address));
|
||||
*out_handle = (uacpi_handle)p;
|
||||
return UACPI_STATUS_OK;
|
||||
}
|
||||
|
||||
void uacpi_kernel_pci_device_close(uacpi_handle handle) {
|
||||
free((void *)handle);
|
||||
}
|
||||
|
||||
uacpi_status uacpi_kernel_pci_read(uacpi_handle handle, uacpi_size offset, uacpi_u8 width, uacpi_u64 *out) {
|
||||
uacpi_pci_address *address = (uacpi_pci_address *)handle;
|
||||
|
||||
if (address->segment != 0) {
|
||||
printf("reading from PCI segment %u is not supported\n", address->segment);
|
||||
return UACPI_STATUS_UNIMPLEMENTED;
|
||||
@@ -233,7 +251,9 @@ uacpi_status uacpi_kernel_pci_read(uacpi_pci_address *address, uacpi_size offset
|
||||
return UACPI_STATUS_OK;
|
||||
}
|
||||
|
||||
uacpi_status uacpi_kernel_pci_write(uacpi_pci_address *address, uacpi_size offset, uacpi_u8 width, uacpi_u64 value) {
|
||||
uacpi_status uacpi_kernel_pci_write(uacpi_handle handle, uacpi_size offset, uacpi_u8 width, uacpi_u64 value) {
|
||||
uacpi_pci_address *address = (uacpi_pci_address *)handle;
|
||||
|
||||
if (address->segment != 0) {
|
||||
printf("writing to PCI segment %u is not supported\n", address->segment);
|
||||
return UACPI_STATUS_UNIMPLEMENTED;
|
||||
|
||||
+1
-1
Submodule kernel-src/io/acpi/uacpi updated: 1721b8a2a3...3e1f1a3e5a
Reference in New Issue
Block a user