255578 Commits

Author SHA1 Message Date
kamil
947899dacf Register new weak symbol in libc for internal usage: asctime
The NetBSD Standard C Library uses internally some of its functions with
a mangled symbol name, usually "_symbol". The internal functions shall not
use the global (public) symbols.

Add asctime to namespace.h.

Register a new __weak_alias() entry for asctime() in asctime.c.

acstime() is used internally in ctime and __ctime50. This revision switches
the internal usage to the internal symbol.

Sponsored by <The NetBSD Foundation>
2018-01-05 20:01:31 +00:00
kamil
17a7df3a53 Register dl_iterate_phdr in the libc's namespace.h
The NetBSD Standard C Library uses internally some of its functions with
a mangled symbol name, usually "_symbol". The internal functions shall not
use the global (public) symbols.

Stop using the public global name of dl_iterate_phdr in tls/tls.c:
__libc_static_tls_setup().

Follow the approach with other dlopen(3)-like functions with the
namespace.h in the dl_iterate_phdr() case. Use internally a weak symbol:
__dl_iterate_phdr instead of dl_iterate_phdr.

Sponsored by <The NetBSD Foundation>
2018-01-05 19:29:44 +00:00
kamil
575eeceb5d Include namespace.h in a few of libc source files
The NetBSD Standard C Library uses internally some of its functions with
a mangled symbol name, usually "_symbol". The internal functions shall not
use the global (public) symbols.

This change finishes elimination of usage of the global name of the
following symbols:
  - close -> _close
  - execve -> _execve
  - fcntl -> _fcntl
  - setcontext -> _setcontext
  - wait6 -> _wait6
  - write -> _write
  - writev -> _writev

Sponsored by <The NetBSD Foundation>
2018-01-05 19:01:36 +00:00
kamil
9b020cc558 Register more syscalls in namespace.h (of libc)
Add weak symbols for:
 - fcntl
 - close
 - execve
 - setcontext
 - wait6
 - write
 - writev

These syscalls are already marked as WEAKASM, generating weak references.

Sponsored by <The NetBSD Foundation>
2018-01-05 18:57:06 +00:00
kamil
b3babee32b Include namespace.h in GCDAProfiling.c (compiler_rt)
The NetBSD Standard C Library uses internally some of its functions with
a mangled symbol name, usually "_symbol". The internal functions shall not
use the global (public) symbols.

This change eliminates usage of the global name of the following symbols:
  - fdopen -> _fdopen
  - mmap -> _mmap
  - strdup -> _strdup

Sponsored by <The NetBSD Foundation>
2018-01-05 17:54:31 +00:00
kamil
5236f0d558 Include namespace.h in citrus/citrus_lc_ctype.c
The NetBSD Standard C Library uses internally some of its functions with
a mangled symbol name, usually "_symbol". The internal functions shall not
use the global (public) symbols.

This change eliminates usage of the global name of the following symbol:
  - strlcpy -> _strlcpy

Sponsored by <The NetBSD Foundation>
2018-01-05 17:52:06 +00:00
christos
249cf59313 use some size_t, add whitespace between functions, rcsids. 2018-01-05 14:22:26 +00:00
christos
087be49549 PR/52900: Tomohiro Kusumi: Fix kernel panic when target's ->init() failed
Reliably unbusy the target in the *all* the destroy routines, so ioctl
does not need to do it.
2018-01-05 14:22:05 +00:00
flxd
b88074d92e Comment out DIAGNOSTIC/DEBUG/LOCKDEBUG from r1.192 slowing down real machines.
OK christos@
2018-01-05 13:20:45 +00:00
flxd
8322a83c8a Check presence of VFB01/VFB02 frame buffer option on DEC(station|system) 3100. 2018-01-05 13:11:32 +00:00
msaitoh
7909c778fe Add NVMe devices. 2018-01-05 10:04:13 +00:00
martin
14e42d58e6 Mark L1e_idx as __diagused, it is only referenced in a KASSERT. 2018-01-05 09:13:48 +00:00
maxv
a4d0307ee1 Add a __HAVE_PCPU_AREA option, enabled by default on native amd64 but not
Xen.

With this option, the CPU structures that must always be present in the
CPU's page tables are moved on L4 slot 384, which means address
0xffffc00000000000.

