]> git.lizzy.rs Git - plan9front.git/log
plan9front.git
3 years agographics(2): fix typo
kvik [Sun, 28 Jun 2020 21:45:18 +0000 (23:45 +0200)]
graphics(2): fix typo

3 years agokernel: segflush() needs to flush tlb of other processes
cinap_lenrek [Sun, 28 Jun 2020 14:26:59 +0000 (16:26 +0200)]
kernel: segflush() needs to flush tlb of other processes

instruction cache maintenance is done on tlb miss;
when a page gets fauled in; with putmmu() checking
the page->txtflush cpu bitmap.

syssegflush() used to only call flushmmu() after
segflush() for the calling process, but when a segment
is shared with other processes, we have to flush the
other processes tlb as well.

this adds the missing procflushseg() call into segflush().

note that procflushseg() leaves the calling process alone,
so the flushmmu() call in syssegflush() is still required.

segmentioproc() does not need to call flushmmu() after
segflush() as it is never going to jump to the modified
page, hence the stale icache does not matter.

3 years agoaux/trampoline: Implement inactivity timeout (-t option)
cinap_lenrek [Sat, 27 Jun 2020 14:40:53 +0000 (16:40 +0200)]
aux/trampoline: Implement inactivity timeout (-t option)

Using aux/trampoline to relay udp traffic needs a inactivity
timeout to be practical as there is no explicit connection
termination.

3 years ago9p(2): fix typo
kvik [Thu, 25 Jun 2020 21:23:23 +0000 (23:23 +0200)]
9p(2): fix typo

3 years agoupas/fs: remove now unused Mtrunc mimeflags constant
cinap_lenrek [Wed, 24 Jun 2020 17:21:47 +0000 (19:21 +0200)]
upas/fs: remove now unused Mtrunc mimeflags constant

3 years agoupas/fs: use memchr() instead of strchr() in hdrlen()
cinap_lenrek [Wed, 24 Jun 2020 17:18:37 +0000 (19:18 +0200)]
upas/fs: use memchr() instead of strchr() in hdrlen()

make sure we look for the end of the header within the
pointer range, and not accidentally read beyond hend.

also, messages are not null terminated, so this could
even go beyond the email data buffer.

get rid of mimeflag which was only used for some assert
checks.

take header length into account when comparing header
against ignored header strings.

3 years agomerge
cinap_lenrek [Wed, 24 Jun 2020 16:47:03 +0000 (18:47 +0200)]
merge

3 years agoip/tinc: run script sub-shell in its own environment
cinap_lenrek [Wed, 24 Jun 2020 16:45:58 +0000 (18:45 +0200)]
ip/tinc: run script sub-shell in its own environment

3 years agoacme/win: add trailing space to window tag
Alex Musolino [Tue, 23 Jun 2020 09:11:00 +0000 (18:41 +0930)]
acme/win: add trailing space to window tag

3 years agoupas/marshal: make attachment failure fatal
Alex Musolino [Mon, 22 Jun 2020 07:04:31 +0000 (16:34 +0930)]
upas/marshal: make attachment failure fatal

3 years agousbxhci: implement isochronous in transfers (for webcam, audio recording)
cinap_lenrek [Sun, 21 Jun 2020 19:42:13 +0000 (21:42 +0200)]
usbxhci: implement isochronous in transfers (for webcam, audio recording)

3 years agodevusb: keep isochronous ep->hz consistent with maxpkt, ntds and pollival
cinap_lenrek [Sun, 21 Jun 2020 19:36:50 +0000 (21:36 +0200)]
devusb: keep isochronous ep->hz consistent with maxpkt, ntds and pollival

The sample frequency is an artificial parameter used for
isochronous out transfers to better match the target
frequency (usually, a sound card).

when hz is set, devusb adjusts the endpoint's maxpkt to get
the requested frequency and a multiple of the samplesize per
packet.

however, when hz is not set, then we should calculate the
frequency from maxpkt, ntds and pollival, so all parameters
will be consistent with each other.

3 years agoabaco: add fonts.h to HFILES in mkfile (thanks eekee)
Alex Musolino [Sun, 21 Jun 2020 10:04:54 +0000 (19:34 +0930)]
abaco: add fonts.h to HFILES in mkfile (thanks eekee)

