[SeaBIOS] [PATCH v2 1/3] smm: use acpi_pm1a_cnt
Gerd Hoffmann
kraxel at redhat.com
Tue May 13 14:58:30 CEST 2014
Avoid using PORT_ACPI_PM_BASE in smm code so we can remove it.
Largely based on a older patch from Kevin.
Signed-off-by: Gerd Hoffmann <kraxel at redhat.com>
---
src/fw/biostables.c | 2 +-
src/fw/smm.c | 4 ++--
src/util.h | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/fw/biostables.c b/src/fw/biostables.c
index 17bee8e..3bdbb42 100644
--- a/src/fw/biostables.c
+++ b/src/fw/biostables.c
@@ -169,7 +169,7 @@ find_resume_vector(void)
static struct acpi_20_generic_address acpi_reset_reg;
static u8 acpi_reset_val;
-u32 acpi_pm1a_cnt VARFSEG;
+u16 acpi_pm1a_cnt VARFSEG;
#define acpi_ga_to_bdf(addr) pci_to_bdf(0, (addr >> 32) & 0xffff, (addr >> 16) & 0xffff)
diff --git a/src/fw/smm.c b/src/fw/smm.c
index 1032ffb..ade77a7 100644
--- a/src/fw/smm.c
+++ b/src/fw/smm.c
@@ -55,7 +55,7 @@ ASM32FLAT(
" jne 1f\n"
/* ACPI disable */
- " movw $" __stringify(PORT_ACPI_PM_BASE) " + 0x04, %dx\n" /* PMCNTRL */
+ " addr32 movw (acpi_pm1a_cnt), %dx\n" /* PMCNTRL */
" inw %dx, %ax\n"
" andw $~1, %ax\n"
" outw %ax, %dx\n"
@@ -67,7 +67,7 @@ ASM32FLAT(
" jne 2f\n"
/* ACPI enable */
- " movw $" __stringify(PORT_ACPI_PM_BASE) " + 0x04, %dx\n" /* PMCNTRL */
+ " addr32 movw (acpi_pm1a_cnt), %dx\n" /* PMCNTRL */
" inw %dx, %ax\n"
" orw $1, %ax\n"
" outw %ax, %dx\n"
diff --git a/src/util.h b/src/util.h
index 0cbea48..bf8992b 100644
--- a/src/util.h
+++ b/src/util.h
@@ -69,7 +69,7 @@ void copy_mptable(void *pos);
extern struct pir_header *PirAddr;
void copy_acpi_rsdp(void *pos);
extern struct rsdp_descriptor *RsdpAddr;
-extern u32 acpi_pm1a_cnt;
+extern u16 acpi_pm1a_cnt;
void *find_acpi_rsdp(void);
u32 find_resume_vector(void);
void acpi_reboot(void);
--
1.8.3.1
More information about the SeaBIOS
mailing list