Commit Graph

2740 Commits

Author SHA1 Message Date
christos
d7f9038062 Add MALLOCLOG 2003-11-01 06:50:13 +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
cl
8904362ede Allow defer of event and interrupted LWP state independently.
Removes code duplication in sa_upcall_getstate() and allows
sa_upcall_getstate() to be used to get state of a single LWP.
2003-10-31 22:47:44 +00:00
cl
ef56cc40ab Reduce code duplication by adding mi_userret() in sys/userret.h
containing signal posting, kernel-exit handling and sa_upcall processing.

XXX the pc532, sparc, sparc64 and vax ports should have their
XXX userret() code rearranged to use this.
2003-10-31 16:44:34 +00:00
drochner
c3b75d203e introduce another "magic" ELF address to tell that the file has to be
mapped at the address it was linked for
2003-10-31 13:54:39 +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
provos
4b425670af use a two-level bitmap as suggested by mogul and banga for fdalloc;
approved thorpej@
2003-10-30 07:27:02 +00:00
thorpej
67f69c1c63 Make callout_setfunc() a CPP macro. Suggested by enami. 2003-10-30 04:32:56 +00:00
mycroft
b94b22f9f5 ; -> \n\t in a few more places. Fixes problems with HPPA, where ; is the
comment separator in the assembler.
2003-10-29 21:56:02 +00:00
grant
c00167fe91 trim leading whitespace from an #error, shuts up warning from
makedepend.
2003-10-29 01:11:16 +00:00
cl
fcc21e91ba move structs nextstep_disklabel/cpu_partition and appendant #defines
to sys/sys/bootblock.h
- rename to next68k_disklabel and next68k_partition
- use {u,}int{8,16,32}_t instead of char/short/int (suggested by D. Laight)
2003-10-27 16:48:08 +00:00
simonb
ecb9893b78 Use "#if" to compare two tokens, not "#ifdef". 2003-10-27 02:30:26 +00:00
kleink
964d6747b5 Err, rename some members added in previous to make them reflect their
semantics better.
2003-10-27 01:11:46 +00:00
kleink
b37192f049 For convenient use in libc, add unions of the C floating types and their
corresponding structure definitions.
2003-10-26 21:46:46 +00:00
kleink
a671ba71b3 Have a common place for definitions related to IEEE 754 single-precision
and double-precision formats.
2003-10-26 20:48:17 +00:00
kleink
2683ad1336 Add a note how this file is to be used. 2003-10-26 16:44:20 +00:00
jdolecek
ad67de5ad8 move ALLOCSYS() macro from <sys/systm.h> to kern_alloc.c - it's the
only place which uses it
2003-10-26 10:45:03 +00:00
thorpej
7426a4c72d Gah, ksiginfo_t isn't actually exported to userland, so use
"struct ksiginfo *" instead.

XXX This is necessary because of <sys/sysctl.h> needed <sys/proc.h>; we
XXX need to clean up these headers!
2003-10-25 20:12:19 +00:00
thorpej
755dd0d065 Include <sys/siginfo.h> so we have the defn of ksiginfo_t. 2003-10-25 19:49:13 +00:00
jdolecek
faee5c3866 bump version to 1.6ZE - struct sigctx change 2003-10-25 17:00:35 +00:00
jdolecek
0c303462c5 modify sigtimedwait(2) to return full siginfo if available, and pass the wait
set using a pointer, to save couple bytes in struct sigctx