3 years agoip/torrent: fix size check in 64-bit "v" unpack (thanks pr)
cinap_lenrek [Fri, 19 Jun 2020 18:19:57 +0000 (20:19 +0200)]
ip/torrent: fix size check in 64-bit "v" unpack (thanks pr)

4 years agocifsd(8): fix typo (thanks senthil)
Alex Musolino [Thu, 18 Jun 2020 02:41:06 +0000 (12:11 +0930)]
cifsd(8): fix typo (thanks senthil)

4 years agoadd a compose sequence to type ⑨
Sigrid [Tue, 16 Jun 2020 15:29:00 +0000 (17:29 +0200)]
add a compose sequence to type ⑨

4 years agolibc: revert date change again. this is getting ridicuoulus.
cinap_lenrek [Sun, 14 Jun 2020 22:12:57 +0000 (00:12 +0200)]
libc: revert date change again. this is getting ridicuoulus.

this breaks the sample from the seconds manpage, and overall
produces funky results. this needs alot more testing.

term% seconds '23 may 2011'
seconds: tmparse: invalid date 23 may 2011 near 'may 2011'

term% seconds '2019-01-01 00:00:00'
-118370073600

4 years agolibc, seconds: new time and date apis (try 2)
Ori Bernstein [Sun, 14 Jun 2020 16:33:32 +0000 (09:33 -0700)]
libc, seconds: new time and date apis (try 2)

Redo date handling in libc almost entirely. This allows
handling dates and times from outside your timezones,
fixes timezone loading in multithreaded applications,
and allows parsing and formatting using custom format
strings.

As a test of the APIs, we replace the formatting code in
seconds(1), shrinking it massively.

The last commit missed a few removals, and made it
unnecessarily hard to do an update.

4 years agolibc: reverting previous change until ori can fix it
cinap_lenrek [Sun, 14 Jun 2020 02:47:22 +0000 (04:47 +0200)]
libc: reverting previous change until ori can fix it

4 years agolibc, seconds: new time and date apis.
Ori Bernstein [Sat, 13 Jun 2020 19:38:49 +0000 (12:38 -0700)]
libc, seconds: new time and date apis.

Redo date handling in libc almost entirely. This allows
handling dates and times from outside your timezones,
fixes timezone loading in multithreaded applications,
and allows parsing and formatting using custom format
strings.

As a test of the APIs, we replace the formatting code in
seconds(1), shrinking it massively.

4 years agomerge
cinap_lenrek [Thu, 11 Jun 2020 23:36:50 +0000 (01:36 +0200)]
merge

4 years agoramfs: make Elocked[] more consistent (thanks fazlul)
cinap_lenrek [Thu, 11 Jun 2020 23:35:37 +0000 (01:35 +0200)]
ramfs: make Elocked[] more consistent (thanks fazlul)

Go expects the error to be one of the three errors returned in
Bell Labs Plan 9. As listed in
https://github.com/golang/go/blob/f7ba82d68f90e20aa9e6aa973cb6f12321abec71/src/cmd/go/internal/lockedfile/lockedfile_plan9.go#L16:

// Opening an exclusive-use file returns an error.
// The expected error strings are:
//
//  - "open/create -- file is locked" (cwfs, kfs)
//  - "exclusive lock" (fossil)
//  - "exclusive use file already open" (ramfs)
var lockedErrStrings = [...]string{
"file is locked",
"exclusive lock",
"exclusive use file already open",
}

4 years agoacme: implement position-dependent scroll-wheel scrolling
kvik [Thu, 11 Jun 2020 13:33:57 +0000 (15:33 +0200)]
acme: implement position-dependent scroll-wheel scrolling

This brings acme scrolling behaviour in line with that of 9front's rio
and sam, where the amount scrolled varies with a vertical position of
the pointer within the window, similar to how the scrollbar works.

At some point it would be good to implement a line-at-a-time scrolling
when the Shift key is pressed, as seen in rio.  For this to happen the
acme keyboard input needs to be rewritten in terms of /dev/kbd instead
of relying on keyboard(2) -- that is, the /dev/cons interface.

4 years agolibplumb: add missing mkfile
Ori Bernstein [Tue, 9 Jun 2020 19:23:24 +0000 (12:23 -0700)]
libplumb: add missing mkfile

4 years agoacme: document log file in manpage
Ori Bernstein [Sun, 7 Jun 2020 15:27:36 +0000 (08:27 -0700)]
acme: document log file in manpage

