2 * This file is part of the coreboot project.
4 * Copyright (C) 2010 Advanced Micro Devices, Inc.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #include "globutil.asl"
26 /* string compare functions */
29 if (LLess(Arg0, Arg1)) {
39 Return(Sizeof(Local0))
44 Add(SLEN(Arg0), One, Local0)
45 Name(BUFF, Buffer(Local0) {})
50 /* Strong string compare. Checks both length and content */
53 Store(S2BF(Arg0), Local0)
54 Store(S2BF(Arg1), Local1)
56 Store(SLEN(Arg0), Local5)
57 Store(SLEN(Arg1), Local6)
58 Store(MIN(Local5, Local6), Local7)
60 While(LLess(Local4, Local7)) {
61 Store(Derefof(Index(Local0, Local4)), Local2)
62 Store(Derefof(Index(Local1, Local4)), Local3)
63 if (LGreater(Local2, Local3)) {
66 if (LLess(Local2, Local3)) {
72 if (LLess(Local4, Local5)) {
75 if (LLess(Local4, Local6)) {
83 /* Weak string compare. Checks to find Arg1 at beginning of Arg0.
84 * Fails if length(Arg0) < length(Arg1). Returns 0 on Fail, 1 on
89 Store(S2BF(Arg0), Local0)
90 Store(S2BF(Arg1), Local1)
91 if (LLess(SLEN(Arg0), SLEN(Arg1))) {
95 Store(SLEN(Arg1), Local3)
97 While(LLess(Local2, Local3)) {
98 if (LNotEqual(Derefof(Index(Local0, Local2)),
99 Derefof(Index(Local1, Local2)))) {
107 /* ARG0 = IRQ Number(0-15)
113 if (LNotEqual(ARG0, 0)) {
115 ShiftLeft(Local1, ARG0, Local0)