also fix fallout from recent lwp_wakeup() change, where we failed to properly
detect if tsleep() returned as result of lwp_wakeup() or signal outside
our wait set; could have caused problems for threaded apps using sigwait(2)
et.al.
2003-10-25 16:50:37 +00:00
enami
1917e90b2f Update comment after the #endif for recent change. 2003-10-24 21:45:09 +00:00
kleink
422697679e * Move the definitions for types other than single-precision and double-
precision back to machine-dependent headers.  C99 has no strict
  requirement which, if any, extended-precision type `long double' must
  match, and even between 80-bit formats there are differences in
  implementation (m68k vs. x86).
* On arm, consider __VFP_FP__.
2003-10-23 23:26:06 +00:00
kleink
b3bc4360e2 C99: provide DECIMAL_DIG. 2003-10-22 20:31:05 +00:00
kleink
5a44ed37d3 C99: provide FLT_EVAL_METHOD. 2003-10-22 16:18:48 +00:00
kleink
22c6452bfb _ISO_C99_SOURCE -> _ISOC99_SOURCE 2003-10-22 15:51:18 +00:00
thorpej
4011fcfefd Cache the "adjusted" value of sb_max when sb_max is changed, in order
to avoid doing quad math in sbreserve().

Change suggested by Simon Burge, and code inspired by a similar change
in FreeBSD.
2003-10-21 22:55:47 +00:00
fvdl
8b99487c1e Define NULL as (void *)0, unless C++ is being used. 2003-10-21 03:27:32 +00:00
kleink
36a2ba5ccd Need to make sure __sysconf() has C linkage. 2003-10-20 22:16:33 +00:00
dsl
b203df0726 Include FS_VINUM in FS_MAXTYPES.
Note there are discrepencies between this list, and that of Free/OpenBSD.
2003-10-20 13:41:28 +00:00
manu
d77ec799a5 Support Darwin static binaries (I should say: support the only Darwin
static binary: otool). Dynamic binaires have a pointer to the Mach-O
header on the top of the stack, static binaries don't have this, and
having it produced a crash.

One bugfix: the EXEC_MACHO code assumes that entry = NULL means that
the entry point has not been found in the load commands seen so far.
Therefore we need to initialized entry to NULL if we want a static binary
to discover it. (dynamic binaries were forced to iscover it because when
the intepreter load command is found, entry is updated whatever its
value was before).

One hack: Both COMPAT_MACH and COMPAT_DARWIN are willing to run Mach-O
binaries. COMPAT_MACH fails for dynamic binaries because it cannot find
the interpreter in /emul/mach. For static binaires, it will accept them
(and for Darwin static binaries, this will cause a failure). Until we
rite a test for matchinf Darwin static binaries, just swap the order of
COMPAT_MACH and COMPAT_DARWIN in the exec switch so that COMPAT_DARWIN
is tried first (this will have the advantage of speeding up program
startup). EXECSW_PRIO_{FIRST_LAST} does not seem to work...
2003-10-19 07:52:22 +00:00
jdolecek
4bb42bc621 switch ARM to use same minor for /dev/zero as other archs
as discussed on tech-arm@
2003-10-16 12:02:58 +00:00
hannken
a3a898ff0f Add the gating of system calls that cause modifications to the underlying
file system.
The function vfs_write_suspend stops all new write operations to a file
system, allows any file system modifying system calls already in progress
to complete, then sync's the file system to disk and returns. The
function vfs_write_resume allows the suspended write operations to
complete.

From FreeBSD with slight modifications.

Approved by: Frank van der Linden <fvdl@netbsd.org>
2003-10-15 11:28:59 +00:00
dbj
fe7c786886 add mnt_iflag field to struct mount for internal flags
mv MNT_GONE, MNT_UNMOUNT and MNT_WANTRDWR to this field
additonally add mnt_writeopcountupper and mnt_writeopcountlower fields
in preparation for pending write suspension support work
bump kernel version to 1.6ZD
2003-10-14 14:02:56 +00:00
fvdl
f7ae3d4536 Define a few 32bit compat types (if COMPAT_NETBSD32, not exported to
userspace). Having them here is both good and bad. Good because they're
close to the actual native ones, bad because it exposes things out
of compat/netbsd32. However, putting the exclusively in the latter
requires a lot of reshuffling in the includes there, so this will
do for now.
2003-10-13 18:50:43 +00:00
thorpej
1bdc80d6cc Whitespace. 2003-10-13 16:55:10 +00:00
pk
4370fdf30f Define SI_NOINFO to indicate that no signal specific code is available.
It is a large positive value (same as in Solaris) to distinguish a trap
for which the standard qualifiers do not fit, from a user- or other
"software"-generated signal.
2003-10-12 20:00:39 +00:00
thorpej
03a2e6174e Remove comment about non-existent MNT_MLOCK. 2003-10-12 19:08:49 +00:00
jdolecek
5d0bf491b0 g/c struct swdevt definition and extern decl for swdevt[] - it's not
used in kernel tree anywhere
2003-10-11 18:32:53 +00:00
simonb
13ceaa8236 Fix "#defined<tab>" nits. 2003-10-10 02:11:58 +00:00
grog
c5cf87a850 Add definitions for Vinum. 2003-10-10 02:02:52 +00:00
lukem
8e798b3ca1 use uint8_t instead of char for bp_password[] 2003-10-10 01:49:54 +00:00
yamt
fbacec1288 tweak curproc not to reference curlwp twice.
(function calls might be accompanied by curlwp.)
2003-10-09 14:00:34 +00:00
dsl
e79e1bed24 Make X86_BOOT_MAGIC_* available when ASSEMBLER defined. 2003-10-09 10:25:40 +00:00
enami
22658b0b3a Fix whitespace usage and typo in comment. 2003-10-08 23:08:35 +00:00
lukem
1c33b4e6a4 Overhaul MBR handling (part 1):
<sys/bootblock.h>:
    *	Added definitions for the Master Boot Record (MBR) used by
	a variety of systems (primarily i386), including the format
	of the BIOS Parameter Block (BPB).
	This information was cribbed from a variety of sources
	including <sys/disklabel_mbr.h> which this is a superset of.

	As part of this, some data structure elements and #defines
	were renamed to be more "namespace friendly" and consistent
	with other bootblocks and MBR documentation.
	Update all uses of the old names to the new names.

<sys/disklabel_mbr.h>:
    *	Deprecated in favor of <sys/bootblock.h> (the latter is more
	"host tool" friendly).

amd64 & i386:
    *	Renamed /usr/mdec/bootxx_dosfs to /usr/mdec/bootxx_msdos, to
	be consistent with the naming convention of the msdosfs tools.

    *	Removed /usr/mdec/bootxx_ufs, as it's equivalent to bootxx_ffsv1
	and it's confusing to have two functionally equivalent bootblocks,
	especially given that "ufs" has multiple meanings (it could be
	a synonym for "ffs", or the group of ffs/lfs/ext2fs file systems).

    *	Rework pbr.S (the first sector of bootxx_*):
	    +	Ensure that BPB (bytes 11..89) and the partition table
		(bytes 446..509) do not contain code.
	    +	Add support for booting from FAT partitions if BOOT_FROM_FAT
		is defined.  (Only set for bootxx_msdos).
	    +	Remove "dummy" partition 3; if people want to installboot(8)
		these to the start of the disk they can use fdisk(8) to
		create a real MBR partition table...
	    +	Compile with TERSE_ERROR so it fits because of the above.
		Whilst this is less user friendly, I feel it's important
		to have a valid partition table and BPB in the MBR/PBR.

    *	Renamed /usr/mdec/biosboot to /usr/mdec/boot, to be consistent
	with other platforms.

    *	Enable SUPPORT_DOSFS in /usr/mdec/boot (stage2), so that
    	we can boot off FAT partitions.

    *	Crank version of /usr/mdec/boot to 3.1, and fix some of the other
	entries in the version file.

installboot(8) (i386):
    *	Read the existing MBR of the filesystem and retain the BIOS
    	Parameter Block (BPB) in bytes 11..89 and the MBR partition
	table in bytes 446..509.  (Previously installboot(8) would
	trash those two sections of the MBR.)

mbrlabel(8):
    *	Use sys/lib/libkern/xlat_mbr_fstype.c instead of homegrown code
	to map the MBR partition type to the NetBSD disklabel type.


Test built "make release" for i386, and new bootblocks verified to work
(even off FAT!).
2003-10-08 04:25:43 +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
thorpej
8655c7d7eb Add a MAP_WIRED flag to mmap(2), which causes the new mapping to be
wired as if by mlock(2).
2003-10-07 00:17:09 +00:00
lukem
420f3b76ba Replace BP_* with I386_BP_FLAGS_*, for consistency with other stuff in
<sys/bootblock.h>
(CONSDEV_ should be converted as well, but that's more intrusive...)
2003-10-06 05:24:54 +00:00
matt
6aa94d2054 Don't use ';' as the separator. Use '\n' instead. 2003-10-06 04:55:37 +00:00