From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from 5ess.inri.net ([107.161.31.183]) by ewsd; Tue Jul 24 09:09:13 EDT 2018 Received: from [192.168.1.7] ([108.95.88.138]) by 5ess; Tue Jul 24 09:09:13 EDT 2018 From: Stanley Lieber Content-Type: multipart/alternative; boundary=Apple-Mail-7F81F148-3DFA-47BA-BE1A-790D6E5248DD Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (1.0) Subject: Fwd: [9front-commits] 23hiro: hg/plan9front: spelling Date: Tue, 24 Jul 2018 09:09:12 -0400 Message-Id: <0328A25F-D3E7-429D-B0CF-9311C9EB0624@stanleylieber.com> References: To: 9front@9front.org X-Mailer: iPhone Mail (15G77) List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: webscale metadata markup-based frontend --Apple-Mail-7F81F148-3DFA-47BA-BE1A-790D6E5248DD Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable =E2=80=9Cspelling=E2=80=9D ??? sl Begin forwarded message: > From: The Computer > Date: July 24, 2018 at 3:32:15 AM EDT > To: 9front-commits@9front.org > Subject: [9front-commits] 23hiro: hg/plan9front: spelling > Reply-To: 9front-commits@9front.org >=20 > details: http://code.9front.org/hg/plan9front/rev/57022f22e3f0 > changeset: 6645:57022f22e3f0 > user: 23hiro@gmail.com > date: Tue Jul 24 09:04:50 2018 +0200 > description: spelling >=20 > Subject: 23hiro: hg/plan9front: merge >=20 > details: http://code.9front.org/hg/plan9front/rev/cbf36e85095a > changeset: 6646:cbf36e85095a > user: 23hiro@gmail.com > date: Tue Jul 24 09:17:11 2018 +0200 > description: merge >=20 >=20 > diffstat: >=20 > sys/man/6/authsrv | 2 +- > sys/src/9/pc/archacpi.c | 2 +- > sys/src/9/pc/archmp.c | 2 +- > sys/src/9/pc/bios32.c | 4 +- > sys/src/9/pc/fns.h | 3 +- > sys/src/9/pc/memory.c | 84 ++++++++++++++++++++++++++++++++++++---= ---- > sys/src/9/pc/pci.c | 2 +- > sys/src/9/pc64/fns.h | 3 +- > sys/src/9/pc64/memory.c | 84 +++++++++++++++++++++++++++++++++++----= ---- > sys/src/9/port/devmnt.c | 3 + > sys/src/9/port/devmouse.c | 4 +- > sys/src/cmd/ndb/dnserver.c | 52 ++++++++++++++------------- > sys/src/cmd/ssh.c | 4 +- > sys/src/cmd/vnc/devmouse.c | 2 +- > sys/src/games/dmid.c | 19 +++++---- > sys/src/games/doom/d_main.c | 5 ++ > sys/src/games/doom/i_sound.c | 10 +---- > sys/src/libdraw/event.c | 4 +- > sys/src/libdraw/mouse.c | 2 +- > 19 files changed, 202 insertions(+), 89 deletions(-) >=20 > diffs (truncated from 661 to 300 lines): >=20 > diff --git a/sys/man/6/authsrv b/sys/man/6/authsrv > --- a/sys/man/6/authsrv > +++ b/sys/man/6/authsrv > @@ -293,7 +293,7 @@ Initially, the server and client keys > .I Ks > and > .I Kc > -where equivalent to the password derived 56-bit DES keys, which > +were equivalent to the password derived 56-bit DES keys, which > made the encrypted tickets subject to offline dictionary attacks > and provided too small a key space against brute force attacks > on current hardware. > diff --git a/sys/src/9/pc/archacpi.c b/sys/src/9/pc/archacpi.c > --- a/sys/src/9/pc/archacpi.c > +++ b/sys/src/9/pc/archacpi.c > @@ -788,7 +788,7 @@ identify(void) > return 1; > pa =3D (uintptr)strtoull(cp, nil, 16); > if(pa <=3D 1) > - rsd =3D sigsearch("RSD PTR "); > + rsd =3D rsdsearch(); > else if(pa < MemMin) > rsd =3D KADDR(pa); > else > diff --git a/sys/src/9/pc/archmp.c b/sys/src/9/pc/archmp.c > --- a/sys/src/9/pc/archmp.c > +++ b/sys/src/9/pc/archmp.c > @@ -395,7 +395,7 @@ identify(void) > * if correct, check the version. > * To do: check extended table checksum. > */ > - if((_mp_ =3D sigsearch("_MP_")) =3D=3D nil || checksum(_mp_, _MP_sz) != =3D 0 || _mp_->physaddr =3D=3D 0) > + if((_mp_ =3D sigsearch("_MP_", _MP_sz)) =3D=3D nil || _mp_->physaddr =3D= =3D 0) > return 1; >=20 > len =3D PCMPsz; > diff --git a/sys/src/9/pc/bios32.c b/sys/src/9/pc/bios32.c > --- a/sys/src/9/pc/bios32.c > +++ b/sys/src/9/pc/bios32.c > @@ -54,9 +54,7 @@ bios32locate(void) > BIOS32sdh *sdh; >=20 > VFLAG("bios32link\n"); > - if((sdh =3D sigsearch("_32_")) =3D=3D nil) > - return -1; > - if(checksum(sdh, sizeof(BIOS32sdh))) > + if((sdh =3D sigsearch("_32_", sizeof(BIOS32sdh))) =3D=3D nil) > return -1; > VFLAG("sdh @ %#p, entry %#ux\n", sdh, l32get(sdh->physaddr)); >=20 > diff --git a/sys/src/9/pc/fns.h b/sys/src/9/pc/fns.h > --- a/sys/src/9/pc/fns.h > +++ b/sys/src/9/pc/fns.h > @@ -171,10 +171,11 @@ void putdr7(u32int); > void* rampage(void); > int rdmsr(int, vlong*); > void realmode(Ureg*); > +void* rsdsearch(void); > void screeninit(void); > void (*screenputs)(char*, int); > void setconfenv(void); > -void* sigsearch(char*); > +void* sigsearch(char*, int); > void syncclock(void); > void* tmpmap(Page*); > void tmpunmap(void*); > diff --git a/sys/src/9/pc/memory.c b/sys/src/9/pc/memory.c > --- a/sys/src/9/pc/memory.c > +++ b/sys/src/9/pc/memory.c > @@ -21,8 +21,9 @@ enum { > MemUPA =3D 0, /* unbacked physical address */ > MemRAM =3D 1, /* physical memory */ > MemUMB =3D 2, /* upper memory block (<16MB) */ > - MemReserved =3D 3, > - NMemType =3D 4, > + MemACPI =3D 3, /* ACPI tables */ > + MemReserved =3D 4, > + NMemType =3D 5, >=20 > KB =3D 1024, >=20 > @@ -75,6 +76,13 @@ static RMap rmapumbrw =3D { > &mapumbrw[nelem(mapumbrw)-1], > }; >=20 > +static Map mapacpi[16]; > +static RMap rmapacpi =3D { > + "ACPI tables", > + mapacpi, > + &mapacpi[nelem(mapacpi)-1], > +}; > + > void > mapprint(RMap *rmap) > { > @@ -101,6 +109,7 @@ memdebug(void) > mapprint(&rmapumb); > mapprint(&rmapumbrw); > mapprint(&rmapupa); > + mapprint(&rmapacpi); > } >=20 > static void > @@ -327,16 +336,20 @@ checksum(void *v, int n) > } >=20 > static void* > -sigscan(uchar* addr, int len, char* signature) > +sigscan(uchar *addr, int len, char *sig, int size, int step) > { > + uchar *e, *p; > int sl; > - uchar *e, *p; >=20 > - e =3D addr+len; > - sl =3D strlen(signature); > - for(p =3D addr; p+sl < e; p +=3D 16) > - if(memcmp(p, signature, sl) =3D=3D 0) > - return p; > + sl =3D strlen(sig); > + e =3D addr+len-(size > sl ? size : sl); > + for(p =3D addr; p <=3D e; p +=3D step){ > + if(memcmp(p, sig, sl) !=3D 0) > + continue; > + if(size && checksum(p, size) !=3D 0) > + continue; > + return p; > + } > return nil; > } >=20 > @@ -359,7 +372,7 @@ convmemsize(void) > } >=20 > void* > -sigsearch(char* signature) > +sigsearch(char* signature, int size) > { > uintptr p; > uchar *bda; > @@ -376,18 +389,44 @@ sigsearch(char* signature) > bda =3D KADDR(0x400); > if(memcmp(KADDR(0xfffd9), "EISA", 4) =3D=3D 0){ > if((p =3D (bda[0x0f]<<8)|bda[0x0e]) !=3D 0){ > - if((r =3D sigscan(KADDR(p<<4), 1024, signature)) !=3D nil) > + if((r =3D sigscan(KADDR(p<<4), 1024, signature, size, 16)) !=3D= nil) > return r; > } > } > - if((r =3D sigscan(KADDR(convmemsize()), 1024, signature)) !=3D nil) > + if((r =3D sigscan(KADDR(convmemsize()), 1024, signature, size, 16)) != =3D nil) > return r; >=20 > /* hack for virtualbox: look in KiB below 0xa0000 */ > - if((r =3D sigscan(KADDR(0xa0000-1024), 1024, signature)) !=3D nil) > + if((r =3D sigscan(KADDR(0xa0000-1024), 1024, signature, size, 16)) !=3D= nil) > return r; >=20 > - return sigscan(KADDR(0xe0000), 0x20000, signature); > + return sigscan(KADDR(0xe0000), 0x20000, signature, size, 16); > +} > + > +void* > +rsdsearch(void) > +{ > + static char signature[] =3D "RSD PTR "; > + uchar *v, *p; > + Map *m; > + > + if((p =3D sigsearch(signature, 36)) !=3D nil) > + return p; > + if((p =3D sigsearch(signature, 20)) !=3D nil) > + return p; > + for(m =3D rmapacpi.map; m < rmapacpi.mapend && m->size; m++){ > + if(m->size > 0x7FFFFFFF) > + continue; > + if((v =3D vmap(m->addr, m->size)) !=3D nil){ > + p =3D sigscan(v, m->size, signature, 36, 4); > + if(p =3D=3D nil) > + p =3D sigscan(v, m->size, signature, 20, 4); > + vunmap(v, m->size); > + if(p !=3D nil) > + return vmap(m->addr + (p - v), 64); > + } > + } > + return nil; > } >=20 > static void > @@ -683,6 +722,10 @@ map(ulong base, ulong len, int type) > mapfree(&rmapupa, base, len); > flags =3D 0; > break; > + case MemACPI: > + mapfree(&rmapacpi, base, len); > + flags =3D 0; > + break; > default: > case MemReserved: > flags =3D 0; > @@ -774,7 +817,18 @@ e820scan(void) > */ > if(last < base) > map(last, base-last, MemUPA); > - map(base, len, (e->type =3D=3D 1) ? MemRAM : MemReserved); > + > + switch(e->type){ > + case 1: > + map(base, len, MemRAM); > + break; > + case 3: > + map(base, len, MemACPI); > + break; > + default: > + map(base, len, MemReserved); > + } > + > last =3D base + len; > if(last =3D=3D 0) > break; > diff --git a/sys/src/9/pc/pci.c b/sys/src/9/pc/pci.c > --- a/sys/src/9/pc/pci.c > +++ b/sys/src/9/pc/pci.c > @@ -748,7 +748,7 @@ pcirouting(void) > Pcidev *sbpci, *pci; > uchar *p, pin, irq, link, *map; >=20 > - if((p =3D sigsearch("$PIR")) =3D=3D nil) > + if((p =3D sigsearch("$PIR", 0)) =3D=3D nil) > return; >=20 > r =3D (Router*)p; > diff --git a/sys/src/9/pc64/fns.h b/sys/src/9/pc64/fns.h > --- a/sys/src/9/pc64/fns.h > +++ b/sys/src/9/pc64/fns.h > @@ -170,10 +170,11 @@ void putdr7(u64int); > void* rampage(void); > int rdmsr(int, vlong*); > void realmode(Ureg*); > +void* rsdsearch(void); > void screeninit(void); > void (*screenputs)(char*, int); > void setconfenv(void); > -void* sigsearch(char*); > +void* sigsearch(char*, int); > void syncclock(void); > void syscallentry(void); > void touser(void*); > diff --git a/sys/src/9/pc64/memory.c b/sys/src/9/pc64/memory.c > --- a/sys/src/9/pc64/memory.c > +++ b/sys/src/9/pc64/memory.c > @@ -20,8 +20,9 @@ enum { > MemUPA =3D 0, /* unbacked physical address */ > MemRAM =3D 1, /* physical memory */ > MemUMB =3D 2, /* upper memory block (<16MB) */ > - MemReserved =3D 3, > - NMemType =3D 4, > + MemACPI =3D 3, /* ACPI tables */ > + MemReserved =3D 4, > + NMemType =3D 5, >=20 > KB =3D 1024, > }; > @@ -72,6 +73,13 @@ static RMap rmapumbrw =3D { > &mapumbrw[nelem(mapumbrw)-1], > }; >=20 > +static Map mapacpi[16]; > +static RMap rmapacpi =3D { > + "ACPI tables", > + mapacpi, > + &mapacpi[nelem(mapacpi)-1], > +}; > + > void > mapprint(RMap *rmap) > { > @@ -98,6 +106,7 @@ memdebug(void) > mapprint(&rmapumb); > mapprint(&rmapumbrw); > mapprint(&rmapupa); > + mapprint(&rmapacpi); > } >=20 > static void > @@ -324,16 +333,20 @@ checksum(void *v, int n) > } >=20 > static void* > -sigscan(uchar* addr, int len, char* signature) > +sigscan(uchar *addr, int len, char *sig, int size, int step) > { > + uchar *e, *p; > int sl; > - uchar *e, *p; >=20 > - e =3D addr+len; > - sl =3D strlen(signature); > - for(p =3D addr; p+sl < e; p +=3D 16) > - if(memcmp(p, signature, sl) =3D=3D 0) --Apple-Mail-7F81F148-3DFA-47BA-BE1A-790D6E5248DD Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
=E2=80=9Cspelling=E2=80=9D ?= ??