4 years agoacme: add missing logf.c
cinap_lenrek [Sun, 7 Jun 2020 15:06:33 +0000 (17:06 +0200)]
acme: add missing logf.c

4 years agoip/6in4: request ipv4 packets only in ipmux filter
cinap_lenrek [Sun, 7 Jun 2020 14:56:54 +0000 (16:56 +0200)]
ip/6in4: request ipv4 packets only in ipmux filter

4 years agodevip: implement ipv6 support in ipmux packet filter
cinap_lenrek [Sun, 7 Jun 2020 14:56:01 +0000 (16:56 +0200)]
devip: implement ipv6 support in ipmux packet filter

Added a ver= field to the filter to distinguish the ip version.
By default, a filter is parsed as ipv6, and after parsing
proto, src and dst fields are converted to ipv4. When no
ver= field is specified, a ip version filter is implicitely
added and both protocols are parsed.

This change also gets rid of the fast compare types as the
filed might not be aligned correctly in the packet.

This also fixes the ifc= filter, as we have to check any
local address.

4 years agosnoopy: add ipmux pseudo protocol
cinap_lenrek [Sun, 7 Jun 2020 14:48:04 +0000 (16:48 +0200)]
snoopy: add ipmux pseudo protocol

the ipmux pseudo protocol handles the extra ipv6 interface address
prefixed to the ip header as used by /net/ipmux packet filter.

4 years agodevip: fix parseipmask() prototype in ip.h
cinap_lenrek [Sun, 7 Jun 2020 14:45:55 +0000 (16:45 +0200)]
devip: fix parseipmask() prototype in ip.h

4 years agoacme: import event log from plan9port (thanks fshahriar)
Ori Bernstein [Sun, 7 Jun 2020 02:05:00 +0000 (19:05 -0700)]
acme: import event log from plan9port (thanks fshahriar)

Based off the following 3 commits:

4a3fb87264f8bc03fc62f00ef335056f30d18023
45f8ba54143323f08a21343633764caa59aa3ea3
fdf6ef333705c844bcf3ccf2f93b2773f1a6aa41

Reading /mnt/acme/log reports a log of window create,
put, focus, and delete events, as they happen. It blocks
until the next event is available.

Example log output:

8 new /Users/rsc/foo.go
8 put /Users/rsc/foo.go
8 del /Users/rsc/foo.go

This lets acme-aware programs react to file writes, for example
compiling code, running a test, or updating an import block.

4 years agodevip: pick less surprising interface address in header for incoming UDP packets
cinap_lenrek [Sat, 6 Jun 2020 21:46:01 +0000 (23:46 +0200)]
devip: pick less surprising interface address in header for incoming UDP packets

We used to just return the first address of the incoming
interface regardless of if the address matches the source
ip type and scope.

This change tries to find the best interface address that
will match the source ip so it can be used as a source
address when replying to the packet.

4 years agomerge
cinap_lenrek [Sat, 6 Jun 2020 14:52:01 +0000 (16:52 +0200)]
merge

4 years agoaux/vga: use 64-bit physical addresses for pci membar
cinap_lenrek [Sat, 6 Jun 2020 14:44:14 +0000 (16:44 +0200)]
aux/vga: use 64-bit physical addresses for pci membar

4 years agodevlml: use 64-bit physical addresses
cinap_lenrek [Sat, 6 Jun 2020 14:31:39 +0000 (16:31 +0200)]
devlml: use 64-bit physical addresses

4 years agoaudiosb16: cleanup audioprobe(), cast ISAConf.port to ulong
cinap_lenrek [Sat, 6 Jun 2020 14:31:07 +0000 (16:31 +0200)]
audiosb16: cleanup audioprobe(), cast ISAConf.port to ulong

4 years agoaudioac97: use 64-bit physical addresses
cinap_lenrek [Sat, 6 Jun 2020 14:25:00 +0000 (16:25 +0200)]
audioac97: use 64-bit physical addresses

4 years agoaudiohda: use 64-bit physical addresses, check pci membar types
cinap_lenrek [Sat, 6 Jun 2020 14:23:58 +0000 (16:23 +0200)]
audiohda: use 64-bit physical addresses, check pci membar types

4 years agopc/pcmciamodem: cast i/o port to ulong
cinap_lenrek [Sat, 6 Jun 2020 14:21:42 +0000 (16:21 +0200)]
pc/pcmciamodem: cast i/o port to ulong

