Commit Graph

272969 Commits

Author SHA1 Message Date
skrll
ac86769291 KNF 2020-01-02 16:52:55 +00:00
skrll
3e149c20a6 Trailing whitespace 2020-01-02 16:51:54 +00:00
thorpej
7fc242e39a - No need to use I2C_F_POLL here.
- Properly propagate errors up the stack.
2020-01-02 16:48:05 +00:00
thorpej
4a018c1296 No need to use I2C_F_POLL here. 2020-01-02 16:24:51 +00:00
thorpej
c22653c723 Also force I2C_F_POLL if shutting_down. 2020-01-02 16:18:37 +00:00
thorpej
00e0ec55cf Welcome to NetBSD 9.99.33 -- boottime global is gone. 2020-01-02 15:43:11 +00:00
thorpej
d6c967bb85 - Eliminate the global "boottime" variable, which was being accessed
without any synchronization against changes by e.g. clock_settime().
- Replace with new getbinboottime() / getnanoboottime() / getmicroboottime()
  functions (naming mirrors that of other time access functions in kern_tc.c).
  It returns the (maybe-converted) value of timebasebin, which also tracks
  our estimate of when the system was booted (i.e. the legacy "boottime" was
  redundant).

XXX There needs to be a lockless synchronization mechanism for reading
timebasebin, but this is a problem in kern_tc.c that pre-existed these
"boottime" changes.  At least now the problem is centralized in one location.
2020-01-02 15:42:26 +00:00
skrll
2a8787267f gcc 8 needs -mapcs-frame when DDB is specified for backtrace to work 2020-01-02 14:33:55 +00:00
tkusumi
143e65cce8 fstyp: Fix "exfat: iconv_open UCS-2LE: Invalid argument" failure
Fix below error for the time being.
The removed code is only relevant to Capsicum.

$ fstyp -l /dev/wd1
fstyp: exfat: iconv_open UCS-2LE: Invalid argument
2020-01-02 08:52:42 +00:00
martin
38e2db7699 Add shutting_down variable for rump. 2020-01-02 08:49:10 +00:00
maxv
56fc3d1e80 Remove the call to KERNEL_UNLOCK_ONE(), it was forgotten when the biglock
was dropped in rev1.63. Found via vHCI.
2020-01-02 08:08:30 +00:00
tkusumi
8dab45b63f dm: Add dm-flakey target
Ported from DragonFlyBSD, but this target had originally existed in
Linux kernel. See below for details.
https://www.kernel.org/doc/Documentation/device-mapper/dm-flakey.txt

Due to two technical issues, this hasn't been hooked to dm.kmod yet.
1) "tick" in hz(9) not working.
2) Unable to use ->b_private in nestiobuf callback when it's already
 used for mbp (see HAS_BUF_PRIV2).

taken-from: DragonFlyBSD
2020-01-02 06:22:23 +00:00
kamil
06758b70da Sync the e_ident[EI_OSABI] magic values with the ELF specification
source: http://www.sco.com/developers/gabi/latest/ch4.eheader.html
2020-01-02 05:18:07 +00:00
kamil
398ca04bbe Update e_machine magic values with the ELF specification
source: http://www.sco.com/developers/gabi/latest/ch4.eheader.html
2020-01-02 04:58:07 +00:00
kamil
3e924d6f25 Fix the EM_TILEGX number in the ELF header
source: http://www.sco.com/developers/gabi/latest/ch4.eheader.html

191 is confirmed in LLVM, GNU toolchain, FreeBSD.
2020-01-02 04:28:51 +00:00
ad
e573adfef5 Back out the amap allocation changes from earlier today - have seen a panic
with them.  Retain the lock changes.
2020-01-02 02:00:35 +00:00
ad
869ac77939 mi_cpu_init: set ci_smt_primary early. 2020-01-02 01:31:17 +00:00
jmcneill
ec17524941 Add driver for simple-audio-amplifier binding 2020-01-02 00:57:09 +00:00
mlelstv
6ee7d63e9e Add support for single power writes, and enable for Ricoh 5u823. 2020-01-01 23:28:31 +00:00
thorpej
9d1f55b2e2 Now that we know if we're shutting down, enable locking in resettodr().
In the shutting_down case, we acquire the todr_mutex as a trylock.  Under
most circumstances, this lock will be uncontended.  But if we happen to
panic while accessing the TOD clock (via clock_settime() or whatever),
then trylock will prevent us from getting stuck (and a warning will be
displayed on the console).
2020-01-01 23:15:24 +00:00
thorpej
273224623b Pull in <sys/stdbool.h>. 2020-01-01 23:07:38 +00:00
thorpej
599c240526 - Introduce a new global kernel variable "shutting_down" to indicate that
the system is shutting down or rebooting.
- Set this global in a new function called kern_reboot(), which is currently
  just a basic wrapper around cpu_reboot().
- Call kern_reboot() instead of cpu_reboot() almost everywhere; a few
  places remain where it's still called directly, but those are in early
  pre-main() machdep locations.

Eventually, all of the various cpu_reboot() functions should be re-factored
and common functionality moved to kern_reboot(), but that's for another day.
2020-01-01 22:57:16 +00:00
ad
37e07d7a55 - Start trying to reduce the high cache miss rate observed around vm_amap.
On _LP64, pad struct vm_amap to 128 bytes and use the additional space to
  hold the arrays for tiny amaps which are common.  Carefully size the array
  allocations to avoid false sharing, and for smaller amaps try to share
  allocated cache lines.

- Eliminate most contention due to amap_list: maintain the list in the pool
  cache constructor / destructor like we do for struct file.  Cache the
  mutexes we allocate here.