sl


Begin forwarded message:

From: The Computer <commits@code.9front.org>
Date:<= /b> July 24, 2018 at 3:32:15 AM EDT
To: 9front-commits@9front.org
Subject: [9fro= nt-commits] 23hiro: hg/plan9front: spelling
Reply-To: 9front-commits@9front.org

details:   &nb= sp; h= ttp://code.9front.org/hg/plan9front/rev/57022f22e3f0
cha= ngeset:   6645:57022f22e3f0
user:   &nbs= p;    23hiro@gmail.c= om
date:        Tue J= ul 24 09:04:50 2018 +0200
description: spelling

Subject: 23hiro: hg/plan9front: merge
<= /span>
details:     http://code.9front.org/hg/plan9front/= rev/cbf36e85095a
changeset:   6646:cbf36e85095= a
user:        23hiro@gmail.com
date:  &= nbsp;     Tue Jul 24 09:17:11 2018 +0200
= description: merge


d= iffstat:

sys/man/6/authsrv   &nb= sp;        |   2 +-=
sys/src/9/pc/archacpi.c      |  &nb= sp;2 +-
sys/src/9/pc/archmp.c      = ;  |   2 +-
sys/src/9/pc/bios32.c  = ;      |   4 +-
sys= /src/9/pc/fns.h           = |   3 +-
sys/src/9/pc/memory.c    =     |  84 ++++++++++++++++++++++++++++++++++++-----= --
sys/src/9/pc/pci.c       &= nbsp;   |   2 +-
sys/src/9/pc64/fn= s.h         |   3 +-
sys/src/9/pc64/memory.c      |  84= +++++++++++++++++++++++++++++++++++--------
sys/src/9/port= /devmnt.c      |   3 +
s= ys/src/9/port/devmouse.c    |   4 +-
sys/src/cmd/ndb/dnserver.c   |  52 ++++++++++++++---------= ----

