Commit graph

7968 commits

Author SHA1 Message Date
stanley lieber
556609be56 /lib/rob, /lib/rsc, /lib/theo: So it sounds like everyone is in favor of the entire generics proposal and all the semantics, and all we have left to hammer out is the bracket characters? Do I have that right? 2020-09-14 23:10:16 -04:00
cinap_lenrek
d3ebd02bef merge 2020-09-13 20:34:30 +02:00
cinap_lenrek
4f85115526 kernel: massive pci code rewrite
The new pci code is moved to port/pci.[hc] and shared by
all ports.

Each port has its own PCI controller implementation,
providing the pcicfgrw*() functions for low level pci
config space access. The locking for pcicfgrw*() is now
done by the caller (only port/pci.c).

Device drivers now need to include "../port/pci.h" in
addition to "io.h".

The new code now checks bridge windows and membars,
while enumerating the bus, giving the pc driver a chance
to re-assign them. This is needed because some UEFI
implementations fail to assign the bars for some devices,
so we need to do it outselfs. (See pcireservemem()).

While working on this, it was discovered that the pci
code assimed the smallest I/O bar size is 16 (pcibarsize()),
which is wrong. I/O bars can be as small as 4 bytes.
Bit 1 in an I/O bar is also reserved and should be masked off,
making the port mask: port = bar & ~3;
2020-09-13 20:33:17 +02:00
Ori Bernstein
3873eb06d9 games/4s: increase thread size (thanks majiru)
It seems like on amd64, we're overflowing the stack.
Let's not do that.
2020-09-13 11:21:21 -07:00
Ori Bernstein
d7b541eaf3 faces: remove log support
Use a damn plumber, you animals!
2020-09-12 17:40:41 -07:00
Ori Bernstein
26cf6ec073 tmdate(1): document tz field 2020-09-12 17:36:14 -07:00
Ori Bernstein
732082c095 ctime(2), tmdate(2): document ctime/tmparse incompatibility
Tmparse and ctime don't mix. The timezone name may be
too long for the number of characters ctime mandates.
Document this footgun.
2020-09-10 16:26:42 -07:00
Ori Bernstein
703b0d3e6d tmdate(2): one more typo
no more top arse. only bottom arse.
2020-09-07 19:32:50 -07:00
Ori Bernstein
ce5b6036f0 tmdate(2): fix examples, stale references (thanks deuteron)
There were a number of ideas that were tried out as the tmdate
api evolved. As a result, there were some references in the
manpage to things that are no more.

Fix them.
2020-09-07 19:28:30 -07:00
Ori Bernstein
4a1186ddfe tmdate(2): fix name of tm struct
There was a leftover from when this library was separate
with different types.
2020-09-07 18:49:00 -07:00
cinap_lenrek
693485e9c4 etheriwl: add support for Intel Wireless AC 8265 2020-09-06 16:53:39 +02:00
cinap_lenrek
a87b6909bc wifi: add packet timestamping support 2020-09-06 16:51:02 +02:00
Ori Bernstein
cf5316a402 walk(1): improve wording, formatting
Clean up the wording of the walk(1) manpage,
improve the formatting of the format characters.
2020-09-03 20:07:44 -07:00
Ori Bernstein
f444d6c3f2 tmparse: put in local timezone hack
Ctime is defined as printing a 3-character timezone
name. The timezone name is ambiguous. For example,
EST refers to both Australian and American eastern
time. On top of that, we don't want to make the
tzabbrev table exhaustive. So, we put in this hack:

Before we consult the well known table of timezones,
we check if the local time matches the timezone name.

On top of that, tm2sec

If you want unambiguous timezone parsing, use numeric
timezone offsets (Z, ZZ formats).
2020-09-01 19:32:45 -07:00
Ori Bernstein
e0278f6917 seconds: tolerate trailing whitespace in dates
This allows handling dates with leading and trailing whitespace,
including newlines.
2020-09-01 19:03:17 -07:00
cinap_lenrek
e9cd41467e upas: appendfolder() don't be picky about the timezone of ctime()
This is temporary fix, we should try to emulate the previous
behaviour where we accept at least our local timezone, and
otherwise ignore the offset.
2020-09-01 23:08:58 +02:00
cinap_lenrek
20d8cd0d63 upas: appendfolder(): skip the address from unix header before date 2020-09-01 23:01:45 +02:00
cinap_lenrek
feda48624b upas/fs: extract proper date from unix header
do not try to parse the m->unixfrom field, it only contains
the unix mail address.

instead, have parseunix() save a pointer into the unixheader
after the unix mail address for the unixdate, and later use
it to derive the mails timestamp.
2020-09-01 21:39:45 +02:00
Alex Musolino
79b4ec29a1 upas/fs: remove unused function date822tounix 2020-09-01 22:25:06 +09:30
Alex Musolino
e6bfbd0d33 png: remove bogus chanlen warning 2020-09-01 21:54:10 +09:30
Ori Bernstein
ec533a1ad8 ape/ctype.h: add isblank, fix functions (thanks staalmannen)
Our ctype.h mistakenly ommitted isblank. Add it in.

While we're here, the make the 'isfoo()' functions
are broken: they're offsetting into the array, and
don't work with negative character values.

