Commit Graph

4881 Commits

Author SHA1 Message Date
joerg
6ccf4859e4 Add GENASSYM_CPPFLAGS in two more places. 2014-03-04 17:57:56 +00:00
skrll
dd7bb1e0a8 G/C sys/simplelock.h includes 2014-02-28 10:16:51 +00:00
palle
4ad8530004 sun4v: Rename TLB_ defines to SUN4U_TLB_ so entries created using TSB_DATA() are properly setup for sun4u and sun4v. Relocate the cputyp variable from autoconf.c to locore.s and make it const in param.h so optimized code can be generated. Parts from OpenBSD. Optimization suggested by nakayama@. OK martin@, mrg@, nakayama@ 2014-02-21 18:00:09 +00:00
joerg
54539e4a0b Zero the block on failure, not just the first pointer in it. 2014-02-20 15:11:36 +00:00
joerg
33a6246fd2 Add prototype for main. 2014-02-20 14:50:39 +00:00
matt
6b4f5dd53c Export __HAVE_LONG_DOUBLE 128 to kernel for emulation 2014-02-01 16:10:12 +00:00
matt
4d035bbcf3 Consolidate the 128-bit long double defintions to <sys/ieee754.h>
Each arch that uses it now defines __HAVE_LONG_DOUBLE to 128.
<machine/ieee.h> is now just include the machine's math.h followed
by <sys/ieee754.h>
2014-01-31 19:38:06 +00:00
mrg
f3301a1034 remove schedintr_4m(), and go back to only having the level 14
timer call statclock/schedclock.  the randomness for this clock
makes the hardclock() call very jittery.

instead of this, trigger a softintr IPI at level 10 on non-primary
CPUs from the primary CPU's clock interrupt (at level 10.)  this
cleans up the generic sparc timer code a little as well.

this makes the time goes backwards problem *much* less frequent,
but i still see it sometimes.
2014-01-19 00:22:33 +00:00
tsutsui
8c436a9898 Add empty LIBCRTI= as LIBCRT0 to build sa programs without installed DESTDIR.
XXX: probabry we should have bsd.saprog.mk or something.
2014-01-12 15:26:28 +00:00
dsl
95739e63cd Remove __HAVE_PROCESS_XFPREGS and add the extra parameter for the size
of the fp save area to all the process_read_fpregs() and
  process_write_fpregs() functions.
None of the functions have been modified to use the new parameters.
The size is set for all the writes, but some of the arch-specific reads
  just pass NULL.
The amd64 (and i386) need variable sized fp register save areas in order
  to support AVX and other enhanced register areas.
These functions are rarely called - so the extra argument won't matter.
2014-01-04 00:10:02 +00:00
dsl
be74e0a9c9 Change the type of the 'cookie' that holds the state of the core dump file
from 'void *' to the actual type 'struct coredump_iostate *'.
In most of the code the contents of the structure are still unknown.
This just stops the wrong type of pointer being passed to the 'void *'
parameter.
I hope I've found everything, amd64 GENERIC and i386 GENERIC & ALL compile.
2014-01-01 18:57:15 +00:00
martin
2e67acc4d6 Improve debugging output 2013-12-30 08:47:50 +00:00
martin
750e958278 Avoid buffer overruns (no practical difference for any sane firmware
properties, but better be safe).
2013-12-30 08:43:28 +00:00
martin
19817e28e0 The "close" call returns no arguments 2013-12-18 10:09:56 +00:00
mrg
9408126e02 apply __diagused where appropriate and remove useless variables 2013-12-16 15:48:29 +00:00
christos
26892b74da Add linted comments. 2013-12-15 03:45:07 +00:00
christos
32742370f4 use CPU_INFO_ITERATOR instead of int. 2013-12-13 10:31:05 +00:00
macallan
ccab43d8c7 shut up an unused variable warning that shows up in UP kernels 2013-12-10 17:24:47 +00:00
palle
b11afb2f13 Add support for running ofwboot on sun4v. Please note that the kernel on sun4v will be loaded properly but when the kernel takes over it will crash immediately since the kernel is not sun4v ready yet 2013-12-08 14:41:28 +00:00
jdc
9949853838 Use a double linked list with a static head to track MMU entries.
Code from martin@.
Tested on SUN4 (4/330), SUN4C (SS2), and SUN4M (Krups, 4/630).
2013-12-08 10:12:39 +00:00
jdc
f022349f64 Clarify comment about SER_SZERR. 2013-12-04 18:44:14 +00:00
christos
8303a39ddc replace circleq with tailq.
XXX: this adds a pointer per mmu entry; we can do better, but it would
require custom lists. Is it worth it?
2013-11-25 02:59:14 +00:00
martin
acdd726fe5 PR 48384: reorganize struct ieee_ext for sparc64 to only use a high/low
part for the mantissa.
Adjust arch specific code accordingly.
2013-11-20 22:22:20 +00:00
alnsn
988b97e4aa Always define SLJIT_CACHE_FLUSH(), start include guards with '_' and use _LP64 guard. 2013-11-17 12:01:58 +00:00
mrg
2a627e63bd - convert CPU_INFO_ITERATOR in the !MP case to be __unused, and convert
all the iterators to use it
- print the right variables in nmi_hard_msiiep() (thanks set-but-unused)
- move variable inside usage #ifdef
- use (void) instead of a "volatile int" junk variable
- remove unused variables
2013-11-16 23:54:01 +00:00
mrg
76122a21da sprinkle some __diagused where appropriate. 2013-11-01 06:22:46 +00:00
mrg
fa33d35f40 - remove unused but set variables.
- use __USE() where necessary.
- remove useless 'volatile' markers

