diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-06-30 19:11:06 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-06-30 19:11:06 +0200 |
commit | 1edd8d28a56578307df36967d51f16703d8f33bd (patch) | |
tree | d84042ad0e0b76c43d703e2c9927a5a99ec08a32 | |
parent | 3ec84c5d7364c8ed4602561743bf35e3b399e53d (diff) | |
download | plan9front-1edd8d28a56578307df36967d51f16703d8f33bd.tar.xz |
acpi: _ADR and _BBN might be methods, so use amleval() to evaluate the value
-rw-r--r-- | sys/src/9/pc/archacpi.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/src/9/pc/archacpi.c b/sys/src/9/pc/archacpi.c index c2ed1580f..370905103 100644 --- a/sys/src/9/pc/archacpi.c +++ b/sys/src/9/pc/archacpi.c @@ -260,7 +260,10 @@ pcibusno(void *dot) if((x = amlwalk(dot, "^_BBN")) == nil) if((x = amlwalk(dot, "^_ADR")) == nil) return -1; - adr = amlint(amlval(x)); + p = nil; + if(amleval(x, "", &p) < 0) + return -1; + adr = amlint(p); /* if root bridge, then we are done here */ if(id != nil && (strcmp(id, "PNP0A03")==0 || strcmp(id, "PNP0A08")==0)) return adr; @@ -282,7 +285,7 @@ static int pciaddr(void *dot) { int adr, bno; - void *x; + void *x, *p; for(;;){ if((x = amlwalk(dot, "_ADR")) == nil){ @@ -294,9 +297,10 @@ pciaddr(void *dot) } if((bno = pcibusno(x)) < 0) break; - if((x = amlval(x)) == nil) + p = nil; + if(amleval(x, "", &p) < 0) break; - adr = amlint(x); + adr = amlint(p); return MKBUS(BusPCI, bno, adr>>16, adr&0xFFFF); } return -1; |