4 years agopc/pmmc: check pci membar type
cinap_lenrek [Sat, 6 Jun 2020 14:19:25 +0000 (16:19 +0200)]
pc/pmmc: check pci membar type

4 years agouartaxp: use 64-bit physical addresses and check pci membar types
cinap_lenrek [Sat, 6 Jun 2020 14:18:52 +0000 (16:18 +0200)]
uartaxp: use 64-bit physical addresses and check pci membar types

4 years agopc/wavelan: print Ether.port as 64-bit value
cinap_lenrek [Sat, 6 Jun 2020 14:18:06 +0000 (16:18 +0200)]
pc/wavelan: print Ether.port as 64-bit value

4 years agosd53c8xx: use 64-bit physical addresses
cinap_lenrek [Sat, 6 Jun 2020 14:16:48 +0000 (16:16 +0200)]
sd53c8xx: use 64-bit physical addresses

4 years agosdmv50xx: use 64-bit physical addresses and check pci membar type
cinap_lenrek [Sat, 6 Jun 2020 14:16:03 +0000 (16:16 +0200)]
sdmv50xx: use 64-bit physical addresses and check pci membar type

4 years agosdiahci: use 64-bit physical addresses
cinap_lenrek [Sat, 6 Jun 2020 14:14:58 +0000 (16:14 +0200)]
sdiahci: use 64-bit physical addresses

4 years agosdodin: use 64-bit physical addresses and check pci membar type
cinap_lenrek [Sat, 6 Jun 2020 14:14:02 +0000 (16:14 +0200)]
sdodin: use 64-bit physical addresses and check pci membar type

4 years agosdnvme: make sure pci membar type is memory
cinap_lenrek [Sat, 6 Jun 2020 14:10:58 +0000 (16:10 +0200)]
sdnvme: make sure pci membar type is memory

4 years agousbuhci: make sure pci membar type is i/o
cinap_lenrek [Sat, 6 Jun 2020 14:10:04 +0000 (16:10 +0200)]
usbuhci: make sure pci membar type is i/o

4 years agousbehcipc: use 64-bit physical addresses and check pci membar type
cinap_lenrek [Sat, 6 Jun 2020 14:05:40 +0000 (16:05 +0200)]
usbehcipc: use 64-bit physical addresses and check pci membar type

4 years agopc/ether*: use 64-bit physical addresses and check pci membar types and sizes
cinap_lenrek [Sat, 6 Jun 2020 14:04:24 +0000 (16:04 +0200)]
pc/ether*: use 64-bit physical addresses and check pci membar types and sizes

4 years agopc/vga*: use 64-bit physical addresses and check pci membar types and sizes
cinap_lenrek [Sat, 6 Jun 2020 13:58:18 +0000 (15:58 +0200)]
pc/vga*: use 64-bit physical addresses and check pci membar types and sizes

4 years agoarchacpi: use 64-bit uvlong for physical addresses
cinap_lenrek [Sat, 6 Jun 2020 13:44:17 +0000 (15:44 +0200)]
archacpi: use 64-bit uvlong for physical addresses

4 years agodevvga: use 64-bit physical addresses for framebuffer
cinap_lenrek [Sat, 6 Jun 2020 13:23:50 +0000 (15:23 +0200)]
devvga: use 64-bit physical addresses for framebuffer

4 years agodevpccard: use 64-bit physical addresses
cinap_lenrek [Sat, 6 Jun 2020 13:21:27 +0000 (15:21 +0200)]
devpccard: use 64-bit physical addresses

4 years agousbxhci: use 64-bit physical addresses
cinap_lenrek [Sat, 6 Jun 2020 13:18:18 +0000 (15:18 +0200)]
usbxhci: use 64-bit physical addresses

4 years agodevpnp, devether, devusb: cast ISAConf.port to uvlong (for 32-bit implementations)
cinap_lenrek [Sat, 6 Jun 2020 13:17:08 +0000 (15:17 +0200)]
devpnp, devether, devusb: cast ISAConf.port to uvlong (for 32-bit implementations)

The ISAConf.port might still be 32-bit on some archs.

4 years agodevusb: print Hci.port as 64-bit uvlong
cinap_lenrek [Sat, 6 Jun 2020 13:12:50 +0000 (15:12 +0200)]
devusb: print Hci.port as 64-bit uvlong