sys/src/cmd/ssh.c       =      |   4 +-
sys/src/cm= d/vnc/devmouse.c   |   2 +-
sys/src/gam= es/dmid.c         |  19 +++++--= --
sys/src/games/doom/d_main.c  |   5 ++
sys/src/games/doom/i_sound.c |  10 +----
= sys/src/libdraw/event.c      |   4 +-

sys/src/libdraw/mouse.c      |  = ; 2 +-
19 files changed, 202 insertions(+), 89 deletio= ns(-)

diffs (truncated from 661 to 300 line= s):

diff --git a/sys/man/6/authsrv b/sys/ma= n/6/authsrv
--- a/sys/man/6/authsrv
+++ b/sy= s/man/6/authsrv
@@ -293,7 +293,7 @@ Initially, the server an= d client keys
.I Ks
and
.= I Kc
-where equivalent to the password derived 56-bit DES ke= ys, which
+were equivalent to the password derived 56-bit DE= S keys, which
made the encrypted tickets subject to offline= dictionary attacks
and provided too small a key space agai= nst brute force attacks
on current hardware.
diff --git a/sys/src/9/pc/archacpi.c b/sys/src/9/pc/archacpi.c
<= span>--- a/sys/src/9/pc/archacpi.c
+++ b/sys/src/9/pc/archac= pi.c
@@ -788,7 +788,7 @@ identify(void)
&n= bsp;      return 1;
   pa =3D (ui= ntptr)strtoull(cp, nil, 16);
   if(pa <=3D 1)=
