240826 Commits

Author SHA1 Message Date
christos
67b10d3e9e OpenBSD term.c rev. 1.7 2002/11/29 20:13:39 deraadt
spelling
2016-02-15 22:53:38 +00:00
christos
f91f480498 OpenBSD readline.c rev. 1.14 2015/02/06 23:21:58 millert
use SIZE_MAX
2016-02-15 22:48:59 +00:00
riastradh
f1c295721b cardbus autoconf uses cardbus_attach_args, not isapnp_attach_args. 2016-02-15 22:37:54 +00:00
christos
92b1772005 OpenBSD readline.c rev. 1.13 2015/01/13 08:33:12 reyk
rl_set_keyboard_input_timeout() for readline 4.2 compat
2016-02-15 21:58:37 +00:00
christos
f8ee3c5528 OpenBSD eln.c rev. 1.3 2011/11/27 21:46:44 pascal
kill a C++-style comment
2016-02-15 21:56:35 +00:00
christos
42e2a4d875 Compile with WIDECHAR the same way the main Makefile does (Ingo Schwarze) 2016-02-15 21:38:07 +00:00
christos
1e12a8d1ca Don't free getline memory (Ingo Schwarze). 2016-02-15 21:35:52 +00:00
snj
00523047e3 allllllexander the greeeaaaaat, his name struck fear into hearts of men!
...but let's conquer that fear and give ol' alex a consistent and
correct date of death.

(he died of fever in baaaaaabylooooooonnnn)
2016-02-15 20:58:02 +00:00
riastradh
0c08237178 Use KASSERTs supported by CTASSERTs, not __builtin_unreachable.
pcc has no __builtin_unreachable, and this is clearer anyway.
2016-02-15 20:35:59 +00:00
snj
ab9bcecd45 fix english 2016-02-15 20:33:18 +00:00
riastradh
523712cd76 Print error code for failure to map PRAMIN BAR. 2016-02-15 19:36:35 +00:00
rtr
0a0528fd0a Fix building of IPv4-Mapped IPv6 addresses.
As discussed on tech-net@ use in6_sin_2_v4mapsin6() to build mapped
addresses.
2016-02-15 19:00:42 +00:00
christos
e8d0e8c012 forgot one fgetln define 2016-02-15 17:35:39 +00:00
christos
5390c8faa5 change tests for fgetln. 2016-02-15 16:14:39 +00:00
mbalmer
13a5a21897 Fix function name, no functional change.
Found by Travis Paul, (see PR/50786), thanks for reporting!
2016-02-15 15:56:33 +00:00
christos
a7ab79fbe5 Use getline for better portability. 2016-02-15 15:53:45 +00:00
christos
c0d16449e0 OpenBSD tokenizer.c rev. 1.8 2003/08/11 18:21:40 deraadt
don't increase amax on realloc failure
2016-02-15 15:37:20 +00:00
christos
efeef4e587 OpenBSD term.c rev. 1.13 2009/12/11 18:58:59 jacekm
fix two memory leaks
2016-02-15 15:35:03 +00:00
christos
c825536317 Change the test for the size of encoded buffer to include the NULL, from
OpenBSD; no functional change.
2016-02-15 15:30:50 +00:00
christos
5367da5f9e OpenBSD sig.c rev. 1.6 2001/12/06 04:26:00 deraadt
save and restore errno in signal handler
2016-02-15 15:29:25 +00:00
christos
87240809e9 Use fparseln to avoid newline hacks. 2016-02-15 15:26:48 +00:00
christos
70a36d136a use fparseln() to avoid needing to deal with missing \n in the last line
and also to handle comments automatically.
2016-02-15 15:18:01 +00:00
christos
cfb3849454 This needs _KERNTYPES on some platforms. 2016-02-15 14:59:38 +00:00
rtr
e2a3307b85 Reduce code duplication.
Split creation of IPv4-Mapped IPv6 addresses into its own function
and use it.

