Commit Graph

4655 Commits

Author SHA1 Message Date
chs
4b312fc48f in cpu_switchto(), remove the MP-unsafe code to mark a pmap active on a CPU,
pmap_activate() already does this.  add MP locking to pmap_activate()
and pmap_deactivate().  move flushing of user windows and virtual caches
from pamp_activate() to pmap_deactivate().
2012-11-04 00:32:47 +00:00
chs
e4e833d3aa Add RAS support for sparc. 2012-11-02 00:01:19 +00:00
chs
cbab9cadce split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
2012-10-27 17:17:22 +00:00
apb
f3929b106b Add "options COMPAT_60" to all kernel configuration files
that already had "options COMPAT_50".
2012-10-17 14:48:07 +00:00
jdc
4be6ce2eeb Adapt to the changed signature of pckbc_cnattach(). 2012-10-13 17:58:53 +00:00
tsutsui
19c63c3512 Fix device_t/softc split botches that could be fatal. From
Chuck Silvers' patch posted current-users and tech-kern:
http://mail-index.netbsd.org/current-users/2012/10/09/msg021233.html

Should be pulled up to netbsd-6.
2012-10-10 16:51:50 +00:00
jdc
5e8337c848 Wrap sbuserr_handler and sbus_error with:
#if (defined(SUN4M) && !defined(MSIIEP)) || defined(SUN4D)
to give them the same scope as the definitions in ../sparc/intr.c.
Allows SUN4C-only kernels to compile.
OK mrg
2012-09-23 09:54:04 +00:00
martin
d8e9a75f44 Adapt for _UC_TLSBASE addition 2012-09-13 11:49:16 +00:00
manu
bba80928a8 setcontext() used to be incompatible with -lpthread since it affected
the TLS pointer, therefore wrecking the pthread environement.

Some ports had _UC_TLSBASE flag or equivalent (_UC_UNIQUE on alpha)
that controlled whether setcontext() would change the TLS pointer.
This change let libpthread override setcontext() with its own version
that unsets _UC_TLSBASE, enabling safe usage of setcontext() with
-lpthread.

We also have the following required changes here:
- rename alpha's _UC_UNIQUE into _UC_TLSBASE
- add _UC_TLSBASE definition in header file for all ports
  (powerpc, sh3, sparc and sparc64 lack the implementation for now)
- introduce a libc stub that can be overriden for setcontext()
- modify MD libcs swapcontext() implementations so that they use the
  setcontext() libc stub instead of doing a plain system call.

While we are there:
- document various MD _UC_* flags in header file
- add libc and libpthread tests for swapcontext() behavior
  (hopefully helpful to spot MD problems introduced with this change)

Future work:
- Deciding whether kernel support or _UC_TLSBASE should be added for
  powerpc, sh3, sparc and sparc64 is left to portmasters
  sparc64

Approved by core@
2012-09-12 02:00:51 +00:00
abs
3267a6b9fe Update all kernel configs mentioning WSEMUL_* but not already including
WSDISPLAY_COMPAT_USL using the following rules:
- If WSEMUL_ is commented out, add commented out out WSDISPLAY_COMPAT_USL
- If INSTALL or obviously memory constrained, add WSDISPLAY_DEFAULTSCREENS=1
  and commented out WSDISPLAY_COMPAT_USL
- Otherwise add WSDISPLAY_COMPAT_USL

Some of the INSTALL configs for larger memory machines are probably suitable
for adding WSDISPLAY_COMPAT_USL.

Now wsconscfg(8) should be able to switch VTs when expected.

Implemented after no objection from tech-kern to the following:

On 5 June 2012 09:47, David Brownlee <abs@absd.org> wrote:
> wsconscfg(8) requires WSDISPLAY_COMPAT_USL in order to switch virtual
> terminals.
>
> Except when in an exceptionally memory or space constrained
> environment (INSTALL being the obvious case), is there any reason why
> all GENERIC and GENERIC-like kernels which have wscons enabled
> shouldn't also have WSDISPLAY_COMPAT_USL?
2012-08-17 20:11:37 +00:00
abs
715998cc28 Ensure all WSDISPLAY_COMPAT_USL entries have same comment 2012-08-17 19:43:24 +00:00
martin
cc2925116b Ifdef MSIIEP differently, so krups actually boots again. 2012-07-31 20:12:27 +00:00
martin
3af7e1b0b5 Make KRUPS kernel buildable again 2012-07-31 16:38:37 +00:00
martin
c93cee27e7 Move cn_tab initialization to bootstrap() 2012-07-31 14:23:33 +00:00
christos
4362d3edda move cn_tab initializationt to cpu_startup 2012-07-30 17:29:55 +00:00
mlelstv
8ce4433821 Do not call setroot() from MD code and from MI code, which has
unwanted sideeffects in the RB_ASKNAME case. This fixes PR/46732.

