9front - general discussion about 9front
 help / color / mirror / Atom feed
* Fwd: [9front-commits] 23hiro: hg/plan9front: spelling
       [not found] <hg.57022f22e3f0.1532417535.4892889753185008284@code.9front.org>
@ 2018-07-24 13:09 ` Stanley Lieber
  2018-07-24 14:31   ` [9front] " Julius Schmidt
  0 siblings, 1 reply; 3+ messages in thread
From: Stanley Lieber @ 2018-07-24 13:09 UTC (permalink / raw)
  To: 9front

[-- Attachment #1: Type: text/plain, Size: 10872 bytes --]

“spelling” ???

sl


Begin forwarded message:

> From: The Computer <commits@code.9front.org>
> 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
> 
> 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
> 
> Subject: 23hiro: hg/plan9front: merge
> 
> 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
> 
> 
> diffstat:
> 
> 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(-)
> 
> diffs (truncated from 661 to 300 lines):
> 
> 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 = (uintptr)strtoull(cp, nil, 16);
>    if(pa <= 1)
> -        rsd = sigsearch("RSD PTR ");
> +        rsd = rsdsearch();
>    else if(pa < MemMin)
>        rsd = 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_ = sigsearch("_MP_")) == nil || checksum(_mp_, _MP_sz) != 0 || _mp_->physaddr == 0)
> +    if((_mp_ = sigsearch("_MP_", _MP_sz)) == nil || _mp_->physaddr == 0)
>        return 1;
> 
>    len = 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;
> 
>    VFLAG("bios32link\n");
> -    if((sdh = sigsearch("_32_")) == nil)
> -        return -1;
> -    if(checksum(sdh, sizeof(BIOS32sdh)))
> +    if((sdh = sigsearch("_32_", sizeof(BIOS32sdh))) == nil)
>        return -1;
>    VFLAG("sdh @ %#p, entry %#ux\n", sdh, l32get(sdh->physaddr));
> 
> 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        = 0,        /* unbacked physical address */
>    MemRAM        = 1,        /* physical memory */
>    MemUMB        = 2,        /* upper memory block (<16MB) */
> -    MemReserved    = 3,
> -    NMemType    = 4,
> +    MemACPI        = 3,        /* ACPI tables */
> +    MemReserved    = 4,
> +    NMemType    = 5,
> 
>    KB        = 1024,
> 
> @@ -75,6 +76,13 @@ static RMap rmapumbrw = {
>    &mapumbrw[nelem(mapumbrw)-1],
> };
> 
> +static Map mapacpi[16];
> +static RMap rmapacpi = {
> +    "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);
> }
> 
> static void
> @@ -327,16 +336,20 @@ checksum(void *v, int n)
> }
> 
> 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;
> 
> -    e = addr+len;
> -    sl = strlen(signature);
> -    for(p = addr; p+sl < e; p += 16)
> -        if(memcmp(p, signature, sl) == 0)
> -            return p;
> +    sl = strlen(sig);
> +    e = addr+len-(size > sl ? size : sl);
> +    for(p = addr; p <= e; p += step){
> +        if(memcmp(p, sig, sl) != 0)
> +            continue;
> +        if(size && checksum(p, size) != 0)
> +            continue;
> +        return p;
> +    }
>    return nil;
> }
> 
> @@ -359,7 +372,7 @@ convmemsize(void)
> }
> 
> void*
> -sigsearch(char* signature)
> +sigsearch(char* signature, int size)
> {
>    uintptr p;
>    uchar *bda;
> @@ -376,18 +389,44 @@ sigsearch(char* signature)
>    bda = KADDR(0x400);
>    if(memcmp(KADDR(0xfffd9), "EISA", 4) == 0){
>        if((p = (bda[0x0f]<<8)|bda[0x0e]) != 0){
> -            if((r = sigscan(KADDR(p<<4), 1024, signature)) != nil)
> +            if((r = sigscan(KADDR(p<<4), 1024, signature, size, 16)) != nil)
>                return r;
>        }
>    }
> -    if((r = sigscan(KADDR(convmemsize()), 1024, signature)) != nil)
> +    if((r = sigscan(KADDR(convmemsize()), 1024, signature, size, 16)) != nil)
>        return r;
> 
>    /* hack for virtualbox: look in KiB below 0xa0000 */
> -    if((r = sigscan(KADDR(0xa0000-1024), 1024, signature)) != nil)
> +    if((r = sigscan(KADDR(0xa0000-1024), 1024, signature, size, 16)) != nil)
>        return r;
> 
> -    return sigscan(KADDR(0xe0000), 0x20000, signature);
> +    return sigscan(KADDR(0xe0000), 0x20000, signature, size, 16);
> +}
> +
> +void*
> +rsdsearch(void)
> +{
> +    static char signature[] = "RSD PTR ";
> +    uchar *v, *p;
> +    Map *m;
> +
> +    if((p = sigsearch(signature, 36)) != nil)
> +        return p;
> +    if((p = sigsearch(signature, 20)) != nil)
> +        return p;
> +    for(m = rmapacpi.map; m < rmapacpi.mapend && m->size; m++){
> +        if(m->size > 0x7FFFFFFF)
> +            continue;
> +        if((v = vmap(m->addr, m->size)) != nil){
> +            p = sigscan(v, m->size, signature, 36, 4);
> +            if(p == nil)
> +                p = sigscan(v, m->size, signature, 20, 4);
> +            vunmap(v, m->size);
> +            if(p != nil)
> +                return vmap(m->addr + (p - v), 64);
> +        }
> +    }
> +    return nil;
> }
> 
> static void
> @@ -683,6 +722,10 @@ map(ulong base, ulong len, int type)
>        mapfree(&rmapupa, base, len);
>        flags = 0;
>        break;
> +    case MemACPI:
> +        mapfree(&rmapacpi, base, len);
> +        flags = 0;
> +        break;
>    default:
>    case MemReserved:
>        flags = 0;
> @@ -774,7 +817,18 @@ e820scan(void)
>         */
>        if(last < base)
>            map(last, base-last, MemUPA);
> -        map(base, len, (e->type == 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 = base + len;
>        if(last == 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;
> 
> -    if((p = sigsearch("$PIR")) == nil)
> +    if((p = sigsearch("$PIR", 0)) == nil)
>        return;
> 
>    r = (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        = 0,        /* unbacked physical address */
>    MemRAM        = 1,        /* physical memory */
>    MemUMB        = 2,        /* upper memory block (<16MB) */
> -    MemReserved    = 3,
> -    NMemType    = 4,
> +    MemACPI        = 3,        /* ACPI tables */
> +    MemReserved    = 4,
> +    NMemType    = 5,
> 
>    KB        = 1024,
> };
> @@ -72,6 +73,13 @@ static RMap rmapumbrw = {
>    &mapumbrw[nelem(mapumbrw)-1],
> };
> 
> +static Map mapacpi[16];
> +static RMap rmapacpi = {
> +    "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);
> }
> 
> static void
> @@ -324,16 +333,20 @@ checksum(void *v, int n)
> }
> 
> 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;
> 
> -    e = addr+len;
> -    sl = strlen(signature);
> -    for(p = addr; p+sl < e; p += 16)
> -        if(memcmp(p, signature, sl) == 0)

[-- Attachment #2: Type: text/html, Size: 20296 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9front] Fwd: [9front-commits] 23hiro: hg/plan9front: spelling
  2018-07-24 13:09 ` Fwd: [9front-commits] 23hiro: hg/plan9front: spelling Stanley Lieber
@ 2018-07-24 14:31   ` Julius Schmidt
  2018-07-24 14:44     ` hiro
  0 siblings, 1 reply; 3+ messages in thread
From: Julius Schmidt @ 2018-07-24 14:31 UTC (permalink / raw)
  To: 9front

[-- Attachment #1: Type: TEXT/PLAIN, Size: 13821 bytes --]

      1.1--- a/sys/man/6/authsrv
      1.2+++ b/sys/man/6/authsrv
      1.3@@ -293,7 +293,7 @@ Initially, the server and client keys
      1.4 .I Ks
      1.5 and
      1.6 .I Kc
      1.7-where equivalent to the password derived 56-bit DES keys, which
      1.8+were equivalent to the password derived 56-bit DES keys, which
      1.9 made the encrypted tickets subject to offline dictionary attacks
     1.10 and provided too small a key space against brute force attacks
     1.11 on current hardware.

That's hiro's commit.

The rest is stuff merged from cinap.

On Tue, 24 Jul 2018, Stanley Lieber wrote:

> “spelling” ???
> 
> sl
> 
> 
> Begin forwarded message:
>
>       From: The Computer <commits@code.9front.org>
>       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
>
>       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
>
>       Subject: 23hiro: hg/plan9front: merge
>
>       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
> 
>
>       diffstat:
>
>       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(-)
>
>       diffs (truncated from 661 to 300 lines):
>
>       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 = (uintptr)strtoull(cp, nil, 16);
>          if(pa <= 1)
>       -        rsd = sigsearch("RSD PTR ");
>       +        rsd = rsdsearch();
>          else if(pa < MemMin)
>              rsd = 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_ = sigsearch("_MP_")) == nil || checksum(_mp_, _MP_sz) != 0 || _mp_->physaddr == 0)
>       +    if((_mp_ = sigsearch("_MP_", _MP_sz)) == nil || _mp_->physaddr == 0)
>              return 1;
>
>          len = 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;
>
>          VFLAG("bios32link\n");
>       -    if((sdh = sigsearch("_32_")) == nil)
>       -        return -1;
>       -    if(checksum(sdh, sizeof(BIOS32sdh)))
>       +    if((sdh = sigsearch("_32_", sizeof(BIOS32sdh))) == nil)
>              return -1;
>          VFLAG("sdh @ %#p, entry %#ux\n", sdh, l32get(sdh->physaddr));
>
>       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        = 0,        /* unbacked physical address */
>          MemRAM        = 1,        /* physical memory */
>          MemUMB        = 2,        /* upper memory block (<16MB) */
>       -    MemReserved    = 3,
>       -    NMemType    = 4,
>       +    MemACPI        = 3,        /* ACPI tables */
>       +    MemReserved    = 4,
>       +    NMemType    = 5,
>
>          KB        = 1024,
>
>       @@ -75,6 +76,13 @@ static RMap rmapumbrw = {
>          &mapumbrw[nelem(mapumbrw)-1],
>       };
>
>       +static Map mapacpi[16];
>       +static RMap rmapacpi = {
>       +    "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);
>       }
>
>       static void
>       @@ -327,16 +336,20 @@ checksum(void *v, int n)
>       }
>
>       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;
>
>       -    e = addr+len;
>       -    sl = strlen(signature);
>       -    for(p = addr; p+sl < e; p += 16)
>       -        if(memcmp(p, signature, sl) == 0)
>       -            return p;
>       +    sl = strlen(sig);
>       +    e = addr+len-(size > sl ? size : sl);
>       +    for(p = addr; p <= e; p += step){
>       +        if(memcmp(p, sig, sl) != 0)
>       +            continue;
>       +        if(size && checksum(p, size) != 0)
>       +            continue;
>       +        return p;
>       +    }
>          return nil;
>       }
>
>       @@ -359,7 +372,7 @@ convmemsize(void)
>       }
>
>       void*
>       -sigsearch(char* signature)
>       +sigsearch(char* signature, int size)
>       {
>          uintptr p;
>          uchar *bda;
>       @@ -376,18 +389,44 @@ sigsearch(char* signature)
>          bda = KADDR(0x400);
>          if(memcmp(KADDR(0xfffd9), "EISA", 4) == 0){
>              if((p = (bda[0x0f]<<8)|bda[0x0e]) != 0){
>       -            if((r = sigscan(KADDR(p<<4), 1024, signature)) != nil)
>       +            if((r = sigscan(KADDR(p<<4), 1024, signature, size, 16)) != nil)
>                      return r;
>              }
>          }
>       -    if((r = sigscan(KADDR(convmemsize()), 1024, signature)) != nil)
>       +    if((r = sigscan(KADDR(convmemsize()), 1024, signature, size, 16)) != nil)
>              return r;
>
>          /* hack for virtualbox: look in KiB below 0xa0000 */
>       -    if((r = sigscan(KADDR(0xa0000-1024), 1024, signature)) != nil)
>       +    if((r = sigscan(KADDR(0xa0000-1024), 1024, signature, size, 16)) != nil)
>              return r;
>
>       -    return sigscan(KADDR(0xe0000), 0x20000, signature);
>       +    return sigscan(KADDR(0xe0000), 0x20000, signature, size, 16);
>       +}
>       +
>       +void*
>       +rsdsearch(void)
>       +{
>       +    static char signature[] = "RSD PTR ";
>       +    uchar *v, *p;
>       +    Map *m;
>       +
>       +    if((p = sigsearch(signature, 36)) != nil)
>       +        return p;
>       +    if((p = sigsearch(signature, 20)) != nil)
>       +        return p;
>       +    for(m = rmapacpi.map; m < rmapacpi.mapend && m->size; m++){
>       +        if(m->size > 0x7FFFFFFF)
>       +            continue;
>       +        if((v = vmap(m->addr, m->size)) != nil){
>       +            p = sigscan(v, m->size, signature, 36, 4);
>       +            if(p == nil)
>       +                p = sigscan(v, m->size, signature, 20, 4);
>       +            vunmap(v, m->size);
>       +            if(p != nil)
>       +                return vmap(m->addr + (p - v), 64);
>       +        }
>       +    }
>       +    return nil;
>       }
>
>       static void
>       @@ -683,6 +722,10 @@ map(ulong base, ulong len, int type)
>              mapfree(&rmapupa, base, len);
>              flags = 0;
>              break;
>       +    case MemACPI:
>       +        mapfree(&rmapacpi, base, len);
>       +        flags = 0;
>       +        break;
>          default:
>          case MemReserved:
>              flags = 0;
>       @@ -774,7 +817,18 @@ e820scan(void)
>               */
>              if(last < base)
>                  map(last, base-last, MemUPA);
>       -        map(base, len, (e->type == 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 = base + len;
>              if(last == 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;
>
>       -    if((p = sigsearch("$PIR")) == nil)
>       +    if((p = sigsearch("$PIR", 0)) == nil)
>              return;
>
>          r = (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        = 0,        /* unbacked physical address */
>          MemRAM        = 1,        /* physical memory */
>          MemUMB        = 2,        /* upper memory block (<16MB) */
>       -    MemReserved    = 3,
>       -    NMemType    = 4,
>       +    MemACPI        = 3,        /* ACPI tables */
>       +    MemReserved    = 4,
>       +    NMemType    = 5,
>
>          KB        = 1024,
>       };
>       @@ -72,6 +73,13 @@ static RMap rmapumbrw = {
>          &mapumbrw[nelem(mapumbrw)-1],
>       };
>
>       +static Map mapacpi[16];
>       +static RMap rmapacpi = {
>       +    "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);
>       }
>
>       static void
>       @@ -324,16 +333,20 @@ checksum(void *v, int n)
>       }
>
>       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;
>
>       -    e = addr+len;
>       -    sl = strlen(signature);
>       -    for(p = addr; p+sl < e; p += 16)
>       -        if(memcmp(p, signature, sl) == 0)
> 
> 
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9front] Fwd: [9front-commits] 23hiro: hg/plan9front: spelling
  2018-07-24 14:31   ` [9front] " Julius Schmidt
@ 2018-07-24 14:44     ` hiro
  0 siblings, 0 replies; 3+ messages in thread
From: hiro @ 2018-07-24 14:44 UTC (permalink / raw)
  To: 9front

hg does merges a bit differently than git.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-07-24 14:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <hg.57022f22e3f0.1532417535.4892889753185008284@code.9front.org>
2018-07-24 13:09 ` Fwd: [9front-commits] 23hiro: hg/plan9front: spelling Stanley Lieber
2018-07-24 14:31   ` [9front] " Julius Schmidt
2018-07-24 14:44     ` hiro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).