A new pcpu_area structure is defined. It contains shared structures (IDT,
LDT), and then an array of pcpu_entry structures, indexed by cpu_index(ci).
Theoretically the LDT should be in the array, but this will be done later.

During the boot procedure, cpu0 calls pmap_init_pcpu, which creates a
page tree that is able to map the pcpu_area structure entirely. cpu0 then
immediately maps the shared structures. Later, every CPU goes through
cpu_pcpuarea_init, which allocates physical pages and kenters the relevant
pcpu_entry to them. Finally, each pointer is replaced to point to pcpuarea.

The point of this change is to make sure that the structures that must
always be present in the page tables have their own L4 slot. Until now
their L4 slot was that of pmap_kernel, and making a distinction between
what must be mapped and what does not need to be was complicated.

Even in the non-speculative-bug case this change makes some sense: there
are several x86 instructions that leak the addresses of the CPU structures,
and putting these structures inside pmap_kernel actually offered a way to
compute the address of the kernel heap - which would have made ASLR on it
plainly useless, had we implemented that.

Note that, for now, pcpuarea does not contain rsp0.

Unfortunately this change adds many #ifdefs, and makes the code harder to
understand. There is also some duplication, but that will be solved later.
2018-01-05 08:04:20 +00:00
uwe
f89964526a Driver for EM Microelectronic EM3027 RTC and temperature sensor. 2018-01-05 03:07:15 +00:00
christos
8b26e6d696 Don't stomp past the end of the array! need __arraycount not sizeof()
Found by chuq, while debugging the sdf.org crashes
XXX: pullup-8
Restructure a bit for readability.
2018-01-05 01:53:15 +00:00
christos
fa3ceadced don't print for ENOEXEC 2018-01-05 01:51:36 +00:00
pgoyette
e01eb3407e Bump size of uefi image - we've outgrown the old size 2018-01-05 01:33:11 +00:00
kamil
c5b83981a9 Add bunch of missing includes of namespace.h in libc
The NetBSD Standard C Library uses internally some of its functions with
a mangled symbol name, usually "_symbol". The internal functions shall not
use the global (public) symbols.

This change eliminates usage of the global changes of the following symbols:
 - strlcat -> _strlcat
 - sysconf -> __sysconf
 - closedir -> _closedir
 - fparseln -> _fparseln
 - kill -> _kill
 - mkstemp -> _mkstemp
 - reallocarr -> _reallocarr
 - strcasecmp -> _strcasecmp
 - strncasecmp -> _strncasecmp
 - strptime -> _strptime
 - strtok_r -> _strtok_r
 - sysctl -> _sysctl
 - dlopen -> __dlopen
 - dlclose -> __dlclose
 - dlsym -> __dlsym

Sponsored by <The NetBSD Foundation>
2018-01-04 20:57:28 +00:00
maxv
31acdb2583 Declare gdt_size as const, simplifies. 2018-01-04 20:38:30 +00:00
maxv
9baa91b0bd Declare IOMAP_VALIDOFF, not to use ci_tss pointers. 2018-01-04 14:02:23 +00:00
maxv
8b0fa23784 Allocate the TSS area dynamically. This way cpu_info and cpu_tss can be
put in separate pages.
2018-01-04 13:36:30 +00:00
maxv
ad750876f8 Group the different TSSes into a cpu_tss structure. And pack this
structure to make sure there is no padding between 'tss' and 'iomap'.
2018-01-04 12:34:15 +00:00
msaitoh
a566db57e8 Add ASPM workaround for 8257[1234] and 82583 to prevent device timeout or
hangup. Fixes PR#52818 reported by Shinichi Doyashiki.
2018-01-04 09:43:27 +00:00
christos
59b5a49a77 Add a new sockopt member to keep track of the actual size of the option
that should be returned to the caller in getsockopt(2).

(Tom Ivar Helbekkmo)
2018-01-04 01:42:25 +00:00
knakahara
0d3459cf8b fix "intrctl list" panic when ACPI is disabled.
reviewed by cherry@n.o and tested by msaitoh@n.o, thanks.
2018-01-04 01:01:59 +00:00
khorben
db8ce746e1 Fix off-by-one when calling snprintf(9) in hdafg_getdev()
This is actually harmless, since:
- the offset is too short rather than too long (no overflow)
- the struct audio_device comes from userland (no information leak)

