summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Zammit <damien@zamaudio.com>2022-08-28 21:59:44 +1000
committerDamien Zammit <damien@zamaudio.com>2022-08-28 21:59:44 +1000
commit2bd303ba50984e215f2340b2f32cec03fe8a9ee7 (patch)
tree98fba04b47e88ea4896739f32443a445e39475a2
parentaa3c792268c869020d9751e3c98a8ca7a1000485 (diff)
Reorder acgnuex.h and prevent timer overflow
-rw-r--r--debian/patches/acgnu.diff50
1 files changed, 25 insertions, 25 deletions
diff --git a/debian/patches/acgnu.diff b/debian/patches/acgnu.diff
index 8fc9b13..fc59992 100644
--- a/debian/patches/acgnu.diff
+++ b/debian/patches/acgnu.diff
@@ -296,31 +296,7 @@ Add acgnu.h and acgnuex.h
+ struct timespec now;
+
+ clock_gettime(CLOCK_MONOTONIC, &now);
-+ return (u64)(now.tv_sec * 10000000 + (now.tv_nsec / 100));
-+}
-+
-+static inline acpi_status
-+acpi_os_read_port(acpi_io_address port, u32 *value, u32 width)
-+{
-+ if (!value)
-+ return 1;
-+
-+ switch (width)
-+ {
-+ case 8:
-+ *((u8 *)value) = inb(port);
-+ return 0;
-+ case 16:
-+ *((u16 *)value) = inw(port);
-+ return 0;
-+ case 32:
-+ *((u32 *)value) = inl(port);
-+ return 0;
-+ default:
-+ acpi_os_printf("ACPI: read port invalid width\n");
-+ return 1;
-+ }
-+ return 1;
++ return (u64)((u64)now.tv_sec * 10000000 + (now.tv_nsec / 100));
+}
+
+static inline acpi_status
@@ -365,6 +341,30 @@ Add acgnu.h and acgnuex.h
+}
+
+static inline acpi_status
++acpi_os_read_port(acpi_io_address port, u32 *value, u32 width)
++{
++ if (!value)
++ return 1;
++
++ switch (width)
++ {
++ case 8:
++ *((u8 *)value) = inb(port);
++ return 0;
++ case 16:
++ *((u16 *)value) = inw(port);
++ return 0;
++ case 32:
++ *((u32 *)value) = inl(port);
++ return 0;
++ default:
++ acpi_os_printf("ACPI: read port invalid width\n");
++ return 1;
++ }
++ return 1;
++}
++
++static inline acpi_status
+acpi_os_write_port(acpi_io_address port, u32 value, u32 width)
+{
+ switch (width)