-        rsd =3D sigsearch("RSD PTR ");=
+        rsd =3D rsdsearch();    else if(pa < MemMin)
   = ;    rsd =3D KADDR(pa);
   else=
diff --git a/sys/src/9/pc/archmp.c b/sys/src/9/pc/archmp.c<= br>--- a/sys/src/9/pc/archmp.c
+++ b/sys/src/9/pc/arch= mp.c
@@ -395,7 +395,7 @@ identify(void)
&n= bsp;   * if correct, check the version.
   = * To do: check extended table checksum.
    */<= /span>
-    if((_mp_ =3D sigsearch("_MP_")) =3D=3D nil ||= checksum(_mp_, _MP_sz) !=3D 0 || _mp_->physaddr =3D=3D 0)
+    if((_mp_ =3D sigsearch("_MP_", _MP_sz)) =3D=3D nil || _mp_-= >physaddr =3D=3D 0)

       return 1= ;

   len =3D PCMPsz;
= diff --git a/sys/src/9/pc/bios32.c b/sys/src/9/pc/bios32.c
<= span>--- a/sys/src/9/pc/bios32.c
+++ b/sys/src/9/pc/bios32.c=
@@ -54,9 +54,7 @@ bios32locate(void)
&nbs= p;  BIOS32sdh *sdh;

   VFL= AG("bios32link\n");