No functional change intended.  As posted to tech-net@
2016-02-15 14:59:03 +00:00
martin
c9d7952e8d Add missing closing ) and line continuation for mknative 2016-02-15 13:25:12 +00:00
martin
4739ebdb41 Avoid strict alias violation for VAX 2016-02-15 11:07:48 +00:00
ozaki-r
297068212d Run if_link_state_change in softint
if_link_state_change can execute the network stack that is expected to
not run in hardware interrupt (at least now), however network drivers
may call it in hardware interrupt. Avoid that by introducing a new
softint for if_link_state_change.

The original patch is provided by mlelstv@ and tweaked a bit by me.

Should fix PR kern/50602.
2016-02-15 08:08:04 +00:00
ozaki-r
b7a310ca27 Simplify bridge(4)
Thanks to introducing softint-based if_input, the entire bridge code now
never run in hardware interrupt context. So we can simplify the code.

- Remove spin mutexes
  - They were needed because some code of bridge could run in
    hardware interrupt context
  - We now need only an adaptive mutex for each shared object
    (a member list and a forwarding table)
- Remove pktqueue
  - bridge_input is already in softint, using another softint
    (for bridge_forward) is useless
  - Packet distribution should be down at device drivers
2016-02-15 01:11:41 +00:00
rtr
f5c6d9772a remove duplicated #include of <netinet/in.h> 2016-02-14 23:47:57 +00:00
palle
d66d7c235b sun4v: add breakpoint trap entry to the sun4v trap table 2016-02-14 21:13:33 +00:00
chs
2f02870f3b zero the i2c_attach_args structure before filling it in.
fixes occasional crashes in iic_attach().
2016-02-14 19:54:19 +00:00
dholland
cb63f3a3bd Remove extra stray break missed by Christos when committing PR 50783. 2016-02-14 19:11:19 +00:00
dholland
dca47d5247 Restore the local change
-gcc: internal compiler error: Killed (program cc1plus)
  +gcc: internal compiler error: Killed (program cc1plus received signal 9)
which was lost in an update somewhere after netbsd-6.

This clarification was found in the past to significantly reduce the
number of bug reports caused by people running out of swap, such as
(most likely) seen again today in PR 50802.

XXX: pullup-7
2016-02-14 19:08:10 +00:00
martin
7c285cf750 Make the vax target buildable 2016-02-14 19:00:04 +00:00
dholland
a33f4fbcc2 Add missing va_end, from David Binderman in PR 50798. 2016-02-14 18:12:30 +00:00
dholland
0107a58a68 Add missing va_end, from David Binderman in PR 50797. 2016-02-14 18:11:16 +00:00
dholland
4fbed23287 Add missing va_list, from David Binderman in PR 50796.
XXX: this file and arch/arc/stand/boot/disk.c are cutpaste clones.
2016-02-14 18:09:51 +00:00
dholland
e9150352cd Add missing va_end; PR 50795 from David Binderman. 2016-02-14 18:07:49 +00:00
dholland
28adc7db17 Fix wrong indent. 2016-02-14 18:05:31 +00:00
dholland
48ddc7de4d Add missing va_end(). PR 50794 from David Binderman. 2016-02-14 18:04:47 +00:00
dholland
e19dc66768 Add missing va_end. PR 50793 from David Binderman. 2016-02-14 18:01:45 +00:00
christos
2884af9fee From Ingo Schwarze:
el_getc() for the WIDECHAR case, that is, the version in eln.c.
For a UTF-8 locale, it is broken in four ways:

 1. If the character read is outside the ASCII range, the function
    does an undefined cast from wchar_t to char.  Even if wchar_t
    is internally represented as UCS-4, that is wrong and dangerous
    because characters beyond codepoint U+0255 get their high bits
    truncated, meaning that perfectly valid printable Unicode
    characters get mapped to arbitrary bytes, even the ASCII escape
    character for some Unicode characters.  But wchar_t need not
    be implemented in terms of UCS-4, so the outcome of this function
    is undefined for any and all input.

 2. If insufficient space is available for the result, the function
    fails to detect failure and returns garbage rather than -1 as
    specified in the documentation.

 3. The documentation says that errno will be set on failure, but
    that doesn't happen either in the above case.

 4. Even for ASCII characters, the results may be wrong if wchar_t
    is not using UCS-4.
