mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-04-17 22:06:40 +02:00
Simple UEFI boot loader with support for safely switching between current and updated partition sets
44 lines
1.3 KiB
Diff
44 lines
1.3 KiB
Diff
--- a/drivers/watchdog/w83627hf_wdt.c 2023-10-26 12:32:54.000000000 +0200
|
|
+++ b/drivers/watchdog/w83627hf_wdt.c 2024-04-25 17:08:20.540876697 +0200
|
|
@@ -75,6 +75,21 @@
|
|
static int wdt_cfg_enter = 0x87;/* key to unlock configuration space */
|
|
static int wdt_cfg_leave = 0xAA;/* key to lock configuration space */
|
|
|
|
+/*
|
|
+ * Add a fallback for non-GNU libc systems like musl libc for the
|
|
+ * non-standard function outb_p.
|
|
+ */
|
|
+#if defined(__GLIBC__)
|
|
+#define w83627hf_wdt_outb_p outb_p
|
|
+#else
|
|
+static inline void
|
|
+w83627hf_wdt_outb_p(unsigned char value, unsigned short int port)
|
|
+{
|
|
+ __asm__ __volatile__ ("outb %b0,%w1\noutb %%al,$0x80" : : "a" (value),
|
|
+ "Nd" (port));
|
|
+}
|
|
+#endif
|
|
+
|
|
static void superio_outb(int reg, int val)
|
|
{
|
|
outb(reg, WDT_EFER);
|
|
@@ -89,8 +104,8 @@
|
|
|
|
static int superio_enter(void)
|
|
{
|
|
- outb_p(wdt_cfg_enter, WDT_EFER); /* Enter extended function mode */
|
|
- outb_p(wdt_cfg_enter, WDT_EFER); /* Again according to manual */
|
|
+ w83627hf_wdt_outb_p(wdt_cfg_enter, WDT_EFER); /* Enter extended function mode */
|
|
+ w83627hf_wdt_outb_p(wdt_cfg_enter, WDT_EFER); /* Again according to manual */
|
|
return 0;
|
|
}
|
|
|
|
@@ -101,7 +116,7 @@
|
|
|
|
static void superio_exit(void)
|
|
{
|
|
- outb_p(wdt_cfg_leave, WDT_EFER); /* Leave extended function mode */
|
|
+ w83627hf_wdt_outb_p(wdt_cfg_leave, WDT_EFER); /* Leave extended function mode */
|
|
}
|
|
|
|
static int wdt_find(int addr)
|