No longer wrap MD cpu_rootconf(), as hp300 port stores reboot information
as a side effect. Instead call MI rootconf() from MD code which makes
rootconf() now a wrapper to setroot().

Adjust several MD routines to set the global booted_device,booted_partition
variables instead of passing partial information to setroot().

Make cpu_rootconf(9) describe the calling order.
2012-07-29 18:05:39 +00:00
matt
8ad8b5528b Fix more -fno-common fallout. 2012-07-29 00:04:05 +00:00
matt
a971ba5943 Remove declartions of physmem 2012-07-28 19:08:22 +00:00
matt
f96ef7b3c5 Remove safepri and use IPL_SAFEPRI instead. This may be defined in a MD
header file (if not, a value of 0 is assmued).
2012-07-27 05:36:09 +00:00
tsutsui
8aa95513d4 Fix tftpboot which was broken by my botched WARNSfy in last year.
Also add comments that mention libsa tftp requires network device socket
in f_devdata in struct open_file, from spz@ in PR port-sparc64/46652.
Briefly tested tftpboot and nfsboot on Ultra5.
2012-07-16 11:26:27 +00:00
macallan
6c4d0ceaeb switch to WSEMUL_VT100 to reduce differences with sparc64 and other wscons
and fb console using ports
WSEMUL_SUN is left in but commented out so whoever wants it back can have it
with minimal effort
2012-06-26 02:04:55 +00:00
abs
8f45a59205 Adjust the WSDISPLAY_COMPAT_USL comment to mention wsconscfg, to at least
give a hint that its not just for third party compat. No functional change.
2012-06-05 08:44:07 +00:00
martin
a47afdb76c Pass the "boothowto" from the bootloader to the kernel.
If (an old) bootloader did not pass the flags, check explicitly if we
missed RB_USERCONF and invoke userconf_prompt() in MD code, as MI code
already missed it.
This fixes PR 46466.
2012-05-28 19:24:29 +00:00
martin
6c3cc552c2 Calling _lwp_create() with a bogus ucontext could trigger a kernel
assertion failure (and thus a crash in DIAGNOSTIC kernels). Independently
discovered by YAMAMOTO Takashi and Joel Sing.

To avoid this, introduce a cpu_mcontext_validate() function and move all
sanity checks from cpu_setmcontext() there. Also untangle the netbsd32
compat mess slightly and add a cpu_mcontext32_validate() cousin there.

Add an exhaustive atf test case, based partly on code from Joel Sing.

Should finally fix the remaining open part of PR kern/43903.
2012-05-21 14:15:16 +00:00
martin
1519b75992 On unaligned access, provide the data address to the signal handler, instead
of the faulting instructions address.
2012-05-01 09:40:15 +00:00
dholland
857183baad Fix totally uncompilable code. PR 46374 from Henning Petersen. 2012-04-25 08:19:33 +00:00
mrg
18f8e19f58 don't bother whining about bogusintr on zs. 2012-04-13 06:26:04 +00:00
christos
7484a2dbbe - Normalize inclusion protection (remove)
- Move CHAR_{MIN,MAX} to a common file.
- Fix broken comments
2012-03-28 17:03:27 +00:00
martin
bb4ba021f4 Make explicitly clear that we mean raw I/O on device passthru, not just
generic passthru.
2012-03-25 08:48:40 +00:00
christos
e86314f733 make fp_except unsigned 2012-03-20 23:57:57 +00:00
martin
066b418437 mark reloc bitfield linted 2012-03-17 21:45:39 +00:00
elad
0c9d8d15c9 Replace the remaining KAUTH_GENERIC_ISSUSER authorization calls with
something meaningful. All relevant documentation has been updated or
written.

Most of these changes were brought up in the following messages:

    http://mail-index.netbsd.org/tech-kern/2012/01/18/msg012490.html
    http://mail-index.netbsd.org/tech-kern/2012/01/19/msg012502.html
    http://mail-index.netbsd.org/tech-kern/2012/02/17/msg012728.html