2016-02-14 17:06:24 +00:00
christos
f54e4f97f9 From Ingo Schwarze:
As we have seen before, "histedit.h" can never get rid of including
the <wchar.h> header because using the data types defined there is
deeply ingrained in the public interfaces of libedit.

Now POSIX unconditionally requires that <wchar.h> defines the type
wint_t.  Consequently, it can be used unconditionally, no matter
whether WIDECHAR is active or not.  Consequently, the #define Int
is pointless.

Note that removing it is not gratuitious churn.  Auditing for
integer signedness problems is already hard when only fundamental
types like "int" and "unsigned" are involved.  It gets very hard
when types come into the picture that have platform-dependent
signedness, like "char" and "wint_t".  Adding yet another layer
on top, changing both the signedness and the width in a platform-
dependent way, makes auditing yet harder, which IMHO is really
dangerous.  Note that while removing the #define, i already found
one bug caused by this excessive complication - in the function
re_putc() in refresh.c.  If WIDECHAR was defined, it printed an
Int = wint_t value with %c.  Fortunately, that bug only affects
debugging, not production.  The fix is contained in the patch.

With WIDECHAR, this doesn't change anything.  For the case without
WIDECHAR, i checked that none of the places wants to store values
that might not fit in wint_t.

This only changes internal interfaces; public ones remain unchanged.
2016-02-14 14:49:34 +00:00
christos
61ee30487d From Ingo Schwartze:
Next step:  Remove #ifdef'ing in read_char(), in the same style
as we did for setlocale(3) in el.c.

A few remarks are required to explain the choices made.

 * On first sight, handling mbrtowc(3) seems a bit less trivial
   than handling setlocale(3) because its prototype uses the data
   type mbstate_t from <wchar.h>.  However, it turns out that
   "histedit.h" already includes <wchar.h> unconditionally (i don't
   like headers including other headers, but that ship has sailed,
   people are by now certainly used to the fact that including
   "histedit.h" doesn't require including <wchar.h> before), and
   "histedit.h" is of course included all over the place.  So from
   that perspective, there is no problem with using mbrtowc(3)
   unconditionally ever for !WIDECHAR.

 * However, <wchar.h> also defines the mbrtowc(3) prototype,
   so we cannot just #define mbrtowc away, or including the header
   will break.  It would also be a bad idea to porovide a local
   implementation of mbrtowc() and hope that it overrides the one
   in libc.  Besides, the required prototype is subtly different:
   While mbrtowc(3) takes "wchar_t *" as its first argument, we
   need a function that takes "Char *".  So unfortunately, we have
   to keep a ct_mbrtowc #define, at least until we can maybe get
   rid of "Char *" in the more remote future.

 * After getting rid of the #else clause in read_char(), we can
   pull "return 1;" into the default: clause.  After that, we can
   get rid of the ugly "goto again_lastbyte;" and just "break;".
   As a bonus, that also gets rid of the ugly CONSTCOND.

 * While here, delete the unused ct_mbtowc() from chartype.h.
2016-02-14 14:47:48 +00:00
skrll
542c3c7262 Update for latest dwc2 dist 2016-02-14 10:56:22 +00:00
skrll
5064f7beaa Merge conflicts 2016-02-14 10:53:30 +00:00
skrll
72e16840a4 Fix DWC2_READ_4 in dwc2_sample_frrem which is unused 2016-02-14 10:34:09 +00:00
riastradh
619b8ca5eb Map the same mmio size as Linux does.
Unlikely to have practical consequences -- just reduces differences
in behaviour from upstream, to rule them out.
2016-02-14 03:41:18 +00:00
riastradh
3169daaff3 Fix bus_space_subregion error branch.
Return error code, not 0 (!), on bus_space_subregion failure.

In answer to `XXX error branch' comment: if nouveau_barobj_ctor
fails, then the caller will call nouveau_barobj_dtor too.  So there's
no leak here.

Unlikely to fix any observed bugs with nouveau -- there's no error
branch in the Linux side here.  But maybe it will catch some other
bug earlier.
2016-02-14 03:06:06 +00:00
dholland
a76124b212 DNF 2016-02-13 23:12:34 +00:00