-    if((sdh =3D sigsearch("_3= 2_")) =3D=3D nil)
-        return -1;
-    if(checksum(sdh, sizeof(BIOS32sdh)))
= +    if((sdh =3D sigsearch("_32_", sizeof(BIOS32sdh))) =3D=3D= nil)
       return -1;
   VFLAG("sdh @ %#p, entry %#ux\n", sdh, l32get(sdh->physad= dr));


diff --git a/sys/src/9/pc/fns.h b/sys= /src/9/pc/fns.h
--- a/sys/src/9/pc/fns.h
+++= b/sys/src/9/pc/fns.h
@@ -171,10 +171,11 @@ void   &nbs= p;putdr7(u32int);
void*    rampage(void);<= br> int    rdmsr(int, vlong*);
void   &= nbsp;realmode(Ureg*);
+void*    rsdsearch(void);
void    screeninit(void);
void &n= bsp;  (*screenputs)(char*, int);
void    set= confenv(void);
-void*    sigsearch(char*);<= br>+void*    sigsearch(char*, int);
void &n= bsp;  syncclock(void);
void*    tmpmap(Page*= );
void    tmpunmap(void*);
diff -= -git a/sys/src/9/pc/memory.c b/sys/src/9/pc/memory.c
--- a/s= ys/src/9/pc/memory.c
+++ b/sys/src/9/pc/memory.c
<= span>@@ -21,8 +21,9 @@ enum {

   MemUPA   &= nbsp;    =3D 0,        /* unbacked physical ad= dress */
   MemRAM        =3D= 1,        /* physical memory */
 = ;  MemUMB        =3D 2,        = /* upper memory block (<16MB) */
-    MemReserv= ed    =3D 3,
-    NMemType    = =3D 4,
+    MemACPI        =3D= 3,        /* ACPI tables */
+   &n= bsp;MemReserved    =3D 4,
+    NMemType &= nbsp;  =3D 5,

   KB  =      =3D 1024,

@@ -75,6 +76= ,13 @@ static RMap rmapumbrw =3D {
   &mapum= brw[nelem(mapumbrw)-1],
};

+static Map mapacpi[16];
+static RMap rmapacpi =3D {=
+    "ACPI tables",
+    mapac= pi,
+    &mapacpi[nelem(mapacpi)-1],+};
+
void
mapprint= (RMap *rmap)
{
@@ -101,6 +109,7 @@ memdebug= (void)
   mapprint(&rmapumb);
   mapprint(&rmapumbrw);
   ma= pprint(&rmapupa);
+    mapprint(&rmapacpi)= ;
}

static void@@ -327,16 +336,20 @@ checksum(void *v, int n)
}