Sync the function bodies with the macros, and make
them produce correct results.
2020-08-29 11:09:20 -07:00
Alex Musolino
74bf624055 walk(1): fix typo 2020-08-29 18:23:59 +09:30
Ori Bernstein
b7b077375f faces(1): remove bespoke date parser
In addition to being more code, this date parser would
treat local times as local, but anything that wasn't a
local time would get parsed as gmt, due to a quirk of
how tm2sec used to work.

This moves the code to tmparse, and fixes timezone parsing
at the same time.
2020-08-27 10:32:02 -07:00
Ori Bernstein
26ac80481d walk(1): clarify how -n argument works (thanks umbraticus)
Make it clear what happens if you omit the ',' when
specifying '-n'.
2020-08-26 21:17:17 -07:00
Ori Bernstein
68aa4d5254 tmparse: fix typo 2020-08-26 12:12:44 -07:00
Ori Bernstein
17abfa51ca libc: tmparse should ignore leading whitespace
We almost always want to skip leading whitespace in time
formats, so make tmparse just do it. This fixes upas mbox
parsing, which leaves a leading whitespace at the start of
the date.
2020-08-26 10:23:00 -07:00
Alex Musolino
8727bfd9bd getwd(2): add reference to chdir(2) in SEE ALSO section 2020-08-25 20:51:38 +09:30
Alex Musolino
6fe18e7c7b chdir(2): add reference to getwd(2) in SEE ALSO section 2020-08-25 20:51:24 +09:30
Ori Bernstein
b1a13414cd tm2sec: clear new fields in tm
Old users of the time APIs would hand-craft
time structs without first zeroing all the
members. When this got into tmnorm(), we
would try to access the new members, and
things would go off the rails.

This makes tm2sec() clear the new fields
before passing them to the new APIs, so
that the hand-crafted structs remain
valid.
2020-08-24 14:47:10 -07:00
Sigrid
0505f8fb3a nusb/lib: use fmtprint for the entire dump to be printed out 2020-08-23 12:14:32 +02:00
cinap_lenrek
603d9812a7 kernel: fix Abind cyclic reference and mounthead leaks (thanks Alex Musolino)
The Abind case in namec() needs to cunique() the chan
before attaching the umh mount head pointer onto it.

This is because we cannot give a reference to the mount
head to any of the mh->mount...->to channels, as they
will never go away until the mount head goes away.
This is a cyclic reference.

This could be reproduced with:

	@{rfork n; mount -a '#s/boot' /mnt/root; bind /mnt/root /}

Also, fix memory leaks around cunique(), which can
error, leaking the mount head we got from domount().

Move the umh != nil check inside cunique().
2020-08-23 05:07:30 +02:00
Alex Musolino
951a71012f torrent(1): update url in examples section 2020-08-21 10:06:22 +09:30
Ori Bernstein
8edfa693cb ip(3): fix typo in manpage (thanks jstsmthrgk) 2020-08-20 13:25:37 -07:00
Sigrid
b6fde0c7b9 libaml: fix fault when the second operand of comparison cannot be converted 2020-08-20 08:28:24 +02:00
Sigrid
de34481f8b oggdec: give it enough chance to seek from the start, where first seek might be still too close to the beginning of the file 2020-08-18 16:45:00 +02:00
Sigrid
5405ee61ae audio/oggdec: allow -s 0 2020-08-12 22:26:06 +02:00
Sigrid
601dd12651 audio/mp3dec: mad timer duration is all wrong, use samples instead 2020-08-12 11:42:00 +02:00
Sigrid
81dba13271 audio/mp3dec: add -s SECONDS option 2020-08-12 10:43:46 +02:00
Sigrid
5fcf2040b4 audio(1): add new -s SECONDS option 2020-08-11 17:27:11 +02:00
Sigrid
4ba367d435 audio/oggdec: add -s SECONDS option to seek before decoding 2020-08-11 17:26:33 +02:00
Sigrid
2e6f158f4d audio/flacdec: add -s SECONDS option to seek before decoding 2020-08-11 17:25:53 +02:00
Ori Bernstein
69c3c0e6f0 tmdate(2): fix typo (thanks mveety)
sysfata => sysfatal
2020-08-10 20:33:39 -07:00
Ori Bernstein
46faca54ed stdio.h: correct return type of putc
The putc macro is specified as returning an int, but our
type conversion rules turned it into a uint. Put in the
appropriate cast to make the type what we want.
2020-08-10 19:36:09 -07:00
Ori Bernstein
1e315f896d aux/ms2, aux/na: fix warnings
aux/na was comparing the return of putc with <0, when it should
have been comparing against EOF, which is not specified as -ve.

aux/ms2 was zero-extending the mask for the address when it
should have been sign extended.
2020-08-10 19:35:05 -07:00
Ori Bernstein
c834f535b7 seconds: use new libc date api 2020-08-10 19:02:09 -07:00
Ori Bernstein
6d3a2e6531 date: use new libc date apis. 2020-08-10 19:01:45 -07:00
Ori Bernstein
9db78003db merge 2020-08-10 19:00:59 -07:00
Sigrid
6e039d7b49 vmx: does not do well with certain fb widths, so restrict it 2020-08-10 16:38:26 +02:00
Ori Bernstein
e702cfcafd upas/fs: port date parsing to libc apis
There was a lot of code in upas/fs to deal with dates.
Now there isn't.
2020-08-09 19:46:38 -07:00
Ori Bernstein
9d446410c5 ip/httpd: fix 'mk nuke' 2020-08-09 19:00:06 -07:00