Commit Graph

1892 Commits

Author SHA1 Message Date
wiz d20841bb64 Uppercase CPU, plural is CPUs. 2004-02-13 11:36:08 +00:00
wiz f582138c1b Uppercase CPU. 2004-02-13 10:11:56 +00:00
matt 82ad975738 Add #define cpu_lwp_free do { } while (/*CONSTCOND*/0)
(VAX systems don't need to do anything in cpu_lwp_free)
2004-01-22 01:24:10 +00:00
kleink 15afe0b4fc Move FP_ROP and FP_DIRTYZERO from <math.h> to <vax/math.h> (where they
would have ended up if I hadn't missed the latter file in the commit).
2004-01-20 19:52:40 +00:00
matt 85d908affc Add multiple protection inclusion.
s/u_int/unsigned int/
Fix typo.
2004-01-20 19:09:27 +00:00
matt ecdec9d579 Add proper boot/autoconf support for SDN devices. Take from Hugh Graham;
see http://mail-index.netbsd.org/port-vax/2002/06/28/0005.html
2004-01-06 17:01:48 +00:00
wiz a5bf3b3c4c Spell controller with two ls. Inspired by miod@openbsd. 2004-01-04 16:19:43 +00:00
jdolecek 089abdad44 Rearrange process exit path to avoid need to free resources from different
process context ('reaper').

From within the exiting process context:
* deactivate pmap and free vmspace while we can still block
* introduce MD cpu_lwp_free() - this cleans all MD-specific context (such
  as FPU state), and is the last potentially blocking operation;
  all of cpu_wait(), and most of cpu_exit(), is now folded into cpu_lwp_free()
* process is now immediatelly marked as zombie and made available for pickup
  by parent; the remaining last lwp continues the exit as fully detached
* MI (rather than MD) code bumps uvmexp.swtch, cpu_exit() is now same
  for both 'process' and 'lwp' exit

uvm_lwp_exit() is modified to never block; the u-area memory is now
always just linked to the list of available u-areas. Introduce (blocking)
uvm_uarea_drain(), which is called to release the excessive u-area memory;
this is called by parent within wait4(), or by pagedaemon on memory shortage.
uvm_uarea_free() is now private function within uvm_glue.c.

MD process/lwp exit code now always calls lwp_exit2() immediatelly after
switching away from the exiting lwp.

g/c now unneeded routines and variables, including the reaper kernel thread
2004-01-04 11:33:29 +00:00
cl e7045955c7 kernel part of no-syscall upcall stack return: libpthread registers
an offset between ss_sp and struct sa_stackinfo_t (located in struct
__pthread_st) when calling sa_register.  The kernel increments the
sast_gen counter in struct sastack when an upcall stack is used.
libpthread increments the sasi_stackgen counter in struct
sa_stackinfo_t when an upcall stack is freed.  The kernel compares the
two counters to decide if a stack is free or in use.

- add struct sa_stackinfo_t with sasi_stackgen to count stack use in
  userland
- add sast_gen to struct sastack to count stack use in kernel
- add SA_FLAG_STACKINFO to enable the stackinfo_offset argument in the
  sa_register syscall
- add sa_stackinfo_offset to struct sadata for offset between ss_sp
  and struct sa_stackinfo_t
- add ssize_t stackinfo_offset argument to sa_register, initialize
  struct sadata's sa_stackinfo_offset from it if SA_FLAG_STACKINFO is
  set
- add sa_getstack, sa_getstack0, sa_stackused and sa_setstackfree
  functions to find/use/free upcall stacks and use these where
  appropriate
- don't record stack for upcall in sa_upcall0
- pass sau to sa_switchcall instead of l2 (l2 = curlwp in sa_switchcall)
- add sa_vp_blocker to struct sadata to pass recently blocked lwp to
  sa_switchcall
- delay finding a stack for blocked upcalls to sa_switchcall
- add sa_stacknext to struct sadata pointing to next most likely free
  upcall stack; also g/c sa_stackslist in struct sadata and sast_list
  in struct sastack
- add L_SA_WOKEN flag: LWP is on sa_woken queue
- add L_SA_RECYCLE flag: LWP should be recycled in sa_setwoken
- replace l_upcallstack with L_SA_WOKEN/L_SA_RECYCLE/L_SA_BLOCKING
  flags
- g/c now unused sast_blocker in struct sastack
- make sa_switchcall, sa_upcall0 and sa_upcall_getstate static in
  kern_sa.c
- call sa_upcall_userret only once in userret
- split sa_makeupcalls out of sa_upcall_userret and use to process
  the sa_upcalls queue
- on process exit: mark LWPs sleeping in saunblock interruptible; also
  there are no LWPs sleeping on l->l_upcallstack anymore; also clear
  sa_wokenq_head to prevent unblocked upcalls

additional changes:
- cleanup timerupcall sa_vp == curlwp check
- add check in sa_yield if we didn't block on our way here and we
  wouldn't any longer be the LWP on the VP
- invalidate sa_vp_ofaultaddr after resolving pagefault
2004-01-02 18:52:17 +00:00
pk 70f20a1217 Replace the traditional buffer memory management -- based on fixed per buffer
virtual memory reservation and a private pool of memory pages -- by a scheme
based on memory pools.

This allows better utilization of memory because buffers can now be allocated
with a granularity finer than the system's native page size (useful for
filesystems with e.g. 1k or 2k fragment sizes).  It also avoids fragmentation
of virtual to physical memory mappings (due to the former fixed virtual
address reservation) resulting in better utilization of MMU resources on some
platforms.  Finally, the scheme is more flexible by allowing run-time decisions
on the amount of memory to be used for buffers.

On the other hand, the effectiveness of the LRU queue for buffer recycling
may be somewhat reduced compared to the traditional method since, due to the
nature of the pool based memory allocation, the actual least recently used
buffer may release its memory to a pool different from the one needed by a
newly allocated buffer. However, this effect will kick in only if the
system is under memory pressure.
2003-12-30 12:33:13 +00:00
pk 20ad8911d9 hpfinish: pass correct buffer to diskerr(); 2003-12-29 16:23:58 +00:00
ragge 57fa6bb861 TOPDOWN_VM is now mandatory on vax. 2003-12-14 19:39:24 +00:00
ad 3234027240 Add write barriers (a no-op on vax). 2003-12-13 23:02:33 +00:00
matt 0ecc4c35b5 Copy ksi->ksi_info, not all of ksi, to user stack. 2003-12-11 18:33:52 +00:00
matt 786b602bd3 Rework things to move common stuff into Makefile.inc. 2003-12-11 17:34:09 +00:00
simonb fa8e22ca2d Make unimpl_emul.o depend on assym.h so that "make -j N" kernel builds
work.
2003-12-10 04:59:35 +00:00
jmc 695a2a2f9f Change reference at bottom from sys/dev/majors to sys/conf/majors to match
reality
2003-12-10 02:04:00 +00:00
matt 031990a547 Make sure to include <bsd.own.mk> to pick up the definition of HAVE_GCC3 2003-12-09 04:54:54 +00:00
matt 48b7ea2255 Strings (even ifdef'ed out) can't run past the end of the line. Use
ANSI string concatenation.
2003-12-08 09:29:30 +00:00
matt 840a2d6df7 Make -mno-asm-pic dependend on HAVE_GCC3 == no 2003-12-08 09:28:36 +00:00
matt 52f58bd42a Suppress a gcc3 type-punning warning. 2003-12-08 07:33:12 +00:00
matt 31ba84cb6a Move common CFLAGS/AFLAGS to Makefile.inc.
For now, only suppy -mno-asm-pic when not using gcc3.
2003-12-08 07:32:19 +00:00
atatat 13f8d2ce5f Dynamic sysctl.
Gone are the old kern_sysctl(), cpu_sysctl(), hw_sysctl(),
vfs_sysctl(), etc, routines, along with sysctl_int() et al.  Now all
nodes are registered with the tree, and nodes can be added (or
removed) easily, and I/O to and from the tree is handled generically.

Since the nodes are registered with the tree, the mapping from name to
number (and back again) can now be discovered, instead of having to be
hard coded.  Adding new nodes to the tree is likewise much simpler --
the new infrastructure handles almost all the work for simple types,
and just about anything else can be done with a small helper function.

All existing nodes are where they were before (numerically speaking),
so all existing consumers of sysctl information should notice no
difference.

PS - I'm sorry, but there's a distinct lack of documentation at the
moment.  I'm working on sysctl(3/8/9) right now, and I promise to
watch out for buses.
2003-12-04 19:38:21 +00:00
ragge 86f405ed49 Bugfixes for emulated instructions MOVTC and MOVTUC, from Bertram Barth:
> - condition-codes should be set from (unmodified) srclen vs. dstlen
>   instead from the modified (register-) values after completion.
>
> - for MOVTUC the V-bit should be set if the esc-char was found.
>
> - the arguments for comparison should be reversed.
>
> - count is unsigned word, but for condition-codes the comparison
>   should be done with signed words (ie. N = srclen LSS dstlen)
2003-11-30 10:02:21 +00:00
jhawk e7d0c2b26a Manually moved from Attic/ in the repository since cvs failed to do so. 2003-11-28 23:57:49 +00:00
wiz 4bbfee09ca Various typo fixes from Jonathon Gray via jmc@openbsd. 2003-11-17 11:16:10 +00:00
wiz ee1b406595 Spell address with two d's. Inspired by similar changes in OpenBSD,
originating from Jonathon Gray and forwarded by jmc@openbsd.
2003-11-10 08:51:51 +00:00
he 69c90d9f70 Initialize 'p' to NULL, to work around that the compiler otherwise
can't know that 'p' is initialized before it's being used.

Reviewed by ragge.
2003-11-06 00:35:23 +00:00
he 4a1426d85c Pull up the initialization of 'minnex', so that the compiler can know
that it's going to be set before it's used.
2003-11-06 00:33:36 +00:00
he 11f834a44a Add a default: branch with a panic() to the switch statement to
handle "impossible" segment types, so that the compiler can know
that 'pt' has been initialized after the switch statement.
2003-11-06 00:32:27 +00:00
he 93d88e5e12 Work around gcc 2.95.3's inability to detect that 'ck' will be set
in rounds 129 and 130 through the loop.  Will be noted in doc/HACKS,
and should be reviewed when gcc 3.3.2 is ready for vax.
2003-11-06 00:30:13 +00:00
jdolecek f96eb7635f yield to the strchr() prototype from libkern.h 2003-11-04 14:04:04 +00:00
jdolecek d944bca949 rename local index() to strchr() 2003-11-01 13:02:04 +00:00
cl b936d40f39 Avoid sneaking past signal delivery in sa_upcall_userret():
generate unblocked upcalls in sa_unblock_userret(), before signal
delivery/p_userret handling in userret().

Also defer getting state for preempted upcalls because on some ports
preemption can happen between sa_unblock_userret() and sa_upcall_userret().
2003-11-01 01:38:46 +00:00
simonb 6d85c5e0d5 Don't pass the (unused) return value args to the
trace_enter()/systrace_enter() functions.
2003-10-31 03:28:12 +00:00
kleink fed901e1cd s/sgn/sign/, for consistency with IEEE headers. 2003-10-30 12:05:41 +00:00
kleink 8b8e22cb01 Enter vaxfp.h, the VAX pendant of <machine/ieee.h>. 2003-10-27 21:52:03 +00:00
lukem f85d2d1c14 Use ${HOST_SH} instead of `sh'.
If necessary, pull in <bsd.sys.mk> to get the definition of HOST_SH;
Makefiles that pull in one of (most of) <bsd.*.mk> will get this anyway.
2003-10-26 07:25:33 +00:00
kleink 793c50136c C99 7.12#4: provide INFINITY, which defaults to HUGE_VALF.
If infinities are not available, the machine-dependent header must define
__INFINITY as a positive constant of type float that overflows.
2003-10-26 00:02:02 +00:00
matt 69d23a06d1 Add a dummy fpset for gdb. 2003-10-25 19:05:39 +00:00
jdolecek 694c204404 add major for 'ses' for archs which have the other scsi devices 2003-10-24 08:09:53 +00:00
kleink 7caede41fb Oops, s/DECIMAL_DIGIT/DECIMAL_DIG/. 2003-10-23 23:16:50 +00:00
kleink c9432c8396 C99: provide DECIMAL_DIGIT. 2003-10-22 21:28:08 +00:00
jdolecek ee510816af add wsfont major to archs which have the other wscons devices 2003-10-22 16:53:22 +00:00
kleink 5a44ed37d3 C99: provide FLT_EVAL_METHOD. 2003-10-22 16:18:48 +00:00
ragge 90f561b5ff Add lcspx console device driver. 2003-10-19 15:03:25 +00:00
ragge a893520c07 Add console text device driver for the LCSPX framebuffer. Really dump,
cannot change colours, and is really slow; I haven't found how to buffer
writes to the console yet.
2003-10-19 15:02:17 +00:00
ragge 9fb208fc0a Avoid the pvtable when devices are mapped. Fixes panics when unmapping
framebuffers.  Set aside space in kernel map for framebuffer on VS4k.
2003-10-19 14:58:22 +00:00
ragge 836c5d5ec4 Allow mmap() of /dev/mem. 2003-10-19 14:56:28 +00:00
ragge 89d60ed8ea Fetch SCSI controller ID from nvram for VS4k90 also. 2003-10-19 14:54:24 +00:00
ragge c862115a9d Use the vax confdata to determine whether to use serial console.
Do cn_set_magic() for the VAX DDB escape sequence (ESC-D).
2003-10-18 12:09:18 +00:00
ragge 7b77aca6ae Do not try to fetch the current proc if curlwp == NULL. This caused
DDB to fail if no process were running.
2003-10-18 12:07:44 +00:00
ragge f545d1a885 Read out confdata for the VS4000/90 also. 2003-10-18 12:06:11 +00:00
jdolecek ef5bb330f5 reassing majors for crypto and pf to use the newly defined MI major
range
2003-10-10 22:42:39 +00:00
jdolecek 4e915c9ccd update the comment - the space for machine-dependant majors
is reduced to 0-143
follows discussion on tech-kern
2003-10-10 21:21:25 +00:00
thorpej 901da40cf9 Add some accessor macros for the ucontext:
* _UC_MACHINE_PC() - access the program counter
* _UC_MACHINE_INTRV() - access the integer return value register
* _UC_MACHINE_SET_PC() - set the program counter (this requires
  special handling on some platforms).
2003-10-08 22:43:01 +00:00
thorpej 68723a995b * Shuffle some data structures so, and add a flags word to ksiginfo_t.
Right now the only flag is used to indicate if a ksiginfo_t is a
  result of a trap.  Add a predicate macro to test for this flag.
* Add initialization macros for ksiginfo_t's.
* Add accssor macro for ksi_trap.  Expands to 0 if the ksiginfo_t was
  not the result of a trap.  This matches the sigcontext trapcode semantics.
* In kpsendsig(), use KSI_TRAP_P() to select the lwp that gets the signal.
  Inspired by Matthias Drochner's fix to kpsendsig(), but correctly handles
  the case of non-trap-generated signals that have a > 0 si_code.

This patch fixes a signal delivery problem with threaded programs noted by
Matthias Drochner on tech-kern.

As discussed on tech-kern.  Reviewed and OK's by Christos.
2003-10-08 00:28:40 +00:00
ragge 4728b0483f The last commit broke the boot code (memset may be larger than 64k).
Johnny Billquist fixed it and bugfixed some routines.
2003-10-07 12:01:27 +00:00
jdolecek e6286b949a Add some framework for MI assignment of device majors - add sys/dev/majors
which is automatically included during kernel config, and add comments
to individual machine-dependant majors.* files to assign new MI majors
in MI file.

Range 0-191 is reserved for machine-specific assignments, range
192+ are MI assignments.

Follows recent discussion on tech-kern@
2003-10-05 08:04:24 +00:00
matt 86b06b2e50 Rearrange and with COMPAT_* properly 2003-09-30 21:45:09 +00:00
matt de203a6459 Fix GCC3'ism's 2003-09-29 22:54:28 +00:00
matt 2298bf0a7a trap.c: Set ksi.ksi_trap to frame->trap.
sig_machdep.c:	Use ksi->ksi_addr in compat code to supply the
		'code' argument to the old signal routines.
2003-09-29 22:24:53 +00:00
matt ec1689548e Set ksi_addr to frame->code. 2003-09-29 22:20:52 +00:00
matt 050d126a03 Add SA_SIGINFO support for VAX. 2003-09-29 21:04:53 +00:00
nathanw 4d59420344 Move __cpu_simple_lock_t and __SIMPLELOCK_{UN,}LOCKED to machine/types.h
so that they can be used in a namespace-friendly way.
2003-09-26 22:45:41 +00:00
simonb 550b4bef88 Fix "constify sendsig/trapsignal" fallout for non-siginfo'd archs. Test
compiled on most architectures.
2003-09-26 12:02:55 +00:00
cl 0882aaed34 add MD part of SA/pthread pagefault handling on vax 2003-09-18 22:38:36 +00:00
ragge 3fc53f17c5 Remove ; after setrunqueue/remrunqueue macro. 2003-09-18 18:38:48 +00:00
itojun fc918f8713 add rnd(4) device to installation media.
necessary for many purposes, including password seeding, tcp sequence number,
and more.  see tech-security
2003-09-06 03:25:23 +00:00
dsl fe89b1db32 Add memcmp, memcpy and memset
Fix strncmp(x, y, 0)
Use unsigned compares for strcmp and memcmp (and bcmp).
Compiles but untested
AFAICT http://h71000.www7.hp.com/doc/72final/4515/4515pro_025.html#4515ch9_146
cmpc3/5 set %r4 and %r5 to zero, It doesn't look as though the procedure
call is set to preserve these, and I doubt that gcc is treating them as
scratch registers - does our vax pcs actually have %r2 and %r3 as scratch regs?
2003-09-04 10:40:44 +00:00
ragge 23faa91baa Understand qt as root device. 2003-08-29 13:52:45 +00:00
ragge c55ba2df08 Add the qt driver to GENERIC. 2003-08-29 13:51:47 +00:00
itojun 4440262659 create /dev/crypto 2003-08-22 05:06:22 +00:00
ragge 923106363e Some of the vax-specific mem*() functions did not check for len > 65535,
and when MAXDSIZ were increased memcpy() length sometimes were larger
than 64k (like in amap_extend()) All functions now checks the length.
This fixes PR#19968.

Disable the inline string functions and use the C versions instead.
2003-08-13 11:30:50 +00:00
agc aad01611e7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22364, verified by myself.
2003-08-07 16:26:28 +00:00
itojun 3f14c71f75 reserve cdev major # for PF. ok'ed by technical-exec 2003-07-27 14:17:57 +00:00
thorpej 063033a023 Since everyone uses clock_subr.c (or should, if they don't currently),
list it in conf/files instead of in every port's files.*.
2003-07-27 01:17:37 +00:00
lukem 3b4fb6d0ef __KERNEL_RCSID() 2003-07-15 02:15:00 +00:00
lukem 001c68bd94 Rename a large chunk of the make(1) variables which refer to a
program/tool from "FOO" to "TOOL_FOO".  The new variables are:
	TOOL_ASN1_COMPILE  TOOL_CAP_MKDB  TOOL_CAT  TOOL_CKSUM  TOOL_COMPILE_ET
	TOOL_CONFIG  TOOL_CRUNCHGEN  TOOL_CTAGS  TOOL_DB  TOOL_EQN  TOOL_FGEN
	TOOL_GENCAT  TOOL_GROFF  TOOL_HEXDUMP  TOOL_INDXBIB  TOOL_INSTALLBOOT
	TOOL_INSTALL_INFO  TOOL_M4  TOOL_MAKEFS  TOOL_MAKEINFO  TOOL_MAKEWHATIS
	TOOL_MDSETIMAGE  TOOL_MENUC  TOOL_MKCSMAPPER  TOOL_MKESDB
	TOOL_MKLOCALE  TOOL_MKMAGIC  TOOL_MKTEMP  TOOL_MSGC  TOOL_MTREE
	TOOL_PAX  TOOL_PIC  TOOL_PREPMKBOOTIMAGE  TOOL_PWD_MKDB  TOOL_REFER
	TOOL_ROFF_ASCII  TOOL_ROFF_DVI  TOOL_ROFF_HTML  TOOL_ROFF_PS
	TOOL_ROFF_RAW  TOOL_RPCGEN  TOOL_SOELIM  TOOL_SUNLABEL  TOOL_TBL
	TOOL_UUDECODE  TOOL_VGRIND  TOOL_ZIC

For each, provide default in <bsd.sys.mk> of the form:
	TOOL_FOO?=	foo
and for the ${USETOOLS}=="yes" case in <bsd.own.mk>, provide override:
	TOOL_FOO=	${TOOLDIR}/bin/${_TOOL_PREFIX}foo

Document all of these in bsd.README.

This cleans up a chunk of potential (and actual) namespace collision
within our build infrastructure, as well as improves consistency in
the share/mk documentation and provision of appropriate defaults for
each of these variables.
2003-07-10 10:33:58 +00:00
fvdl d5aece61d6 Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
2003-06-29 22:28:00 +00:00
darrenr 960df3c8d1 Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
2003-06-28 14:20:43 +00:00
he f250a35e96 #ifdef _KERNEL_OPT police; identd defines _KERNEL before some includes. 2003-06-26 13:20:55 +00:00
martin d505b18964 Make sure to include opt_foo.h if a defflag option FOO is used. 2003-06-23 11:00:59 +00:00
drochner 1a03e79900 don't #include <sys/dkstat.h> where it is (appearently) unused 2003-06-18 08:58:34 +00:00
thorpej 452a8fdae2 Rename IPL_IMP -> IPL_VM. 2003-06-16 20:00:56 +00:00
fvdl 7dd7f8baa2 Handle 64bit DMA addresses on PCI for platforms that can (currently only
enabled on amd64). Add a dmat64 field to various PCI attach structures,
and pass it down where needed. Implement a simple new function called
pci_dma64_available(pa) to test if 64bit DMA addresses may be used.
This returns 1 iff _PCI_HAVE_DMA64 is defined in <machine/pci_machdep.h>,
and there is more than 4G of memory.
2003-06-15 23:08:53 +00:00
thorpej f4ca0d67fe Include <sys/disk.h>. 2003-05-12 14:48:12 +00:00
thorpej e43fecb228 Change bounds_check_with_label() to take a pointer to the disk structure,
rather than the label itself.  This paves the way for some future changes.
2003-05-10 23:12:28 +00:00
thorpej 36da248c07 Back out the following chagne:
http://mail-index.netbsd.org/source-changes/2003/05/08/0068.html

There were some side-effects that I didn't anticipate, and fixing them
is proving to be more difficult than I thought, do just eject for now.
Maybe one day we can look at this again.

Fixes PR kern/21517.
2003-05-10 21:10:23 +00:00
thorpej b77900c3c2 Simplify the way the bounds of the managed kernel virtual address
space is advertised to UVM by making virtual_avail and virtual_end
first-class exported variables by UVM.  Machine-dependent code is
responsible for initializing them before main() is called.  Anything
that steals KVA must adjust these variables accordingly.

This reduces the number of instances of this info from 3 to 1, and
simplifies the pmap(9) interface by removing the pmap_virtual_space()
function call, and removing two arguments from pmap_steal_memory().

This also eliminates some kludges such as having to burn kernel_map
entries on space used by the kernel and stolen KVA.

This also eliminates use of VM_{MIN,MAX}_KERNEL_ADDRESS from MI code,
this giving MD code greater flexibility over the bounds of the managed
kernel virtual address space if a given port's specific platforms can
vary in this regard (this is especially true of the evb* ports).
2003-05-08 18:13:12 +00:00
wiz 1ffa7b76c4 DMA, not dma nor Dma. 2003-05-03 18:10:37 +00:00
dsl d91455ce26 Change return type of readdisklabel() to const char *
I hope I've found all the correct places!
2003-05-02 08:45:10 +00:00
scw 8c5c893bf7 Add a BKPT_ADDR() macro which gives MD code a chance to munge a
breakpoint address before it's used. Currently a no-op on all but sh5.

This is useful on sh5, for example, to mask off the instruction
type encoding in the bottom two address bits, and makes it possible
to do "db> break $rXX" instead of manually munging the address.
2003-04-29 17:06:03 +00:00
bjh21 4be7a2dcf3 Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
  can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
  various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
  !defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them.  In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.
2003-04-28 23:16:11 +00:00
ragge d8c8fa8111 Add pseudo-device ksyms. 2003-04-26 14:10:04 +00:00
ragge 69a66687f8 Call ksyms_init() instead of ddb_init() in case of
NKSYMS || defined(DDB) || defined(LKM)
2003-04-26 11:05:05 +00:00
ragge 766d04f56a Add ksyms device major. 2003-04-25 21:10:46 +00:00
bouyer aec10dd80c Nake return values from bounds_check_with_label() conform to the man
page: -1 for error, 0 for EOF, 1 otherwise. Inspired by an OpenBSD commit
message, pointed out by Miod Vallat in private mail.
vax/mba/hp.c: check return value <= 0, not < 0 to be concistent with how
other places handle return values from bounds_check_with_label().
2003-04-16 15:00:59 +00:00
he 74354e7770 Change SBSIZE -> SBLOCKSIZE, to track changes brought in with UFS2. 2003-04-02 20:53:13 +00:00
thorpej 3b9d583516 Use PAGE_SIZE rather than NBPG. 2003-04-01 15:23:07 +00:00
thorpej 1411d9951f Use PAGE_SIZE rather than NBPG.
XXX Except in one place, which will require more work.
2003-04-01 15:22:53 +00:00
thorpej e9f0a43d28 Use PAGE_SIZE rather than NBPG. 2003-04-01 15:14:20 +00:00
he 8cd91d8236 Commit a workaround for PR toolchain/20924, so that this compiles again.
When/if the PR is fixed, this change should probably be reverted.
2003-03-28 20:25:40 +00:00
he b218b0c7c5 Compensate for the change of type for io_netif by adding a cast so
that this compiles again.
2003-03-28 18:16:59 +00:00
ragge ea5200bf17 Add rf (RX01/02 floppy device driver) 2003-03-23 11:02:29 +00:00
ragge 6c0c8e1049 Change the pmap to use 512-byte pages as user page table pages instead of
PAGE_SIZE pages (4k). An average small program uses ~6 4k pages (24k),
while the same program only uses ~20 512 byte pages (10k), so it will be
a small memory usage improvement. The large improvement will be the upcoming
ability to share page table pages between processes for shared libraries.

Remaining: should be able to give back ptp pages to the system.
2003-03-02 22:19:06 +00:00
ragge 2b65555cf7 Change the pmap to use 512-byte pages as user page table pages instead of
PAGE_SIZE pages (4k). An average small program uses ~6 4k pages (24k),
while the same program only uses ~20 512 byte pages (10k), so it will be
a small memory usage improvement. The large improvement will be the upcoming
ability to share page table pages between processes for shared libraries.

Remaining: should be able to give back ptp pages to the system.
2003-03-02 22:19:04 +00:00
tshiozak 31e2cbf0b5 add some ISO C 1995 I18N functions and types:
btowc, wctrans, towctrans, wcscoll, wcsxfrm, wctype_t and wctrans_t.
2003-03-02 22:18:11 +00:00
matt 986f7ca902 Add machdep sysctl support. Support booted_device, consdev, and
printfataltraps.
2003-03-01 21:51:59 +00:00
perseant eab869e1c0 Make BRIDGE_IPF an option, and document it. Add it (commented) to GENERIC.
Let brconfig tell whether the bridge is using the ipfilter hook, or not.
2003-02-27 19:22:36 +00:00
matt 229495b6d3 Need to forward declare struct buf and struct pte for function prototypes. 2003-02-27 07:14:19 +00:00
ragge 21d5b938d7 Enable USE_TOPDOWN_VM. This also makes it possible to use large address
spaces, so bump MAXDSIZ to 1GB.
2003-02-26 21:54:35 +00:00
matt 04ef5573bf Make common macros like every other port. Now newfs_lfs builds again. 2003-02-26 06:21:09 +00:00
matt 23ea635a14 This file has a _KERNEL dependency on <machine/cpu.h>. So include it.
[GENERIC.MP builds again.]
2003-02-25 23:29:53 +00:00
matt 085785f2d9 Add CPPFLAGS=-D__daddr_t=int32_t to shrink primary boot block. 2003-02-04 13:21:49 +00:00
erh a6774d7b3b D'oh! Remove unused local variable too. 2003-02-02 01:50:04 +00:00
erh 7b7fdceb12 Remove references to nswbuf. It is entirely unused. 2003-02-01 21:05:08 +00:00
thorpej da5ba38dbf Use M_VMPMAP instead of M_HTABLE. 2003-01-31 05:24:31 +00:00
matt 10a5895585 Cleanup daddr_t fallout. 2003-01-30 00:28:19 +00:00
kent cd7d9faeaf Introduce BUS_DMA_NOCACHE, and bus_dmamem_map() of i386 supports it. 2003-01-28 01:07:51 +00:00
gehenna de40fbc7a1 Add the block-device-only devices.
Reported by ragge.
2003-01-23 15:07:54 +00:00
ragge 413b4a7519 Explicitly cast "g" arg to mtpr to long; to tell gcc that this
instruction will use long indexing.
2003-01-22 23:06:37 +00:00
yamt 41ad61ee76 make KSTACK_CHECK_* compile after sa merge. 2003-01-22 12:52:14 +00:00
simonb 276fd1665c The Double-Semi-Colon Police. 2003-01-20 05:29:53 +00:00
matt 829f6cad3d Fix some SA lossage. 2003-01-20 04:45:56 +00:00
ragge 6ad43b52da Add some instrumentation and clean up some VAX8600 code.
From Johnny Billquist.
2003-01-19 22:29:22 +00:00
ragge aa92009e2b Bring back "START=start", otherwise booting via real VMB don't work. 2003-01-19 21:37:04 +00:00
thorpej d2275d51e1 Merge the nathanw_sa branch. 2003-01-18 06:55:21 +00:00
wiz 1035faff1d writable, not writeable. 2003-01-06 20:30:28 +00:00
lukem 4bb41ae2f2 Rework how KERNOBJDIR functions; now it's always determined with
cd ${KERNSRCDIR}/${KERNARCHDIR}/compile && ${PRINTOBJDIR}
This is far simpler than the previous system, and more robust with
objdirs built via BSDOBJDIR.

The previous method of finding KERNOBJDIR when using BSDOBJDIR by
referencing _SRC_TOP_OBJ_ from another directory was extremely
fragile due to the depth first tree walk by <bsd.subdir.mk>, and
the caching of _SRC_TOP_OBJ_ (with MAKEOVERRIDES) which would be
empty on the *first* pass to create fresh objdirs.

This change requires adding sys/arch/*/compile/Makefile to create
the objdir in that directory, and descending into arch/*/compile
from arch/*/Makefile.  Remove the now-unnecessary .keep_me files
whilst here.

Per lengthy discussion with Andrew Brown.
2003-01-06 17:40:18 +00:00
wiz 7e681f7063 interrupt with two rs. 2003-01-06 13:04:54 +00:00
thorpej 9c1214153c Use aprint_normal() for cfprint routines. 2003-01-01 02:20:47 +00:00
thorpej 703e7687a9 Use aprint_normal() in cfprint routines. 2003-01-01 00:16:46 +00:00
ad d4ed18b479 Block tty interrupts in getc()/putc(). 2002-12-29 20:12:19 +00:00
ad 17fa1f0778 - X pads bitmap rows to a word boundary.
- Handle WSDISPLAYIO_GCURMAX.
2002-12-29 20:01:17 +00:00
manu 4a06119a9d Pass the system call table to trace_enter() and ktrsys() so that it is
possible to use alternate system call tables. This is usefull for
displaying correctly the arguments in Mach binaries traces.

If NULL is given, then the regular systam call table for the process is used.
2002-12-21 16:23:56 +00:00
thorpej e8cc3884de Rename __LDPGSZ to AOUT_LDPGSZ, to accurately reflect what it is. 2002-12-10 17:14:02 +00:00
thorpej 78ea2dd367 Use __LDPGSZ (which must be == USRTEXT) as the text address for a.out
executables, and eliminate the USRTEXT constant, which was only used
by the a.out exec code.
2002-12-10 05:14:24 +00:00
ragge 0b23d06491 Revert Jason's changes to the boot startup code:
- All regs must be saved before any register is altered.
- movc{3,5} alters r0-r5, so clearing bss would clear the text instead.
This needs more thinking/testing to get it work correct; there are
different ways different CPUs call "boot".
2002-12-02 20:23:32 +00:00
matt 56effcf269 Add multiple inclusion protection. 2002-12-01 21:21:44 +00:00
matt 4913834e76 Fix inconsistencies in various definitions of avail_*, virtual_*, and
proc0paddr.
2002-12-01 21:20:31 +00:00
lukem 0635de35a3 Remove KDIR=, since SYS_INCLUDE=symlinks and KDIR are not supported any more. 2002-11-26 23:30:07 +00:00
wiz e78e668887 Fix typo (responsiness -> responsiveness). 2002-11-22 12:20:58 +00:00
uebayasi c041971257 Fix compilation errors introduced by recent trace_enter()/ktrsyscall() changes.
Provided by FUKAUMI Naoki <naoki at fukaumi dot org> in kern/19070.
2002-11-16 07:40:38 +00:00
ragge f1b859f028 Fix vax_mem_read_region_{2,4} bug, by der Mouse (mouse@Rodents.Montreal.QC.CA). 2002-11-15 14:52:56 +00:00
ragge adca0d86b2 Fix for a problem where an user can crash the machine via sigreturn(),
noticed by and fix from Miod Vallat <miod@openbsd.org>.

Miod's OpenBSD log message:
> Don't uvm_useracc the user sigcontext in sys_sigreturn and then access
> the user addresses directly from the kernel. copyin is faster and can
> correctly deal properly with mappings that uvm_useracc thinks are
> correct but will fault anyway (to figure out how to generate such
> mappings is left as en excercise for the reader).
>
> Blatantly stolen from art@'s similar fix to sparc.
2002-11-14 20:30:40 +00:00
thorpej aca074b95d Add -mno-asm-pic to CFLAGS and AFLAGS. 2002-11-05 14:35:30 +00:00
thorpej e0f2bd703f Only skip the copy if we are already relocated; always clear
the BSS.
2002-11-05 06:16:21 +00:00
thorpej 80369ce3c8 Set the entry point to 0 for the ELF case, too. 2002-11-05 06:10:35 +00:00
mrg 603098b9b5 implement separate read/write disk statistics:
- disk_unbusy() gets a new parameter to tell the IO direction.
	- struct disk_sysctl gets 4 new members for read/write bytes/transfers.
	when processing hw.diskstats, add the read&write bytes/transfers for
	the old combined stats to attempt to keep backwards compatibility.

unfortunately, due to multiple bugs, this will cause new kernels and old
vmstat/iostat/systat programs to fail.  however, the next time this is
change it will not fail again.

this is just the kernel portion.
2002-11-01 11:31:50 +00:00