Commit Graph

262938 Commits

Author SHA1 Message Date
jmcneill 26bbc56f09 build fdt_memory.c 2018-10-30 22:32:33 +00:00
jmcneill d377d504e4 Replace extent(9) with our own code to deal with adding and reserving
memory ranges.
2018-10-30 21:32:35 +00:00
kre 3e9d705017 sysctl(KERN_BOOTTIME) is a struct timespec, not struct timeval
and has eben since 2009.    Adapt.

NFCI - while the tv_usec (now tv_nsec) field is used, we will
keep its uses to microsecond precision to avoid any compat issues.
2018-10-30 21:18:39 +00:00
kre d4305dc776 sysctl(KERN_BOPOTIME) started returning a struct timespec in 2009.
Update to match....    We're slow but we get there eventually!

NFC for any of these programs, struct timeval and struct timespec
are the same size, and only the tv_sec field of boottime is used,
and that's unchanged.
2018-10-30 21:15:09 +00:00
christos 7fe1831b09 no param names in prototype. 2018-10-30 20:23:29 +00:00
christos 91e3572e8f bump for clang 2018-10-30 20:18:30 +00:00
christos 57ce79706b provide a main prototype (this is standalone) 2018-10-30 20:15:57 +00:00
kre 7c12c3f28f Minor update. This already knew that boottime is a timespec.
Just a minor wording change to avoid pretending that time_t
variables contain nanoseconds, and that the base time is UTC.
2018-10-30 20:10:23 +00:00
kre c576beb79a kern.boottime was changed from a struct timeval to a struct timespec
in January 2009 (the Christos' time merge, when time_t went to 64 bits).

sysctl needs to catch up.   (So do other progs, which will happen, eventually,
but most of them are unaffected in any practical way.)

If you are running a system (NetBSD 6 or later) without this change, try
	sysctl -nn kern.boottime
and marvel at the result (in theory, seconds.microseconds) most
probably being something like:
	jinx$ sysctl -nn kern.boottime
	1540801874.999995564
(There is a 1 in 1000 chance your system will have booted
in the interval [0 , 999999] nanoseconds after some second,
in which case this will not be observed.   You should get
(almost) the same value after this change - just now it is as
it should be (there should now always be 9 digits after the '.').

On the other hand, if you're on a big-endian 64 bit host (running
64 bit sysctl) you would have always seen 0 for the microseconds field.
That should be fixed by this.

In sysctl(7) also document what we mean by "the time the system booted".

XXX Pullup -8
XXX Pullup -7
XXX Pullup -6 (oops, missed that one...)
2018-10-30 19:41:21 +00:00
kre 7008793d77 Correct the 6 second offset issue between the time reported by
dmesg -T and the actual time a message was produced, noted on
current-users by Geoff Wing (Oct 27, 2018).

The size of the offset would depend upon architecture, and processor,
but was the delay from starting the clocks to initialising the time
of day (after mounting root, in case that is needed).

Change the kernel to set boottime to be the time at which the
clocks were started, rather than the time at which it is init'd
(by subtracting the interval between).

Correct dmesg to properly compute the ToD based upon the
boottime (which is a timespec, not a timeval, and has been
since Jan 2009) and the time logged in the message.

Note that this can (rarely) be 1 second earlier than date reports.
This occurs  when the time when the message was logged was actually
in the next second, but the timecounters have not yet processed
the tick, and so the time of the last tick, near the end of the
previous second, is reported instead.   Since times are always
truncated, rather than rounded, it is occasionally possible to
observe that disparity (if you try hard enough).

IOW: sys/kern/subr_prf.c:addtstamp() uses getnanouptime() rather
than nanouptime().

Note in dmesg(8) that -T conversions are gibberish other than
when the message comes from current the running kernel.  (It
could be fixed when -M is used, for messages generated by the
kernel whose corpse is being observed.   But hasn't been...)
2018-10-30 19:40:35 +00:00
skrll d903176946 Retire fdt_putchar and ap_early_put_char in favour of uartputc. 2018-10-30 16:41:51 +00:00
riastradh 1c1a78241c Paranoia: zero COMPAT_30 ntptimeval and 32-bit ntptimeval too.
These structs don't have padding but safer to keep the code
structured the same way between the various ntp_gettimes in case
anyone makes more copypasta of it for future updates.
2018-10-30 14:43:38 +00:00
riastradh cc8a85962e Zero ntptimeval50 too to prevent 4-byte kernel stack disclosure.
From Thomas Barabosch of Fraunhofer FKIE.

XXX pullup-7, pullup-8 (along with rev. 1.60 of kern_ntptime.c)
2018-10-30 14:35:16 +00:00
jmcneill d442e9f083 Disable diagnostic assertions around timer jitter on Allwinner A64. It
seems the instability of CNTVCT can cause issues with the compare value,
and rather than applying a heavy workaround just skip the panics.
2018-10-30 10:38:11 +00:00
martin 15ea57e01c When BOARDTYPE is not set, use MACHINE_ARCH for the image name. 2018-10-30 09:06:07 +00:00
skrll ee648c4e05 Allow setend be decode 2018-10-30 09:05:51 +00:00
skrll 106bb42a11 Don't forget EXTRA_LINKFLAGS+= --be8 for BE kernels 2018-10-30 08:59:09 +00:00
skrll 2743beddbb Merge SUNXI completely into GENERIC 2018-10-30 07:51:09 +00:00
skrll a59fe308df Merge EXYNOS into GENERIC completely. GENERIC nows boots on ODROID-XU4 2018-10-30 06:55:07 +00:00
ozaki-r cb8a413a5e Use rt_update framework on updating a rtentry 2018-10-30 05:56:02 +00:00
ozaki-r 973496ef18 Avoid double rt_replace_ifa on rtrequest1(RTM_ADD)
Some callers of rtrequest1(RTM_ADD) adjust rt_ifa of an rtentry created by
rtrequest1 that may change rt_ifa (in ifa_rtrequest) with another ifa that is
different from requested one.  It's wasteful and even worse introduces a race
condition.  rtrequest1 should just use a passed ifa as is if a caller hopes so.
2018-10-30 05:54:41 +00:00
ozaki-r 954d82d49e Avoid a dangling pointer during rt_replace_ifa 2018-10-30 05:30:31 +00:00
ozaki-r 334ceb81c9 Use atomic operations for ifa_refcnt 2018-10-30 05:29:21 +00:00
ozaki-r 9b83640c45 Remove a wrong assertion in ifaref
Doing ifref on an ifa with IFA_DESTROYING is not a problem; the reference should
be dropped during the destruction of the ifa.
2018-10-30 05:27:51 +00:00
christos d6cba4abc7 Zero out the ntptimeval structure to prevent a 4 byte kernel stack disclosure.
Reported by Thomas Barabosch.
2018-10-29 22:02:25 +00:00
wiz c23b16b56b Add comma in enumeration. 2018-10-29 21:06:13 +00:00
jmcneill 932d2dbd41 If a /chosen/framebuffer node is found, reserve physical memory claimed
by it.
2018-10-29 21:05:58 +00:00
wiz bd01c08b37 Remove unnecessary Pp before Bl/Bd. 2018-10-29 21:04:18 +00:00
wiz cd3f51adac New sentence, new line 2018-10-29 21:02:15 +00:00
maya d3aa915675 Make VM_MIN_KERNEL_ADDRESS and others available in the _KMEMUSER case
as well. This affects ddb. Tested by htodd.
2018-10-29 19:43:16 +00:00
christos 28e6c3de1b Back to using _NPF_TESTING now that it does not change the semantics of
the calls, but only adds extra functionality.
2018-10-29 15:37:45 +00:00
christos 2a18a80d51 We need to have rump tests work in two modes:
1. npf unit tests. In this case only the npf subsystem is created
   and dictionaries are passed directly.
2. kernel system tests (like the ipsec natt test). In this case, npf is
   instantiated regularly as part of the kernel and dictionaries are
   passed via ioctl.

We differentiate between the two cases by checking the "mbufops" member
which is NULL, regularly and non-NULL in the npf unit tests. Previously
this was done using an ifdef which obviously can't work for both cases.
2018-10-29 15:37:06 +00:00
martin 5cc5ab64b4 If no BOARDTYPE is defined, avoid the space to separate it from the OS
release.
2018-10-29 13:53:23 +00:00
martin cd54eb5ef0 VAX does not fully populate the register move costs table, so do not
access it w/o checks.
Hack to work around PR toolchain/53176.
2018-10-29 10:22:56 +00:00
mrg 30b672631b avoid sign/unsigned issue and for NUMNAMES to an integer when it is
compared against a value that may be -1.

fixes autoboot when boot-file is set.  (serves me right for removing
code that looked odd when it was tested :-)
2018-10-29 05:15:21 +00:00
uwe 4c629b7589 Fix indentation. 2018-10-29 01:27:39 +00:00
uwe 29dacce45c waddch - instead of enclosing every statement in #ifdef HAVE_WCHAR
just provide two separate definitions.

Same object code is generated for all four combinations of debug/wchar.
2018-10-29 01:19:54 +00:00
uwe 9635311de9 Fix operator precedence for !HAVE_WCHAR 2018-10-29 01:02:16 +00:00
uwe 8c2d3cb78d __CTRACE - don't call gettimeofday() twice. 2018-10-29 00:31:57 +00:00
uwe d05568e5ff Make __CTRACE_init() static and ANSIfy its definition. 2018-10-29 00:25:20 +00:00
christos 3e167e7237 fix typo. 2018-10-29 00:14:37 +00:00
mrg 693d228f2b use xhci_polling_p(). this might miss when bus2 is active.
XXX: pullup-7, pullup-8.
2018-10-28 21:36:34 +00:00
aymeric 77f3631c2c Enable the global timer at attach time, it ensures that delay() works. 2018-10-28 21:08:13 +00:00
kre 33a05de6b0 Switch from using two printsignals() functions, one in trap.c
and one in (the included from bin/kill) kill.c and use just
the one in kill.c (which is amended slightly so it can work
the way that trap.c needs it to work).    This one is chosen as
it was a much nicer implementation, and because while kill is
always built into the shell, kill also exists without the shell.

Leave the old implementation #if 0'd in trap.c (but updated to
match the calling convention of the one in kill.c) - for now.

Delete references of sys_signame[] from sh/trap.c and along with
that several uses of NSIG (unfortunately, there are still more)
and replace them with the newer libc functional interfaces.
2018-10-28 18:26:52 +00:00
kre 185226c2be Use strsignal() rather than direct reference to sys_siglist[]
(apart from being cleaner, it also simplifies the code, as
strsignal() never fails ... it also removes one reference to NSIG).
2018-10-28 18:16:01 +00:00
kre 7800af09a4 Change the (commented out) setting of -DDEBUG to the form that
is most likely to be useful if someone other than me wants to
build a DEBUG shell.   NFC (it is a comment in a Makefile!)
2018-10-28 18:13:47 +00:00
aymeric e63eecd71b Deactivate the watchdog timer during attach.
Recent u-boot starts up the watchdog timer, and we don't detect this so
e.g. my DE0 nanosoc reboots after about 20 seconds. Applying a reset to
the watchdog circuit is the only way to stop it according to the
documentation.
2018-10-28 15:06:10 +00:00
aymeric b0bf3847e8 Define __HAVE_GENERIC_START now that it works; former startup files were
removed anyway...
2018-10-28 15:00:19 +00:00
skrll 9875238034 Fix the comment near pmap_bootstrap itself as well 2018-10-28 14:59:17 +00:00
aymeric 37deb03f7c Use virtual addresses where virtual addresses are expected. 2018-10-28 14:58:20 +00:00