Thanks to christos, manu, njoly, and jmmv for input.

Huge thanks to pgoyette for spinning these changes through some build
cycles and ATF.
2012-03-13 18:40:26 +00:00
nakayama
9f0e7f1c56 Remove stray comments for LKM. 2012-03-11 06:11:29 +00:00
mrg
1223b71a2e move IPI debugging all inside DEBUG, but disable it by default. 2012-03-11 00:32:21 +00:00
joerg
99c3eea80c P1003_1B_SEMAPHORE is no longer optional. 2012-03-10 21:51:48 +00:00
rmind
ad12c77015 Remove COMPAT_SA / KERN_SA. Welcome to 6.99.3!
Approved by core@.
2012-02-19 21:05:51 +00:00
matt
1d7f24ead8 Change old-style function defintions to C89 prototypes.
Approved by releng.
2012-02-12 16:34:06 +00:00
martin
f8c7c04bbe Add a posix_spawn syscall, as discussed on tech-kern.
Based on the summer of code project by Charles Zhang, heavily reworked
later by me - all bugs are likely mine.
Ok: core, releng.
2012-02-11 23:16:15 +00:00
para
4c23b30cff proper sizing of kmem_arena on different ports
PR port-i386/45946: Kernel locks up in VMEM system
2012-02-10 17:35:47 +00:00
mrg
4f67d478db avoid writing 1 byte beyond the end of the string promlib.c has given us.
instead of forcing a nul byte afterwards, KASSERT() that the final byte
already is a nul.  if there are broken proms... well, we can fix them.

this, plus one more change, allows my SS20 to boot multiuser.
2012-01-30 04:25:14 +00:00
para
cdc400a53c fix sparc after kmem_map is gone 2012-01-29 11:49:58 +00:00
para
89c9828deb converting extent(9) from malloc(9) to kmem(9)
preceding kmem-vmem-pool-uvm patch

releng@ acknowledged
2012-01-27 18:52:47 +00:00
christos
dd23e71080 Use and define ALIGN() ALIGN_POINTER() and STACK_ALIGN() consistently,
and avoid definining them in 10 different places if not needed.
2012-01-24 20:03:36 +00:00
joerg
e8bec33be1 Change CMSG_SPACE and CMSG_LEN to provide Integer Constant Expressions
again. This was changed in sys/socket.h r1.51 to work around fallout
from the IPv6 aux data migration. It broke the historic ABI on some
platforms. This commit restores compatibility for netbsd32 code on such
platforms and provides a template for future changes to the CMSG_*
alignment. Revert PCC/Clang workarounds in postfix and tmux.
2012-01-20 14:08:04 +00:00
macallan
9052ce1f68 include a small font 2012-01-11 17:16:35 +00:00
macallan
1fa79ac882 use rasops_init(0, 0) 2012-01-11 15:53:32 +00:00
dholland
7bbf82b772 WABPL is no longer considered experimental (has not been for some time)
so update its comment in config files.
2011-12-18 05:49:22 +00:00
mrg
9a4a666ff3 implement bdev_size(9) wrapper around d_psize() routine, so we can take
the device lock in relevant places.  avoid doing so while actually dumping.

tested i386 crash dumps still work, and that all touched files compile.

fixes PR#45705.
2011-12-12 19:03:07 +00:00
jmcneill
8a962f23f2 Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. From
the original ad-audiomp branch notes:

  Add MP locking to the audio drivers.

  Making the audio drivers MP safe is necessary before efforts
  can be made to make the VM system MP safe.

  The are two locks per device instance, an ISR lock and
  a character device lock. The ISR lock replaces calls to
  splaudio()/splx(), and will be held across calls to device
  methods which were called at splaudio() before (e.g.
  trigger_output). The character device lock is held across
  calls to nearly all of the methods, excluding some only
  used for initialization, e.g. get_locks.

Welcome to 5.99.57.
2011-11-23 23:07:28 +00:00
tls
8a012bd83f The rnd pseudo-device is not really optional, because it is in the same
source file as the entropy-pool code itself.  Move it to std.  This
will be cleaned up more when I split the sources up as they should be.

This fixes build breaks on several ports.  Thanks to Havard Eidnes for
pointing them out.
2011-11-22 21:25:05 +00:00