Commit Graph

20136 Commits

Author SHA1 Message Date
reinoud b5bbc77284 Revert (REPE) CMPS support per request of Maxime, it is incorrect. 2020-10-31 15:44:01 +00:00
christos 2987e709e6 add missing sentence. 2020-10-31 14:35:28 +00:00
wiz 1848228ba3 Remove trailing whitespace. 2020-10-31 10:51:59 +00:00
christos ed75ee8266 PR/55663: Ruslan Nikolaev: Add support for EVFILT_USER in kqueue(2) 2020-10-31 01:08:31 +00:00
kre 84c54a935f PR lib/46542
Add checks to detect overflow, and also detect other invalid
(out of range) inputs for parsedate().

There could be more, and some of what is being added is not
perfect, but many calculation overflows will be detected now
(and cause an error return) and some of the most bizarre
inputs that were previously accepted no longer will be.
2020-10-30 22:03:11 +00:00
nia 2ea12967a0 ossaudio(3): Simplify setting rate (try to supply the nearest one possible) 2020-10-30 21:44:49 +00:00
reinoud cfe6ea549d Implement missing (REPE) CMPS instruction support in NVMMs x86_decode().
In apparently rare cases the (REPE) CMPS instruction can trigger an memory
assist. NVMM wouldn't recognize the instruction and thus couldn't assist and
Qemu would abort.
2020-10-30 21:06:13 +00:00
nia 0a229fd396 lib: Move sqlite, since it depends on libm 2020-10-29 20:11:17 +00:00
roy 07a43c5149 libossaudio: return newfd here as we return retval elsewhere 2020-10-24 14:43:53 +00:00
skrll c20fb706db Add _UC_GREGS_* defines for all general registers 2020-10-24 07:05:52 +00:00
skrll 134a7d48fd Provide _UC_REGS_* defines for all registers 2020-10-24 07:03:11 +00:00
skrll ecebc551e7 Update the unwinder comment to better reflect ARM64 2020-10-24 07:02:20 +00:00
skrll 3d84f9f79d s/ARM/ARM64/ in comment 2020-10-24 07:00:26 +00:00
wiz 80fb34196c Fix typo in comment. 2020-10-23 12:13:04 +00:00
nia 2cd43b36c6 ossaudio(3): Add an implementation of SNDCTL_CARDINFO
Correct some of the counts returned by SNDCTL_SYSINFO so this works.
2020-10-23 09:05:20 +00:00
nia 054aefec7a ossaudio(3): This is not compat_linux 2020-10-22 19:39:48 +00:00
thorpej a8ff863cd7 Fix typo (thanks kamil@ for pointing it out). 2020-10-21 01:58:30 +00:00
thorpej 521b46f7aa Add call frame unwind info to the Alpha signal trampoline. Using
kamil@'s test program:

Before:
Backtrace 2 stack frames.
0x120000a74 <handler+0x54> at ./test
0x3fffdca6550 <__sigtramp_siginfo_2> at /usr/lib/libc.so.12

After:
Backtrace 4 stack frames.
0x120000a74 <handler+0x54> at ./test
0x3fffdca6554 <__sigtramp_siginfo_2> at /usr/lib/libc.so.12
0x120000b10 <main+0x38> at ./test
0x1200009b4 <___start+0x1a4> at ./test
2020-10-21 01:55:07 +00:00
thorpej 48c5aec857 - Consistently use _REG_* defines from assym.h to mean register numbers,
not offsets (i.e. *8 to get the offset).
- Define and use SIZEOF_SIGINFO and UC_GREGS constants, rather than
  hard-code magic numbers.