4 years agodevether: print Ether.port as 64-bit uvlong
cinap_lenrek [Sat, 6 Jun 2020 13:11:56 +0000 (15:11 +0200)]
devether: print Ether.port as 64-bit uvlong

4 years agodevpnp: print pci membar as 64-bit uvlong
cinap_lenrek [Sat, 6 Jun 2020 13:10:23 +0000 (15:10 +0200)]
devpnp: print pci membar as 64-bit uvlong

4 years agobcm64: bring pci code in line with the pc/pc64
cinap_lenrek [Sat, 6 Jun 2020 13:06:07 +0000 (15:06 +0200)]
bcm64: bring pci code in line with the pc/pc64

4 years agobcm64: use uvlong for ISAConf.port
cinap_lenrek [Sat, 6 Jun 2020 13:01:56 +0000 (15:01 +0200)]
bcm64: use uvlong for ISAConf.port

4 years agobcm64: use 64-bit uvlong physical address in vmap()
cinap_lenrek [Sat, 6 Jun 2020 13:01:20 +0000 (15:01 +0200)]
bcm64: use 64-bit uvlong physical address in vmap()

4 years agopc, pc64: implement 64-bit pci membar support
cinap_lenrek [Sat, 6 Jun 2020 12:58:20 +0000 (14:58 +0200)]
pc, pc64: implement 64-bit pci membar support

4 years agopc, pc64: use 64-bit physical addresses for ISAConf.port
cinap_lenrek [Sat, 6 Jun 2020 12:52:16 +0000 (14:52 +0200)]
pc, pc64: use 64-bit physical addresses for ISAConf.port

4 years agopc, pc64: use 64-bit physical addresses for vmap() and upaalloc()
cinap_lenrek [Sat, 6 Jun 2020 12:43:24 +0000 (14:43 +0200)]
pc, pc64: use 64-bit physical addresses for vmap() and upaalloc()

4 years agoape: add missing rerrstr.c
Ori Bernstein [Sat, 6 Jun 2020 01:52:22 +0000 (18:52 -0700)]
ape: add missing rerrstr.c

4 years agoape: make libplumb available under ape.
Ori Bernstein [Fri, 5 Jun 2020 18:28:47 +0000 (11:28 -0700)]
ape: make libplumb available under ape.

This adds the mkfiles and plumb.h to ape,
similar to how libdraw is made available.
This is used for ports such as netsurf.

4 years agoaux/getflags: fix named rune arguments.
Ori Bernstein [Thu, 4 Jun 2020 18:41:03 +0000 (11:41 -0700)]
aux/getflags: fix named rune arguments.

Flags can be runes. That means that we can't just
look at p[1] to decide if we have a named argument,
we need to look one rune forward. This change
does that.

4 years agomerge
cinap_lenrek [Sun, 31 May 2020 22:07:01 +0000 (00:07 +0200)]
merge

4 years agoacme: implement 'scratch' ctl command (thanks Drew DeVault)
kvik [Sun, 31 May 2020 20:39:46 +0000 (22:39 +0200)]
acme: implement 'scratch' ctl command (thanks Drew DeVault)

The new command marks the target window as a scratch window -- a window
whose state cannot be "dirtied" by changes made to its body, therefore
avoiding warnings about unsaved changes when deleting the window or
exiting acme.

Existing examples of scratch windows are error, directory, and guide
windows, whose scratchness is set internally.

With the new command users and programs alike can create their own
scratch windows.  This is put to use in acme's own win(1).

4 years agokernel: remove unused segment argument in freepte()
cinap_lenrek [Sun, 31 May 2020 15:25:16 +0000 (17:25 +0200)]
kernel: remove unused segment argument in freepte()

4 years agopc, xen: make PAT support optional (for xen)
cinap_lenrek [Sun, 31 May 2020 12:32:19 +0000 (14:32 +0200)]
pc, xen: make PAT support optional (for xen)

4 years agoape/libdraw: add missing eenter (thanks phil9)
Ori Bernstein [Sat, 30 May 2020 17:06:21 +0000 (10:06 -0700)]
ape/libdraw: add missing eenter (thanks phil9)

4 years agoimap4d: reject invalid month in date2tm()
cinap_lenrek [Sat, 30 May 2020 11:03:05 +0000 (13:03 +0200)]
imap4d: reject invalid month in date2tm()