kd.c:consinit() might be wrong for old proms, but i've not
changed it really.
2013-10-19 19:40:23 +00:00
christos
86b6b2fef2 make cpu_need_resched() macros consistent; __USE flags 2013-10-19 19:20:59 +00:00
mrg
4c1f611656 add -Wa,-Av8 to CFLAGS and AFLAGS to fix kernel build with binutils 2.23.2. 2013-10-03 22:01:04 +00:00
joerg
4d12bfcd15 Pass PICFLAGS down to cc-as-as and use __PIC__ to decide if it is small
vs big PIC mode. Retire -DPIC and -DBIGPIC.
2013-09-12 15:36:14 +00:00
matt
61ef18cf91 Use <bsd.klinks.mk> 2013-08-21 06:41:52 +00:00
macallan
e74252408e comments & whitespace police 2013-08-14 01:53:27 +00:00
joerg
c5837ca27d Build boot loaders without unwind tables. 2013-08-12 16:34:05 +00:00
rmind
666e919182 G/C PFIL_HOOKS from the kernel configs. 2013-06-30 21:38:55 +00:00
matt
0eda4bdef1 Use sy_invoke.
Collapse syscall_fancy and syscall_plain into syscall.
Use p_trace_enabled.
2013-06-26 16:53:34 +00:00
macallan
94cfee8919 add store-with-clamp instructions 2013-06-19 00:41:16 +00:00
macallan
263f0a1b9e fix typo 2013-06-12 20:44:20 +00:00
macallan
3a5f3d0384 document arithmetics instructions 2013-06-12 20:43:21 +00:00
macallan
b2dfd674e8 fix serial type&pasto, while there add SX_ADD instructions 2013-06-12 04:23:46 +00:00
hannken
93a1ef71b0 Move member di_inumber from ufs1_dinode to ulfs1_dinode.
No functional change intended. Tested on sparc64.
2013-06-10 10:26:22 +00:00
christos
e46f5f0078 remove obsolete networking options 2013-06-05 23:07:59 +00:00
macallan
74a80711ca add a bunch more instructions ( still not complete but we're getting there ) 2013-06-05 18:15:06 +00:00
macallan
8df3ac20cc report actual VRAM size in fb_type.fb_size 2013-06-04 22:31:30 +00:00
macallan
cfaf702b2e add STore with (plane) Mask instruction 2013-06-04 22:30:30 +00:00
macallan
7ad41540d3 actually map the whole SX IO space instead of just the first page over and
over again (doh)
2013-06-04 13:42:37 +00:00
macallan
d9d045776f add SX_SELECT_S instruction 2013-05-30 20:09:23 +00:00
macallan
be5435b2d3 install sxreg.h to /usr/include/sparc/ 2013-05-30 20:08:47 +00:00
macallan
b4df4454b7 allow userland to map SX registers and IO space 2013-05-29 22:26:39 +00:00
macallan
43e7cffbe8 fix a typo 2013-05-29 22:25:23 +00:00
christos
1cc8b68d4b the bogus number police 2013-04-27 21:43:10 +00:00
christos
dc14ae835f remove confusing numeric locators where they are unused. 2013-04-27 18:19:19 +00:00
martin
2715e8ca06 Make a "panic" message slightly more verbose 2013-04-16 07:45:37 +00:00
jdc
5b2f52eca0 Add PCI fixup for MicroSPARC-IIep.
Unconfigured PCI-PCI bridges and devices behind them are configured.
2013-04-16 06:57:05 +00:00
christos
caafbf4e1b add missing SSIZE_MIN 2013-04-11 00:57:34 +00:00
jdc
91d34d1a2d When we receive a PCI PIO error, print the PCIC status register too. 2013-04-07 16:32:41 +00:00
jdc
9e86b737ce Check if sbus is defined in the kernel configuration before using it.
From Taylor R Campbell.
2013-03-24 17:50:26 +00:00
uwe
64f321a684 HE WAS OBEDIANT 2013-03-13 00:36:52 +00:00
christos
2c1aa36c3d Under FAST_IPSEC, IPSEC_ESP is mandatory; GC it. 2013-03-02 02:42:07 +00:00
joerg
e240adbd0b Retire OSI network stack. OK core@ 2013-03-01 18:25:13 +00:00
martin
646a4c9589 Fix thinko in previous (and misleading comment): stop ignoring table
entries for to be ignored devices.
2013-02-14 12:44:16 +00:00
martin
0490739fe5 Rearrange the special mainbus device list to allow for optional entries.
Fixes a panic on all SUN4M machines w/o an sx graphics adapter.
XXX the "ignore devices at mainbus" list seems to be ignored - or am I
missing something?
2013-02-14 12:14:13 +00:00
martin
e5f6266579 We have an implicit 1 MSB bit in the mantissa. Pointed out by Matt Thomas.
Fixes PR port-sparc64/47536.
2013-02-14 09:34:46 +00:00
macallan
aadf8bb6f4 break some more long lines 2013-02-12 22:24:47 +00:00
macallan
4a96c3ec6f add sx at mainbus 2013-02-07 16:19:15 +00:00
macallan
f4a02ceff0 - implement buttom-up copies in cg14_bitblt() so scrolling down works now
- use more registers when copying
- use hardware to draw the cursor
- use putchar() for horizontal scrolling since byte-wise overlapping copy
  ops wouldn't be any faster anyway
2013-02-07 16:14:30 +00:00
macallan
328b697b0f add SX_ROP instruction 2013-02-06 20:39:03 +00:00
macallan
afd2d65f39 use SX for basic hardware acceleration
not quite complete yet but good enough to be useful
missing things include:
- backwards blits
- ROP support
- the cursor is still drawn by software
2013-02-06 04:10:54 +00:00
macallan
d211f15b2f fix typos, deal with hardware insanity 2013-02-06 04:06:29 +00:00
macallan
47a52b9471 attach SUNW,sx early so cgfourteen can grab it right away and doesn't have
to play games waiting for it
2013-02-05 22:03:16 +00:00
macallan
3e1deca6c5 don't skip SUNW,sx - we've got a driver now 2013-02-05 21:53:45 +00:00
macallan
3b60920a22 attachment and initialization for SX 2013-02-05 21:52:48 +00:00
macallan
8c5cfad34f throw out RASTERCONSOLE goo 2013-02-05 21:45:39 +00:00
dholland
dcd34a91c5 Stuff UFS_ in front of a few of ufs's symbols to reduce namespace
pollution. Specifically:
   ROOTINO -> UFS_ROOTINO
   WINO -> UFS_WINO
   NXADDR -> UFS_NXADDR
   NDADDR -> UFS_NDADDR
   NIADDR -> UFS_NIADDR
   MAXSYMLINKLEN -> UFS_MAXSYMLINKLEN
   MAXSYMLINKLEN_UFS[12] -> UFS[12]_MAXSYMLINKLEN (for consistency)

Sort out ext2fs's misuse of NDADDR and NIADDR; fortunately, these have
the same values in ext2fs and ffs.

No functional change intended.
2013-01-22 09:39:11 +00:00
chs
d4d0b05e7a switch to __USE_TOPDOWN_VM. 2013-01-07 16:58:08 +00:00
alnsn
e4afd2bd10 Enable bpfjit on sparc. 2012-11-06 07:59:09 +00:00
alnsn
90781f7f62 Add sljitarch.h on sparc. 2012-11-05 23:08:59 +00:00
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
mrg
9d03b8ef4c add a comment to sp_tlb_flush() about fixing the asm() better. 2011-10-22 21:00:40 +00:00
jakllsch
1578aa6f33 Another copy/paste problem with a function name in a error printf. 2011-09-08 15:36:42 +00:00
jakllsch
d8c7d8f2e8 Correct copy/paste of function name in error printf. 2011-09-08 15:34:07 +00:00
martin
7716a7e464 In pmap_unwire() fix an obvious editor mishap - enable kernel preemption
before returning, not the other way around.
Might fix PR kern/45137.
2011-09-01 08:47:56 +00:00
martin
9a1b6b7c8b Minor nit: avoid kpreempt_disable() if cold (as we return early and do
not reenable it; actually makes no difference but looks more balanced
this way)
2011-09-01 08:43:24 +00:00
bouyer
a47e2eb758 Add getlabelusesmbr(), as proposed in
http://mail-index.netbsd.org/tech-userlevel/2011/08/25/msg005404.html
This is used by disk tools such as disklabel(8) to dynamically decide is
the undelyling platform uses a disklabel-in-mbr-partition or not
(instead of using a compile-time list of ports).
getlabelusesmbr() reads the sysctl kern.labelusesmbr, takes its value from the
machdep #define LABELUSESMBR.
For evbmips, make LABELUSESMBR 1 if the platform uses pmon
as bootloader, and 0 (the previous value) otherwise.
2011-08-30 12:39:49 +00:00
mrg
e3a2fad897 apply some always_inline attribute to setpsr and spl*. while i am
not yet sure exactly why this is necessary, but does avoid crashes
seen on sparc INSTALL with gcc 4.5.
2011-08-28 22:30:09 +00:00
mrg
a29cead266 fix sparc UP kernels with GCC 4.5, with special thanks to help from
mlelstv@ tracking down the real issue.

sp_tlb_flush() makes various assumptions about the ABI and what GCC
will do with the rest of this function.  the inputs were not referenced
by name but only as "%o0" etc inside the asm.  the result was that GCC
was not filling in the function parameters before calling it because
they were not used in the function.  so, sp_tlb_flush() was getting
random data for it's inputs.  oops.

for now, convert 2 asm() calls to pure C, and mark the inputs for
the sta calls.  this makes GCC generate the right code, but it still
isn't entirely optimal.

ideally a pure C version would exist, but that adds non-trivial
overhead (15 instructions vs 23 or so.)

one more enhancement to make here would be to assign the %o3, %o4 and
%o5 usage into explicit temp variables, instead of assuming that they
are going to be free to use.
2011-08-28 10:26:15 +00:00
mrg
02056ed4a4 emit some linker -Map files so that we can figure out what symbols
in the boot loaders are.
2011-08-28 08:03:49 +00:00
mrg
012f831146 normalise #if defined(MULTIPROCESSOR) usage. 2011-08-24 02:51:13 +00:00
mrg
a086f3a52c re-introduce the NULL savefpstate IPI checks and evcnts. something
is Wrong with GCC 4.5.3 and these trigger.  i haven't seen anything
else particularly wrong so for now this will allow sparc to switch
to GCC 4.5, which otherwise seems to be working very well for me.

sigh.  i'm going to file a PR to research what is really wrong here.
2011-08-15 02:19:44 +00:00
martin
95377927e5 Get rid of #ifdef __sparc__ in uvm code - as noted by cgd back 1996,
now that we have __HAVE_CPU_VMSPACE_EXEC/cpu_vmspace_exec().
2011-07-30 19:29:12 +00:00
jakllsch
bb558b2010 printf fixes for ifdef NETIF_DEBUG 2011-07-30 04:18:38 +00:00
dyoung
75ccda5a51 Don't set the iobase and iosize members of pcmciabus_attach_args because
they're not used in any meaningful way.
2011-07-26 22:52:47 +00:00
martin
4821d7c4b4 if _KERNEL is not defined, include <sys/stdarg.h> for va_list. For the
kernel (or modules) this is already done by systm.h.
2011-07-18 21:00:28 +00:00
mrg
142a02103b convert the remaining sparc drivers to CFATTACH_DECL_NEW/cfdata_t/device_t.
(cgsix_obio.c was only partially converted with the rest of the cgsix code
when it was changed some time ago.)
2011-07-18 00:31:13 +00:00
mrg
9c508f54bd convert to use device_t, cfdata_t and CFATTACH_DECL_NEW().
XXX: compile time tested only.
2011-07-18 00:05:35 +00:00
mrg
210f684c14 actually use CFATTACH_DECL_NEW() and device_private() for mspcic. 2011-07-17 23:34:17 +00:00
mrg
794d81a9dd convert all the "empty softc" (just "struct device") drivers to using
device_t/cfdata_t and CFATTACH_DECL_NEW().

the mspcic driver was also converted since it does not ever touch the
sc_dev it used to have in there.
2011-07-17 23:32:37 +00:00
dyoung
9c93e701a6 Switch sparc and sparc64 to new-style <sys/bus.h>. 2011-07-17 23:29:10 +00:00
mrg
ace9f0e4af convert all the sparc drivers that attach on my ss20 to use device_t,
cfdata_t and CFATTACH_DECL_NEW().

fd/fdc could use better testing, but i'm pretty sure i got it right.
2011-07-17 23:18:23 +00:00
joerg
3eb244d801 Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
2011-07-17 20:54:30 +00:00
nakayama
02b9edfe03 Bring some fixes and minor differences from sparc64 version. 2011-07-16 11:15:52 +00:00
riz
4cea3314df BLOCK_SIZE->SPARC64_BLOCK_SIZE
BLOCK_ALIGN->SPARC64_BLOCK_ALIGN

XXX these values are unused in sparc;  this is merely to keep the sparc
and sparc64 versions of psl.h in sync, and to allow sparc to build again.
2011-07-15 19:30:08 +00:00
matt
7555545545 Add defines for extu_frac[ln]m 2011-07-10 04:49:37 +00:00
mrg
6b8ed60e71 avoid array bounds violation and use fr_fp and fr_pc. 2011-07-09 15:02:49 +00:00
dyoung
db2ed62f16 Missed another one: #include <sys/bus.h> instead of <machine/bus.h>. 2011-07-06 20:47:05 +00:00
mrg
9cf7f1055f don't try to print fr_arg[6] since it doesn't exist. 2011-07-02 13:10:53 +00:00
dyoung
9aff02ebc1 #include <sys/bus.h> instead of <machine/bus.h>. 2011-07-01 20:57:45 +00:00
dyoung
cf10107d5d #include <sys/bus.h> instead of <machine/bus.h>. 2011-07-01 18:51:52 +00:00
dyoung
b6584574fc #include <sys/bus.h> instead of <machine/bus.h>. 2011-07-01 18:41:51 +00:00
dyoung
59adf08e17 Per discussion at
<http://mail-index.netbsd.org/tech-kern/2010/04/02/msg007941.html>,
divide each machine's bus.h into bus_defs.h (constants & data types)
and bus_funcs.h (macro implementations of bus_space(9) routines and MD
prototypes).

Note that some bus_space(9) routines' implementation will move to .c
files from inline subroutines or macros in .h files.

I've only made the split for machine architectures where there is PCI.
All of the non-PCI-having architectures will require a similar split.

These #include files are not referenced by any (committed) Makefiles or
header files, yet.  Changes to Makefiles, to <sys/bus.h>, and to some
more machine-dependent files will dribble in before I throw the switch.
2011-07-01 17:09:58 +00:00
wiz
4cbd24b23f dependant -> dependent 2011-06-30 20:09:15 +00:00
pgoyette
f80eb73fce Initialize sensor states before registering 2011-06-20 16:33:42 +00:00
nakayama
74bd9793c1 Add fast softint(9) support for sparc64.
Reviewed on port-sparc64.
2011-06-18 18:51:17 +00:00
mrg
2f0815a35d remove some debugging output no longer necessary. 2011-06-18 02:05:08 +00:00
rmind
e225b7bd09 Welcome to 5.99.53! Merge rmind-uvmplock branch:
- Reorganize locking in UVM and provide extra serialisation for pmap(9).
  New lock order: [vmpage-owner-lock] -> pmap-lock.

- Simplify locking in some pmap(9) modules by removing P->V locking.

- Use lock object on vmobjlock (and thus vnode_t::v_interlock) to share
  the locks amongst UVM objects where necessary (tmpfs, layerfs, unionfs).

- Rewrite and optimise x86 TLB shootdown code, make it simpler and cleaner.
  Add TLBSTATS option for x86 to collect statistics about TLB shootdowns.

- Unify /dev/mem et al in MI code and provide required locking (removes
  kernel-lock on some ports).  Also, avoid cache-aliasing issues.

Thanks to Andrew Doran and Joerg Sonnenberger, as their initial patches
formed the core changes of this branch.
2011-06-12 03:35:36 +00:00
mrg
475fbccd2d enable options MODULAR, now that it is tested to work. 2011-06-12 01:44:06 +00:00
mrg
87bf821974 sparc relative reloctions are busted here; copy the sparc64 style
which seems to make things work fine, and also seems to follow what
ld.elf_so does.

this makes modules work in my limited testing.
2011-06-12 01:29:58 +00:00
tsutsui
595cbc6ae0 Split device_t/softc of am7930. No crash on TME and GXemul. 2011-06-04 01:27:57 +00:00
rmind
3df4c27d37 Revert maxdmap/maxsmap constification, as it causes problems on some
sparc models.  Reported by tsutsui@.
2011-06-03 17:58:18 +00:00
tsutsui
c22ffc3803 Split device_t/softc of i82586. No crash on TME emulating sun2. 2011-06-03 16:28:40 +00:00
tsutsui
b0ab296baa Remove unused header. 2011-06-01 11:43:56 +00:00
tsutsui
f6d97a4891 - remove extern from function declarations
- some KNF
2011-06-01 11:43:12 +00:00
tsutsui
c7d8407eea Fix harmless merge botch. 2011-06-01 11:42:18 +00:00
joerg
a2bf8e5d19 Introduce DDB_EXPR_FMT and replace the logic around DB_EXPR_T_IS_QUAD. 2011-05-26 15:34:12 +00:00
rmind
9db0d4e385 nmi_hard: convert nmi_hard_wait to use atomics.
OK mrg@
2011-05-23 18:40:30 +00:00
nakayama
3bf0795076 Fix debug build. 2011-05-21 16:32:00 +00:00
tsutsui
c95f237aba WARNSfy and fix dumb bugs noticed by warnings. 2011-05-21 15:50:42 +00:00
christos
fa20324c60 more missing includes 2011-05-21 15:10:34 +00:00
nakayama
88e42b609b Add fenv support for sparc. Mostly copied from sparc64 and share with it. 2011-05-20 21:42:48 +00:00
he
4f951ec855 Put the external functions from net.c in it's own header file and
include it, and do some other minimal adjustments to bring this
back to a buildable state.

OK'ed by martin@
2011-05-20 14:49:54 +00:00
hauke
f6d6cbb748 Fix a tyop.
The intentions were good...
2011-05-19 15:18:29 +00:00
christos
fa6990dd18 handle prototype for freeall 2011-05-19 03:09:47 +00:00
dyoung
a6b2b8396b PCI_FLAGS_IO_ENABLED and PCI_FLAGS_MEM_ENABLED changed their functional
role in NetBSD (drivers are no longer supposed to write these to
pa_flags) without changing name.  Correct that.

Rename PCI_FLAGS_IO_ENABLED to PCI_FLAGS_IO_OKAY and
PCI_FLAGS_MEM_ENABLED to PCI_FLAGS_MEM_OKAY, thus making their names
consistent with the other PCI flags and poisoning 3rd-party driver
sources that use the flags in the old bad way.

This patch produces no binary changes in this set of PCI kernels when
they are compiled w/o 'options DIAGNOSTIC' and w/ -V MKREPRO=yes:

algor P4032 P5064 P6032
alpha GENERIC
amd64 GENERIC XEN3_DOM0
arc GENERIC
atari HADES MILAN-PCIIDE
bebox GENERIC
cats GENERIC
cobalt GENERIC
evbarm-el ADI_BRH ARMADILLO9 CP3100 GEMINI GEMINI_MASTER GEMINI_SLAVE
evbarm-el GUMSTIX HDL_G IMX31LITE INTEGRATOR IQ31244 IQ80310 IQ80321
evbarm-el IXDP425 IXM1200 KUROBOX_PRO
evbarm-el LUBBOCK MARVELL_NAS NAPPI NSLU2 SHEEVAPLUG SMDK2800 TEAMASA_NPWR
evbarm-el TEAMASA_NPWR_FC TS7200 TWINTAIL ZAO425
evbmips-el AP30 DBAU1500 DBAU1550 MALTA MERAKI MTX-1 OMSAL400 RB153 WGT624V3
evbmips64-el XLSATX
evbppc EV64260 MPC8536DS MPC8548CDS OPENBLOCKS200 OPENBLOCKS266
evbppc OPENBLOCKS266_OPT P2020RDB PMPPC RB800 WALNUT
hp700 GENERIC
i386 ALL XEN3_DOM0 XEN3_DOMU
ibmnws GENERIC
iyonix GENERIC
landisk GENERIC
macppc GENERIC
mvmeppc GENERIC
netwinder GENERIC
ofppc GENERIC
prep GENERIC
sandpoint GENERIC
sbmips-el GENERIC
sgimips GENERIC32_IP2x GENERIC32_IP3x
sparc GENERIC_SUN4U KRUPS
sparc64 GENERIC
2011-05-17 17:34:47 +00:00
rmind
cf52754dce Hack-around sparc/sun4c case, which modifies const maxdmap/maxsmap.
From he@.  OK mrg@.
2011-05-16 18:08:04 +00:00
rmind
2626d57668 Rename ttymalloc() to tty_alloc(), and ttyfree() to tty_free() for
consistency.  Remove some unnecessary malloc.h inclusions as well.
2011-04-24 16:26:51 +00:00
tron
8a13bd182a Don't define "fenv_t" and "fexcept_t" for NetBSD/sparc64 because the
definitions clash with "/usr/include/sparc64/fenv.h".

This fixes the build of e.g. "pkgsrc/databases/mysql51-client" under
NetBSD/sparc64 current.
2011-04-24 11:32:36 +00:00
rmind
7e2ef7ad8f Replace malloc with kmem, and remove M_SUBPROC. 2011-04-18 00:26:11 +00:00
mrg
0c3d43f80c port to userspace. 2011-04-14 08:59:09 +00:00
macallan
dfdc4959f7 use the same function whenever we change colour depth
also, when opening the fb device switch to 32bit and back to 8 on close, not
the other way around
2011-04-13 23:31:25 +00:00
mrg
95134ba1e2 make sparc/frame.h idempotent. 2011-04-12 07:54:16 +00:00
mrg
07a98cd33f obsolete DB_AOUT_SYMBOLS. however, we need to leave most of the code
in db_sym.[ch] as it is used by the elf version of crash(8).

i will be cleaning up the db_sym.c code in a follow up commit to avoid
having dead code compiled.
2011-04-11 04:22:30 +00:00
dyoung
d3e53912d2 Neither pci_dma64_available(), pci_probe_device(), pci_mapreg_map(9),
pci_find_rom(), pci_intr_map(9), pci_enumerate_bus(), nor the match
predicate passed to pciide_compat_intr_establish() should ever modify
their pci_attach_args argument, so make their pci_attach_args arguments
const and deal with the fallout throughout the kernel.

For the most part, these changes add a 'const' where there was no
'const' before, however, some drivers and MD code used to modify
pci_attach_args.  Now those drivers either copy their pci_attach_args
and modify the copy, or refrain from modifying pci_attach_args:

Xen: according to Manuel Bouyer, writing to pci_attach_args in
    pci_intr_map() was a leftover from Xen 2.  Probably a bug.  I
    stopped writing it.  I have not tested this change.

siside(4): sis_hostbr_match() needlessly wrote to pci_attach_args.
    Probably a bug.  I use a temporary variable.  I have not tested this
    change.

slide(4): sl82c105_chip_map() overwrote the caller's pci_attach_args.
    Probably a bug.  Use a local pci_attach_args.  I have not tested
    this change.

viaide(4): via_sata_chip_map() and via_sata_chip_map_new() overwrote the
    caller's pci_attach_args.  Probably a bug.  Make a local copy of the
    caller's pci_attach_args and modify the copy.  I have not tested
    this change.

While I'm here, make pci_mapreg_submap() static.

With these changes in place, I have tested the compilation of these
kernels:

alpha GENERIC
amd64 GENERIC XEN3_DOM0
arc GENERIC
atari HADES MILAN-PCIIDE
bebox GENERIC
cats GENERIC
cobalt GENERIC
evbarm-eb NSLU2
evbarm-el ADI_BRH ARMADILLO9 CP3100 GEMINI GEMINI_MASTER GEMINI_SLAVE GUMSTIX
	HDL_G IMX31LITE INTEGRATOR IQ31244 IQ80310 IQ80321 IXDP425 IXM1200
	KUROBOX_PRO LUBBOCK MARVELL_NAS NAPPI SHEEVAPLUG SMDK2800 TEAMASA_NPWR
	TEAMASA_NPWR_FC TS7200 TWINTAIL ZAO425
evbmips-el AP30 DBAU1500 DBAU1550 MALTA MERAKI MTX-1 OMSAL400 RB153 WGT624V3
evbmips64-el XLSATX
evbppc EV64260 MPC8536DS MPC8548CDS OPENBLOCKS200 OPENBLOCKS266
	OPENBLOCKS266_OPT P2020RDB PMPPC RB800 WALNUT
hp700 GENERIC
i386 ALL XEN3_DOM0 XEN3_DOMU
ibmnws GENERIC
macppc GENERIC
mvmeppc GENERIC
netwinder GENERIC
ofppc GENERIC
prep GENERIC
sandpoint GENERIC
sgimips GENERIC32_IP2x
sparc GENERIC_SUN4U KRUPS
sparc64 GENERIC

As of Sun Apr 3 15:26:26 CDT 2011, I could not compile these kernels
with or without my patches in place:

### evbmips-el GDIUM

nbmake: nbmake: don't know how to make /home/dyoung/pristine-nbsd/src/sys/arch/mips/mips/softintr.c. Stop

### evbarm-el MPCSA_GENERIC
src/sys/arch/evbarm/conf/MPCSA_GENERIC:318: ds1672rtc*: unknown device `ds1672rtc'

### ia64 GENERIC

/tmp/genassym.28085/assym.c: In function 'f111':
/tmp/genassym.28085/assym.c:67: error: invalid application of 'sizeof' to incomplete type 'struct pcb'
/tmp/genassym.28085/assym.c:76: error: dereferencing pointer to incomplete type

### sgimips GENERIC32_IP3x

crmfb.o: In function `crmfb_attach':
crmfb.c:(.text+0x2304): undefined reference to `ddc_read_edid'
crmfb.c:(.text+0x2304): relocation truncated to fit: R_MIPS_26 against `ddc_read_edid'
crmfb.c:(.text+0x234c): undefined reference to `edid_parse'
crmfb.c:(.text+0x234c): relocation truncated to fit: R_MIPS_26 against `edid_parse'
crmfb.c:(.text+0x2354): undefined reference to `edid_print'
crmfb.c:(.text+0x2354): relocation truncated to fit: R_MIPS_26 against `edid_print'
2011-04-04 20:37:49 +00:00
dyoung
8d4a897025 Fix target 'tags'. 2011-04-04 19:41:24 +00:00
martin
112d7f90bb Enable TLS on sparc and sparc64 2011-03-30 09:23:26 +00:00
martin
22699d7467 On second thought do not use bit 13 as a flag for syscall numbers, userland
typically sets those from a 13bit signed integer immediate field in the
instruction, so would need to jump through hoops (ok, small hoops) to
avoid sign extension.
Use a combination of the existing syscall flags instead.
2011-03-27 18:47:08 +00:00
martin
712e3a3618 Add a syscall variant passing the return address in %g5 (we need %g7 for
pthread_self and %g2 is an application register, so we can not use those
anymore).
2011-03-23 20:41:30 +00:00
bouyer
063f96f3c2 merge the bouyer-quota2 branch. This adds a new on-disk format
to store disk quota usage and limits, integrated with ffs
metadata. Usage is checked by fsck_ffs (no more quotacheck)
and is covered by the WAPBL journal. Enabled with kernel
option QUOTA2 (added where QUOTA was enabled in kernel config files),
turned on with tunefs(8) on a per-filesystem
basis. mount_mfs(8) can also turn quotas on.

See http://mail-index.netbsd.org/tech-kern/2011/02/19/msg010025.html
for details.
2011-03-06 17:08:10 +00:00
joerg
48717cfc00 Refactor ps_strings access. Based on PK_32, write either the normal
version or the 32bit compat layout in execve1. Introduce a new function
copyin_psstrings for reading it back from userland and converting it to
the native layout. Refactor procfs to share most of the code with the
kern.proc_args sysctl handler.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.
2011-03-04 22:25:24 +00:00
joerg
13b2e74237 Be nicer to software that insists on -ansi and use __inline. 2011-02-25 14:07:12 +00:00
joerg
1631a78097 Allow storing and receiving the LWP private pointer via ucontext_t
on all platforms except VAX and IA64. Add fast access via register for
AMD64, i386 and SH3 ports. Use this fast access in libpthread to replace
the stack based pthread_self(). Implement skeleton support for Alpha,
HPPA, PowerPC, SPARC and SPARC64, but leave it disabled.

Ports that support this feature provide __HAVE____LWP_GETPRIVATE_FAST in
machine/types.h and a corresponding __lwp_getprivate_fast in
machine/mcontext.h.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.
2011-02-24 04:28:41 +00:00
mrg
9bfacb7551 add some #if 0'ed code to turn the xcall() timeout into a hard panic.
probably put this under DIAGNOSTIC when it is later properly working.
2011-02-20 11:41:20 +00:00
mrg
2f5556f9d6 remove an unused "1:" label left over from previous commit. 2011-02-20 10:26:26 +00:00