NFC -- same object code is generated.
2020-10-21 01:24:04 +00:00
nia 41a2db1f31 ossaudio(3): Add SNDCTL_AUDIOINFO_EX as an alias of SNDCTL_AUDIOINFO 2020-10-20 08:57:45 +00:00
wiz 0e2cbe842f Remove trailing whitespace. 2020-10-20 07:52:04 +00:00
nia d1d954926b ossaudio(3): Plug a fd leak in the new mixer API 2020-10-20 06:53:37 +00:00
nia bbfc3fa4fd ossaudio.3: Bump date 2020-10-20 06:43:55 +00:00
nia 6abc2e7583 ossaudio(3): Turn BUGS section into a list of potential compat issues 2020-10-20 06:43:34 +00:00
nia 988ec12f1c ossaudio(3): Add some endian-specific U16 formats
for compatibility with FreeBSD
2020-10-20 06:33:52 +00:00
kamil c82c3566be Restore SP from mcontext
Improves unwinding of multiple frames without frame pointer.
2020-10-19 22:33:53 +00:00
kre dbbe561cbe Check the year field of a tentative ISO-8601 date format for overflow
before committing to it being an 8601 format date, rather than after
(or the fall back grammar parser doesn't start with a clean slate).

This isn't likely to ever bother anyone, the chances of encountering
something that looks just like an 8601 format date, but with a year
field so large it overflows a long are kind of slim.   If it did happen
the chances that the string could be correctly parsed (into something
different) by the grammar are even slimmer. But better to do it properly.
2020-10-19 17:47:45 +00:00
kre 0c44d33848 Catch the parsedate man page up with recent updates, ans also include
some general improvements I've had kicking around for a long time, but
never got around to committing.
2020-10-19 15:08:39 +00:00
kre 569a03414c For touch -d (which uses parsedate()) POSIX specifies that the
ISO-8601 format yyyy-mm-ddTHH:MM:SS[radix_and+frac][Z]
be accepted.

We didn't handle that, as in parsedate(), 'T' represents the
military timezone designator, not a padding separator between
date & time as POSIX specified it.

The way parsedate() is written, fixing this in the grammar/lexer
would be hard without deleting support for T as a zone indicator
(it is *my* timezone!).

So, instead of doing that, parse an ISO-8901 string which occurs
right at the start of the input (not even any preceding white space)
by hand, before invoking the grammar, and so not involving the lexer.
This is sufficient to make touch -d conform.

After doing that, we still need to allow earlier valid inputs,
where an ISO-8601 format (using space as the separator, but without
the 'Z' (Zulu, or UTC) suffix) followed by an arbitrary timezone
designation, and other modifiers (eg: "+5 minutes" work.  So we
call the grammar on whatever is left of the input after the 8601
string has been consumed.   This all "just works" with one exception,
a format like "yyyy-mm-dd hh:mm:ss +0700" would have the grammar parse
just "+0700" which by itself would be meaningless, and so wasn't
handled.    Add a grammar rule & processing to Handle it.

Also note that while POSIX specifies "at least 4" digits in the YYYY
field, we implement "at least one" so years from 0-999 continue to be
parsed as they always have (nb: these were, and continue to be, treated
as absolute year numbers, year 10 is year 10, not 2010).  Years > 2 billion
(give or take) cannot be represented in the tm_year field of a struct tm,
so there's a limit on the max number of digits as well.
2020-10-19 15:08:17 +00:00
kre 28d278e3ae POSIX requires that when converting 2 digit year representations to
actual specific years, values from 69-99 be treated as 20th century,
and values from 0-68 be treated as 21st century.  This allows for those
unfortunate enough to reside in a timezone west of Greenwich to convert
the epoch (or a time very close to it) to text, write that with just two
digits, and correctly convert it back to a time near the epoch, rather
than to something in 2069.

We used to split things so 0-69 were 21st century, and 70-99 were 20th.
Change that (this requires a change in the parsedate ATF tests which
test this specific boundary).

While here, add support for another POSIX requirement, that the radix
char before fractional seconds can be either a ',' or a '.'.  We used
to allow only '.', add support for ','.   This is something of a meaningless
change, as parsedate() returns a time_t in which there is no way to
represent fractional seconds, so there's little point in ever specifying
them regardless of what char is used for the "decimal point" - they will
be ignored anyway.    But at least fractional seconds using a ',' as the
radix char will no longer cause the conversion to fail (or do something else
bizarre).
2020-10-19 15:05:53 +00:00
kamil aeae5ce1c3 Restore ESP from mcontext
Improves unwinding of multiple frames without base pointer.
2020-10-19 11:31:01 +00:00
kamil 28928a88a3 Restore RSP from mcontext
Fixes unwinding of multiple frames without base pointer.

Patch by: Nikhil Benesch via PR lib/55719
2020-10-19 11:29:26 +00:00
nia 8bdeed361e ossaudio(3): add some no-op defines for ossv4 compat. 2020-10-19 10:28:47 +00:00
nia 028d2f4db2 ossaudio(3): these ioctls need to return samples, not bytes 2020-10-19 09:07:29 +00:00
nia 27ca241ed7 ossaudio(3): Add SNDCTL_DSP_CURRENT_(I|O)PTR
In OSSv4 these are supposed to avoid the wrapping problems with the
older GET(I|O)PTR ioctls but we don't quite get the same benefit here.

XXX: We could probably fake it by maintaining some state in-between calls.
2020-10-19 09:01:24 +00:00
nia 1f7ebca62c ossaudio(3): Add initial support for the OSSv4.1 Mixer API
One or two calls from this API were supported previously and have been
moved to the correct place.

Mapping the controls correctly is a difficult task. There is a define
hidden in the OSS headers that would allow an AUDIO_MIXER_SET control
to be represented perfectly, but it seems to _only_ exist there, and
no software supports it. So for now only one member of a set can be
set at a time - unfortunate. I've hidden code that should unlock
doing this the proper way under #notyet.

I'm not too happy with the way this code is managing file descriptors.
Currently it has to open a new fd for each ioctl due to OSSv4 deciding
to specify the device number in a structure rather than in the filename.
In the future, we could reuse the file descriptor if the correct one is
detected open.

This allows the mixer programs provided with the OSSv4 sources to compile
and work cleanly. I've observed problems with it failing to work on
secondary devices, and should investigate this later. There may be
a fd leak somewhere.
2020-10-17 23:23:06 +00:00
christos d6635c5ec1 update to 2020c 2020-10-17 16:24:33 +00:00
skrll 1a739c1b22 Change x30 to lr for ease of reading
NFCI
2020-10-17 15:44:59 +00:00
wiz e3d011e985 Use Fx and Nx. End Rs block. Remove trailing whitespace.
Remove unnecessary Pp.
2020-10-17 09:04:59 +00:00
nia b32d7310bd ossaudio.3: note this is most/all of ossv3 and some of ossv4 2020-10-16 20:51:54 +00:00
nia d53a6cbc32 ossaudio(3): Add SNDCTL_DSP_COOKEDMODE, SNDCTL_DSP_GETERROR
SNDCTL_DSP_COOKEDMODE simply always returns 1.
"Cooked mode" is a silly way the OSSv4 authors chose to refer to allowing
for reprocessed streams. The NetBSD kernel always performs format
conversion and it can't be turned off.

SNDCTL_DSP_GETERROR provides access to the read/write over/underrun
counters. There are other things it might return, but they don't make
sense for our implementation.
2020-10-16 20:24:35 +00:00
nia ad3ea96832 ossaudio.3: Sort sections. 2020-10-16 16:48:07 +00:00
nia 381a0b036e ossaudio.3: More information about the history and status of this API 2020-10-16 16:30:53 +00:00
nia 9613c80501 ossaudio: Bump copyright date and improve description. 2020-10-16 15:40:16 +00:00
nia d9a5cdad2e ossaudio: Add comments for the more obscure parts of SNDCTL_AUDIOINFO 2020-10-16 12:36:01 +00:00
nia 2874e967ea ossaudio: Various OSSv4 fixes for SNDCTL_AUDIOINFO
- Per OSSv4, make this ioctl work on the main mixer device.
  Since the native NetBSD API uses queries on individual audio devices,
  we have to reopen the correct audio device specified in the input to the
  ioctl and fetch information from that.
- Correctly return whether the device is for playback, capture, or both.
- Return the full name of the device in the name field.
- The "handle" has to be a globally unique identifier. The closest thing
  we have to that is device numbers, so use device numbers.
- Return reasonable values in min_rate/max_rate and min_channels/max_channels.

This should allow Mumble's device enumeration to work with a lot less
patching.
2020-10-16 12:23:34 +00:00
skrll e63a73d85d Trailing whitespace 2020-10-15 05:50:14 +00:00
skrll 33778f9e87 Remove '_OFFSETOF' prefix for genassm(1) generate CPP identifers for
consistency with other arches.

NFCI and libc.so is the same before and after.
2020-10-15 05:43:38 +00:00
skrll 252fbae288 Remove '_OFFSETOF' prefix for genassm(1) generate CPP identifers for
consistency with other arches.

NFCI and libc.so is the same before and after.
2020-10-15 05:27:53 +00:00
skrll 90309fbee9 Trailing whitespace 2020-10-15 05:10:30 +00:00