4 years agorc: avoid forking for final command that has variable assignments (to get $apid right)
cinap_lenrek [Sat, 30 May 2020 00:03:18 +0000 (02:03 +0200)]
rc: avoid forking for final command that has variable assignments (to get $apid right)

basically, we want the following commands to print
the same pid twice:

rc -c 'cat /dev/pid &;echo $apid'

vs:

rc -c 'a=1 cat /dev/pid &;echo $apid'

basically, Xsimple() calls exitnext() to determine if
a simple command should be promoted to exec, by peeking
ahead into the code and searching for Xexit instruction.

Xexit might not follow immediately after the Xsimple
instruction because of redirections, which exitnext()
would skip.

but it would not skip the Xunlocal instructions that
where added by the variable assignment.

4 years agoip/cifsd: add FIND_FIRST2 SMB_FIND_FILE_FULL_DIRECTORY_INFO info level
cinap_lenrek [Tue, 26 May 2020 22:09:46 +0000 (00:09 +0200)]
ip/cifsd: add FIND_FIRST2 SMB_FIND_FILE_FULL_DIRECTORY_INFO info level

4 years agosshnet: prevent ssh process from keeping the mount alive
cinap_lenrek [Tue, 26 May 2020 19:37:25 +0000 (21:37 +0200)]
sshnet: prevent ssh process from keeping the mount alive

4 years agopc, pc64: fix wrong mtrr physmask() for machines without extended address size msr
cinap_lenrek [Sun, 24 May 2020 15:50:37 +0000 (17:50 +0200)]
pc, pc64: fix wrong mtrr physmask() for machines without extended address size msr

4 years agoawk: fix race condition with sub-mk in mkfile
cinap_lenrek [Sun, 24 May 2020 14:00:45 +0000 (16:00 +0200)]
awk: fix race condition with sub-mk in mkfile

the maketab helper program was generated in parallel, which
had a dependency to y.tab.h which lead to yacc running
twice in parallel.

this removes the dependency to y.tab.h in the virtual
maketab.$objtype target to prevent this race condition.

the dependency to y.tab.h is resolved in the main mk at the
$cputype.maketab target which serializes with the other
targets.

4 years agousbehci: release ctlr ilock before calling pollcheck()
cinap_lenrek [Sun, 24 May 2020 00:43:21 +0000 (02:43 +0200)]
usbehci: release ctlr ilock before calling pollcheck()

4 years agomerge
cinap_lenrek [Sun, 24 May 2020 00:12:47 +0000 (02:12 +0200)]
merge

4 years agousbehci: avoid kproc() while holding poll lock
cinap_lenrek [Sun, 24 May 2020 00:11:37 +0000 (02:11 +0200)]
usbehci: avoid kproc() while holding poll lock

4 years agoman(9): remove accidentally commited indices
cinap_lenrek [Sat, 23 May 2020 22:26:11 +0000 (00:26 +0200)]
man(9): remove accidentally commited indices

4 years agomerge
cinap_lenrek [Sat, 23 May 2020 21:32:24 +0000 (23:32 +0200)]
merge

4 years agoip/tinc: accept udp connection from any udp source port
cinap_lenrek [Sat, 23 May 2020 21:31:11 +0000 (23:31 +0200)]
ip/tinc: accept udp connection from any udp source port

the remote host might be behind a NAT which translates the
source port, so if no host could be found, lookup the ip
address only.

4 years agopaint: change colors in the palette with button 3
Sigrid [Sat, 23 May 2020 18:41:20 +0000 (20:41 +0200)]
paint: change colors in the palette with button 3

4 years agolibaml: implement ToDecimalString and ToHexString operations
cinap_lenrek [Sat, 23 May 2020 15:44:30 +0000 (17:44 +0200)]
libaml: implement ToDecimalString and ToHexString operations

4 years agopc, pc64: do page attribute table (PAT) init early in cpuidentify()
cinap_lenrek [Fri, 22 May 2020 21:58:24 +0000 (23:58 +0200)]
pc, pc64: do page attribute table (PAT) init early in cpuidentify()

the page attribute table was initialized in mmuinit(), which is
too late for bootscreen(). So now we check for PAT support and
insert the write-combine entry early in cpuidentify().

this might have been the cause of some slow EFI framebuffers on
machines with overlapping or insufficient MTRR entries.

4 years agolibc/arm64: work arround linker bug for cas()
cinap_lenrek [Sun, 17 May 2020 21:46:09 +0000 (23:46 +0200)]
libc/arm64: work arround linker bug for cas()

