Richard Spiegel has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33652
Change subject: arch/x86/acpi: Add os.asl ......................................................................
arch/x86/acpi: Add os.asl
As time goes by, newer OS come into the market, requiring modification on ACPI code to identify the new OS. With this new file, a single file will need maintenance in the future, and it will fix the code for every board including this file.
It assumes OSVR is already declared elsewhere within the ACPI code.
BUG=b:none. TEST=Tested later with padmelon board.
Change-Id: I87200cafdafcf078db16c95463a86c3e9105cea6 Signed-off-by: Richard Spiegel richard.spiegel@silverbackltd.com --- A src/arch/x86/acpi/os.asl 1 file changed, 135 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/52/33652/1
diff --git a/src/arch/x86/acpi/os.asl b/src/arch/x86/acpi/os.asl new file mode 100644 index 0000000..17fe29e --- /dev/null +++ b/src/arch/x86/acpi/os.asl @@ -0,0 +1,135 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2019 Silverback, Ltd + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +/* Assumes OSVR is declared elsewhere */ +Method(OSFL, 0, NotSerialized) +{ + If(LNotEqual(OSVR, Ones)) + { + Return(OSVR) + } + Store(0x03, OSVR) + If(CondRefOf(_OSI, Local0)) + { + If(_OSI("Windows 2001")) + { + Store(0x04, OSVR) + } + If(_OSI("Windows 2001.1")) + { + Store(0x05, OSVR) + } + If(_OSI("FreeBSD")) + { + Store(0x06, OSVR) + } + If(_OSI("HP-UX")) + { + Store(0x07, OSVR) + } + If(_OSI("OpenVMS")) + { + Store(0x08, OSVR) + } + If(_OSI("Windows 2001 SP1")) + { + Store(0x09, OSVR) + } + If(_OSI("Windows 2001 SP2")) + { + Store(0x0A, OSVR) + } + If(_OSI("Windows 2001 SP3")) + { + Store(0x0B, OSVR) + } + If(_OSI("Windows 2006")) + { + Store(0x0C, OSVR) + } + If(_OSI("Windows 2006 SP1")) + { + Store(0x0D, OSVR) + } + If(_OSI("Windows 2009")) + { + Store(0x0E, OSVR) + } + If(_OSI("Windows 2012")) + { + Store(0x0F, OSVR) + } + If(_OSI("Windows 2013")) + { + Store(0x10, OSVR) + } + } + Else + { + Store (_OS, local0) + If(SCPM(local0, "Microsoft Windows NT")) + { + Store(Zero, OSVR) + } + If(SCPM(local0, "Microsoft Windows")) + { + Store(One, OSVR) + } + If(SCPM(local0, "Microsoft WindowsME: Millennium Edition")) + { + Store(0x02, OSVR) + } + If(SCPM(local0, "Linux")) + { + Store(0x03, OSVR) + } + If(SCPM(local0, "FreeBSD")) + { + Store(0x06, OSVR) + } + If(SCPM(local0, "HP-UX")) + { + Store(0x07, OSVR) + } + If(SCPM(local0, "OpenVMS")) + { + Store(0x08, OSVR) + } + } + Return(OSVR) +} + +/* String compare */ +Method(SCPM, 2, Serialized) +{ + If(LLess(SizeOf(Arg0), SizeOf(Arg1))) + { + Return(Zero) + } + Add(SizeOf(Arg0), One, Local0) + Name(BUF0, Buffer(Local0){}) + Name(BUF1, Buffer(Local0){}) + Store(Arg0, BUF0) + Store(Arg1, BUF1) + While(Local0) + { + Decrement(Local0) + If(LNotEqual(DerefOf(Index(BUF0, Local0)), DerefOf(Index(BUF1, Local0)))) + { + Return(Zero) + } + } + Return(One) +}