- Don't do PR_WAITOK mutex allocations when NOWAIT has been specified.
2020-01-01 22:01:13 +00:00
ad
8ce608c956 Add some new functions for lock objects:
mutex_obj_refcnt(), mutex_obj_tryalloc()
rw_obj_refcnt(), rw_obj_tryalloc()
2020-01-01 21:34:39 +00:00
thorpej
a1e56ffa5f First steps towards properly serializing access to the TOD clock.
- Add a mutex around the TODR, and provide lock/unlock/lock-owned
  functions to manipulate it.
- Rename inittodr() to todr_set_systime() and resettodr() to
  todr_save_systime() to better reflect what they do.  These functions
  are intended to be called with the TODR lock held, which will allow
  for a pattern like:
	-> todr_lock()
	-> todr_save_systime()
	-> [do machine-dependent stuff to sleep/suspend]
	-> [magically awaken]
	-> todr_set_systime(...)
	-> todr_unlock()
- Provide historically-named wrappers inittodr() and resettodr() that
  do the dance of acquiring / releasing the lock around the actual
  substance.

NOTE: resettodr()'s use of the TODR lock is currently disabled (and
todr_save_systime() does not assert it's held) until such time as
issues around shutdown / reboot under duress can be addressed.
2020-01-01 21:09:11 +00:00
wiz
d21e55a432 Break line after macro ends; add article 2020-01-01 20:13:19 +00:00
wiz
627a9b5419 Try fixing a sentence. 2020-01-01 20:11:44 +00:00
pgoyette
458c343b5c One more vestige. 2020-01-01 19:36:27 +00:00
pgoyette
6865a3028c Emove vestigial remains of the monolithic compat module. 2020-01-01 19:35:21 +00:00
thorpej
7e14229cb0 Fix some issues around todr_wenable():
- As previously defined, it was not possible to return an error from the
  back-end RTC driver.  Make it a real function so that it can do so.
- Only the mc146818 and mk48txx drivers used it (for historical reasons).
  Centralize the logic for how it's used in kern_todr.c (and make it private
  to that file) for consistency.
2020-01-01 19:24:03 +00:00
wiz
2f0ecae22a tmux-3.0a out. 2020-01-01 18:40:12 +00:00
thorpej
3144c91f33 No need to use I2C_F_POLL here. 2020-01-01 18:09:44 +00:00
thorpej
c5d2bbb7ef todr_gettime() and todr_settime() are not referenced outside of kern_todr.c,
so make them private to that file.
2020-01-01 18:08:11 +00:00
thorpej
5474e7a92a Remove superfluous splclock()/splx() pair around tc_setclock(). 2020-01-01 17:28:17 +00:00
martin
3027f95766 Revert previous (include of sys/param.h) - the headers requiring this
have been fixed.
2020-01-01 16:50:41 +00:00
maxv
8822fe6d97 Fix three stack info leaks, found by kMSan when just invoking all syscalls
with a zero page as argument.

MSan: Uninitialized Stack Memory In copyout() At Offset 0, Variable 'sb32' From compat_20_netbsd32_getfsstat()
MSan: Uninitialized Stack Memory In copyout() At Offset 12, Variable 'oss' From compat_43_sys_sigstack()
MSan: Uninitialized Stack Memory In copyout() At Offset 0, Variable 'sb' From compat_50_netbsd32___fhstat40()
2020-01-01 14:52:38 +00:00
ad
8764f42700 Fix a comment. 2020-01-01 14:33:48 +00:00
skrll
b1843f788e upstream_kernel=1 is required with new firmware/kernel. 2020-01-01 14:16:51 +00:00
jmcneill
8f3a886a8e Disable SPI for now (rkspi driver hangs at boot) 2020-01-01 14:15:46 +00:00
skrll
60b724fd8c Provide a single generic bcm283x_platform_uart_freq which checks for
"brcm,bcm2835-aux-uart" and returns the appropriate core clock based
results; otherwise it returns the uart clock from firmware.

Should fix early console output on the rpi0w.

Based on a diff from mlelstv
2020-01-01 13:54:32 +00:00
ad
010110684b PR kern/54821: 9.99.32 assertion in uvm_pageactivate
Looks like I forgot to commit this file yesterday.
2020-01-01 13:11:51 +00:00
jmcneill
d45d7be8b2 No need to print all supported levels at attach, print the range and total number of steps 2020-01-01 12:55:03 +00:00
tkusumi
0f41a17b1c fstyp: Consider '@' syntax in device file path for HAMMER2
though devpath is unsupported in NetBSD atm.
taken-from: DragonFlyBSD
2020-01-01 12:47:19 +00:00
jmcneill
3f26cba0bd Quiet chatty printfs 2020-01-01 12:46:44 +00:00
jmcneill
e734e7f113 Fix performance regression with previous 2020-01-01 12:18:18 +00:00
jmcneill
90d0c6959c Use correct firmware for BCM43456 2020-01-01 12:17:13 +00:00
jmcneill
abec60a52f regen 2020-01-01 12:16:14 +00:00
jmcneill
e7fc21828c Add product ID for Broadcom BCM43455 2020-01-01 12:15:53 +00:00
martin
c309bf7aef Avoid mixing signed/unsigned arguments to the ? operator. 2020-01-01 11:48:36 +00:00
tkusumi
cfa93e9fb4 fstyp: Fix build failure on i386
http://releng.netbsd.org/b5reports/i386/commits-2020.01.html#2020.01.01.10.13.16
Explicitly cast to size_t.
2020-01-01 11:46:43 +00:00