static void*
-sigscan(uchar* a= ddr, int len, char* signature)
+sigscan(uchar *addr, int len= , char *sig, int size, int step)
{
+  =  uchar *e, *p;
   int sl;
= -    uchar *e, *p;

-    = ;e =3D addr+len;
-    sl =3D strlen(signature);
-    for(p =3D addr; p+sl < e; p +=3D 16)<= br>-        if(memcmp(p, signature, sl) =3D=3D 0)<= /span>
-            return p;<= br>+    sl =3D strlen(sig);
+    e= =3D addr+len-(size > sl ? size : sl);
+    for= (p =3D addr; p <=3D e; p +=3D step){
+     &nbs= p;  if(memcmp(p, sig, sl) !=3D 0)
+      = ;      continue;
+        = ;if(size && checksum(p, size) !=3D 0)
+    = ;        continue;
+      = ;  return p;
+    }
  &= nbsp;return nil;
}

@@ -359= ,7 +372,7 @@ convmemsize(void)
}
void*
-sigsearch(char* signature)
+s= igsearch(char* signature, int size)
{
&nb= sp;  uintptr p;
   uchar *bda;
@@ -376,18 +389,44 @@ sigsearch(char* signature)

 = ;  bda =3D KADDR(0x400);
   if(memcmp(KADDR= (0xfffd9), "EISA", 4) =3D=3D 0){
      &nbs= p;if((p =3D (bda[0x0f]<<8)|bda[0x0e]) !=3D 0){
-  = ;          if((r =3D sigscan(KADDR(p<<4), 102= 4, signature)) !=3D nil)
+          = ;  if((r =3D sigscan(KADDR(p<<4), 1024, signature, size, 16)) !=3D= nil)
              &nb= sp;return r;
       }
=    }
-    if((r =3D sigscan(KADDR(conv= memsize()), 1024, signature)) !=3D nil)
+    if((r= =3D sigscan(KADDR(convmemsize()), 1024, signature, size, 16)) !=3D nil)
       return r;
<= br>    /* hack for virtualbox: look in KiB below 0xa0000 */=
-    if((r =3D sigscan(KADDR(0xa0000-1024), 1024,= signature)) !=3D nil)
+    if((r =3D sigscan(KADD= R(0xa0000-1024), 1024, signature, size, 16)) !=3D nil)
&nb= sp;      return r;

-   &= nbsp;return sigscan(KADDR(0xe0000), 0x20000, signature);
+ &= nbsp;  return sigscan(KADDR(0xe0000), 0x20000, signature, size, 16);
+}
+
+void*
+r= sdsearch(void)
+{
+    static char= signature[] =3D "RSD PTR ";
+    uchar *v, *p;
+    Map *m;
+
+ &nb= sp;  if((p =3D sigsearch(signature, 36)) !=3D nil)
+ &n= bsp;      return p;
+    if((p =3D s= igsearch(signature, 20)) !=3D nil)
+       &n= bsp;return p;
+    for(m =3D rmapacpi.map; m < r= mapacpi.mapend && m->size; m++){
+     &= nbsp;  if(m->size > 0x7FFFFFFF)
+     &= nbsp;      continue;
+       &= nbsp;if((v =3D vmap(m->addr, m->size)) !=3D nil){
+ &n= bsp;          p =3D sigscan(v, m->size, signatur= e, 36, 4);
+            if(p =3D= =3D nil)
+               &= nbsp;p =3D sigscan(v, m->size, signature, 20, 4);
+  = ;          vunmap(v, m->size);
+=            if(p !=3D nil)
+ &= nbsp;              return vmap(m->addr= + (p - v), 64);
+        }
+    }

+    return nil;
}


static void
@@ -683= ,6 +722,10 @@ map(ulong base, ulong len, int type)
  &= nbsp;    mapfree(&rmapupa, base, len);
 = ;      flags =3D 0;
      &n= bsp;break;