"looks good to me" nat@
2018-01-04 00:09:12 +00:00
maxv
9b24abb72f style 2018-01-03 09:46:41 +00:00
maxv
085a67f389 simplify 2018-01-03 09:38:23 +00:00
maxv
c51e5bf395 Stop sharing the double-fault stack. It is embedded in .data, and we won't
want that in the future. This has always been wrong anyway, even if it is
unlikely that two CPUs will double fault at the same time.
2018-01-02 18:54:26 +00:00
maxv
0dfa4374f2 Use decimal numbering - hex is just misleading -, use ZTRAP_NJ for NMIs,
and declare intrspurious independently.
2018-01-02 18:41:14 +00:00
pgoyette
b0ab52e7b1 Now that watchdog support has been added, make sure that a modular driver
requires the sysmon_wdog module.
2018-01-02 00:47:14 +00:00
christos
9c08206436 PR/52887: HITOSHI Osada: wbsio needs sysmon_wdog. 2018-01-02 00:25:35 +00:00
christos
ff1a7c8cc8 Only FLUSH if we are ending libedit; DRAIN if we suspend for readline.
This allows pasting multiline buffers (Gerry Swislow)
2018-01-01 22:32:46 +00:00
christos
ccde5fbf0d remove this, it was just to compile-test the drivers. 2018-01-01 17:33:23 +00:00
skrll
68242f6396 Remove unnecessary #includE 2018-01-01 17:03:25 +00:00
christos
13c9c3f43b pass the lwp for the register calls. 2018-01-01 16:28:14 +00:00
christos
f7805b6647 Remove comment now that the getsockopt code passes the size. 2018-01-01 16:14:30 +00:00
jmcneill
c084cd00f4 Set and clear IFF_OACTIVE as necessary, and add support for queueing
multiple packets before performing a PKO doorbell write.
2018-01-01 13:25:22 +00:00
wiz
db390c267e Remove trailing comma from SYNOPSIS.
Try improving markup.
2018-01-01 12:46:49 +00:00
wiz
2f0bc98493 Use more markup. 2018-01-01 12:45:07 +00:00
maxv
de57d40f77 Remove MFREE. 2018-01-01 12:36:26 +00:00
maxv
ef672d88d0 Detect use-after-frees on mbufs with external storage, too. This is done
even when the refcount is > 1.

Again, this code is enabled by default, because it is fast and quite
useful.
2018-01-01 12:22:59 +00:00
maxv
2aa063ae41 Don't use macros, rather inline, much clearer.
For the record, I was partly mistaken in my previous commit: even though
the macros were local, the function names were still the ones of the real
callers.

However, setting the name in m_data was not a good thing; this was a
valid pointer, and the kernel could execute a long time before figuring
out the mbuf was already freed - therefore making debugging more difficult.
And information on the caller can be obtained via ddb anyway.
2018-01-01 12:09:56 +00:00
roy
140453bcff Note import of dhcpcd-7.0.0 2018-01-01 11:52:45 +00:00
roy
094d397286 Sync 2018-01-01 11:50:56 +00:00
roy
d92ae095f2 Import dhcpcd-7.0.0 with the following changes:
*  dhcp: when unicasting on L3, unicast on L2 as well
  *  dhcp: when rebooting, don't set cidaddr
  *  dhcp6: don't listen on IPv6 addresses when not using DHCPv6
  *  dhcp: only set probe state when probing (fixes REBOOT reason)
  *  ipv6: disable kernel RA if interface is active
  *  hooks: set protocol to link for link layer events
2018-01-01 11:48:51 +00:00
skrll
33ae4756b0 Need to map 512MB for some RPIs 2018-01-01 11:28:33 +00:00
jnemeth
6e0fe2c664 PR/52885 - Shinichi Doyashiki -- typo in comment 2018-01-01 08:33:28 +00:00
maxv
e8221aea54 Compile the prekern entry point only under KASLR. 2018-01-01 08:14:13 +00:00
maxv
98ae6a49f7 Use the default %cs, and mask the other segregs. 2018-01-01 08:03:43 +00:00