at the _cas0 label, the linker would generate spurious stack
adjustment before the return:

atexitdont+0x84 0x000000000003614c CLREX $0xf
atexitdont+0x88 0x0000000000036150 MOVW R31,R0
atexitdont+0x8c 0x0000000000036154 MOV (SP)16!,R30 <- ????????????
atexitdont+0x90 0x0000000000036158 RETURN

the work arround is to move the code into its own cas0
text symbol.

this fixes impossible cwfs crashes in srvi().

4 years ago7l: handle dupok flag in TEXT/GLOBL data
cinap_lenrek [Sun, 17 May 2020 17:08:10 +0000 (19:08 +0200)]
7l: handle dupok flag in TEXT/GLOBL data

4 years agoAdd stdbool.h to ape
Ori Bernstein [Sun, 17 May 2020 15:18:49 +0000 (08:18 -0700)]
Add stdbool.h to ape

in accordance with c99:7.16. Used by perl, trivial enough
that I feel ok with adding it before the port is fully done.

4 years ago7l: fix mistake
cinap_lenrek [Sat, 16 May 2020 14:26:09 +0000 (16:26 +0200)]
7l: fix mistake

4 years ago#pragma ref no longer exists
Ori Bernstein [Fri, 15 May 2020 23:56:59 +0000 (16:56 -0700)]
#pragma ref no longer exists

It appears to be an antiquated form of 'USED(x)'

4 years agoFix scans of more than one character in %[]
Ori Bernstein [Fri, 15 May 2020 23:46:20 +0000 (16:46 -0700)]
Fix scans of more than one character in %[]

This got broken in d8e877a89dae, where we returned 0 on the
first mismatch; we want to return 0 only when we consumed no
characters.

4 years agostop fiddling with path construction.
Ori Bernstein [Thu, 14 May 2020 01:50:01 +0000 (18:50 -0700)]
stop fiddling with path construction.

There's fd2path, which gives back the full path directly.
This makes the code even simpler.

4 years agofix yacc crash with absolute paths
Ori Bernstein [Wed, 13 May 2020 15:42:00 +0000 (08:42 -0700)]
fix yacc crash with absolute paths

When passing an absolute file path to yacc, we would skip
initializing inpath, leaving it null. This would cause Bopen
to die. We would similarly fail to report an error if we tried
to get the current working directory, and then die when
constructing inpath.

This fixes both cases.

4 years agoape: fix name clash, have to use _SLEEP syscall instead of ape sleep in plan9 code...
cinap_lenrek [Tue, 12 May 2020 22:17:07 +0000 (00:17 +0200)]
ape: fix name clash, have to use _SLEEP syscall instead of ape sleep in plan9 code (thanks jamos)

this fixes etimer() from ape built libdraw as posix sleep() uses
seconds while plan9 uses miliseconds.

4 years agocc: dont export gethunk(), hunk, nhunk and thunk
cinap_lenrek [Tue, 12 May 2020 21:18:48 +0000 (23:18 +0200)]
cc: dont export gethunk(), hunk, nhunk and thunk

4 years agocc: get rid of hunk pointer fiddling and just use alloc()
cinap_lenrek [Tue, 12 May 2020 20:45:05 +0000 (22:45 +0200)]
cc: get rid of hunk pointer fiddling and just use alloc()

4 years ago?l: remove direct hunk manipulation from linkers, just call malloc()
cinap_lenrek [Tue, 12 May 2020 20:04:30 +0000 (22:04 +0200)]
?l: remove direct hunk manipulation from linkers, just call malloc()

as with recent changes, cc's malloc() could make the hunk pointer
misaligned. in the the compilers, the hunk pointer is used directly
by the lexer with no effort to to keep the hunk pointer aligned.

alloc/malloc still return aligned pointers, but hunk itself can
be on a odd address after allocation of a odd sized amount of bytes.

however, in the linkers, this assumption appears to be differnet. as
most allocations mostly allocate padded structures. however, symbol
lookup allocates strings on byte-size ganularity and the cc's malloc
would misalign the hunk pointer after the malloc() call. while the
rest of the code assumed hunk pointer was always aligned.

this change removes all the hunk pointer fiddling from the linker,
and we just call malloc() (which will use the fast implmenentation
of cc, and should not really make much of a performance difference).