+    case MemACPI:
+ &n= bsp;      mapfree(&rmapacpi, base, len);
= +        flags =3D 0;
+     &n= bsp;  break;
   default:
&= nbsp;  case MemReserved:
       f= lags =3D 0;
@@ -774,7 +817,18 @@ e820scan(void)
        */

      &= nbsp;if(last < base)
         =  map(last, base-last, MemUPA);
-       &= nbsp;map(base, len, (e->type =3D=3D 1) ? MemRAM : MemReserved);+
+        switch(e->type){
+        case 1:
+   &= nbsp;        map(base, len, MemRAM);
+ &= nbsp;          break;
+   &nbs= p;    case 3:
+          =  map(base, len, MemACPI);
+        = ;    break;
+        default:<= /span>
+            map(base, len, Me= mReserved);
+        }
+=
       last =3D base + len;        if(last =3D=3D 0)
&nbs= p;          break;
diff --git a/sys= /src/9/pc/pci.c b/sys/src/9/pc/pci.c
--- a/sys/src/9/pc/pci.= c
+++ b/sys/src/9/pc/pci.c
@@ -748,7 +748,7 @= @ pcirouting(void)
   Pcidev *sbpci, *pci;

   uchar *p, pin, irq, link, *map;

-    if((p =3D sigsearch("$PIR")) =3D=3D nil)
+    if((p =3D sigsearch("$PIR", 0)) =3D=3D nil)=
       return;

   r =3D (Router*)p;

diff --git a/sys/src/9/= pc64/fns.h b/sys/src/9/pc64/fns.h
--- a/sys/src/9/pc64/fns.h=
+++ b/sys/src/9/pc64/fns.h
@@ -170,10 +170,= 11 @@ void    putdr7(u64int);
void*    = rampage(void);
int    rdmsr(int, vlong*);<= br> void    realmode(Ureg*);
+void*   &= nbsp;rsdsearch(void);
void    screeninit(void);
void    (*screenputs)(char*, int);
void    setconfenv(void);

-void*    si= gsearch(char*);
+void*    sigsearch(char*, int);
void    syncclock(void);
void &nb= sp;  syscallentry(void);
void    touser(void= *);
diff --git a/sys/src/9/pc64/memory.c b/sys/src/9/pc64/me= mory.c
--- a/sys/src/9/pc64/memory.c
+++ b/s= ys/src/9/pc64/memory.c
@@ -20,8 +20,9 @@ enum {
   MemUPA        =3D 0,     &n= bsp;  /* unbacked physical address */

   Me= mRAM        =3D 1,        /* physica= l memory */
   MemUMB        = ;=3D 2,        /* upper memory block (<16MB) */
-    MemReserved    =3D 3,
- &= nbsp;  NMemType    =3D 4,
+    MemA= CPI        =3D 3,        /* ACPI tab= les */
+    MemReserved    =3D 4,=
+    NMemType    =3D 5,

   KB        =3D 1024,
= };
@@ -72,6 +73,13 @@ static RMap rmapumbrw =3D {
   &mapumbrw[nelem(mapumbrw)-1],
};


+static Map mapacpi[16];
+static RMap rmapacpi =3D {

+    "ACPI tables"= ,
+    mapacpi,
+    &am= p;mapacpi[nelem(mapacpi)-1],
+};
+ void
mapprint(RMap *rmap)
{=
@@ -98,6 +106,7 @@ memdebug(void)
   m= apprint(&rmapumb);
   mapprint(&rmapumbr= w);
   mapprint(&rmapupa);
+=    mapprint(&rmapacpi);
}

static void
@@ -324,16 +333,20 @@ checksum(v= oid *v, int n)
}

static v= oid*
-sigscan(uchar* addr, int len, char* signature)<= br>+sigscan(uchar *addr, int len, char *sig, int size, int step)
{
+    uchar *e, *p;
=    int sl;
-    uchar *e, *p;
-    e =3D addr+len;
- &nb= sp;  sl =3D strlen(signature);
-    for(p =3D= addr; p+sl < e; p +=3D 16)
-        = if(memcmp(p, signature, sl) =3D=3D 0)
= --Apple-Mail-7F81F148-3DFA-47BA-BE1A-790D6E5248DD--