historic O_FSYNC flag (the semantics are identical). Hide the historic
O_FSYNC flag if _POSIX_SOURCE or _XOPEN_SOURCE are defined, and define it to
be O_SYNC.
fix 'cd' driver's NCD_SCSI bogosity (was using testing wrong macro!)
clean up in various ways:
* make common atapi_mode_{sense,select}() functions.
* put ATAPI data structures in more sensible headers, split up by
device type.
* include headers a bit more carefully.
* pass flags to attachment-specific cd functions, and use them.
* get rid of SCSI bits in scsipi_base.h's scsipi_make_xs(), move
them into the correct place in scsi_base.c.
* fix minor typo in struct name in scsipiconf.h (which was apparently
never used except in a #define later in the same file).
* use __attribute__ to force 4-byte alignment for xs command store,
so that architectures trying to bus_space_write_multi_N() (where
N > 1) that data to a controller won't lose.
* clean up a few comments in typos, and make a few #defines easier to
understand/maintain.
* rename cd_link.h to cdvar.h (via repository copy). This is exactly
what a 'var' file is supposed to be.
* Fix bug in wdc that would overflow ATAPI transfer length.
* Improve wdc probe code so that 'wdc' is probed in if present
even if there are no drives attached, and so that it works
properly even if the only device is an ATAPI slave.
* bus_space-ify.
* split the ISA attachment from the wdc driver, and remove
ISA dependencies from non-ISA files.
* claim that wd and wdc are now machine-independent (probably not
completely true, but mostly so; they at least work on arm32 and
i386).
* Various other minor fixups and cleanups, some of which were pointed
out by Kazuki Sakamoto.
now lives in dev/ic, wd now lives in dev/ata. there's now a 'ata'
interface attribute defined in conf/files, but wdc can't go there
yet because some ports still use private versions based on the old
ISA version.
-base address 0x308 is supported by more Wangtek QIC tapes than 0x300
-Ultrastor ISA SCSI adapters can't be set to base address 0x334
(changed to 0x340)
written by chuck cranor. thanks to mycroft for helping me find the
one little line of code i accidentally deleted while merging it.
this is not enabled by default. `options MACHINE_NEW_NONCONTIG'
will use this code. eventually, this should go into <machine/vmparam.h>
insteaed of MACHINE_NONCONTIG.
- "out of resource" errors cause receive buffer chain corruption
- resets can confuse the interrupt handler
- multi-cast setup causes receive buffer chain corruption
- shared memory setup incomplete
* Enhance effiency by avoiding unnecessary shared memory access,
improved handling of receive frame & buffer descriptors, and
introducing an `asynchronous' option when issuing 82586 commands.
* Exclusively use offsets relative to the bus handle representing the shared
memory area to formulate accesses to the chip's data-structures. The
front-ends provide glue functions that cater to the chip's endian-
sensitivity, to perform the actual device access (note: single-byte
accesses are done here using `bus_space_{read,write}_1()').
This concludes the transformation into a bus-independent driver module.
* Abolish C structures to access chip data-structures; instead use macros
that take indices and offsets relative to the bus handle representing
the chip's resources.
* Include the old version of this file wholesale, until all drivers
have been updated to use the MI 82586 code.
keeping track of where the kernel lives in K0SEG. Place early data
structure allocation into an allocsys() function, like other ports, so
that it can be used to first calculate the amount of memory needed
for those data structures.
conditional on a particular configuration method.
The global flags "nfs_boot_rfc951" and "nfs_boot_bootparam" control
independantly if the functions are actually called. (Previous meaning
of "nfs_boot_rfc951" was "either-or".)
called anyway, but now at least the reason is documented).
- rearrange a few things to make it easier to add support for non-contigous
physical memory.
legitimate for this to be set if vm_set_page_size() hasn't been called (it's
how the page size is communicated to vm_set_page_size()). Instead, test
for page_shift == 0; this is one of the values that vm_set_page_size()
initializes.
to vm_bootstrap_steal_memory(), since we may need to steal memory from
a direct-mapped segment at this early stage of the game (on e.g. MIPS
and Alpha).
This interface is activated by defining PMAP_STEAL_MEMORY in <machine/pmap.h>.
Otherwise, the pmap_virtual_space() prototype is in-scope for use by
vm_bootstrap_steal_memory().
results in reserved ephemeral ports starting at the top (as per
current practice), and shouldn't have a negative effect on normal
ephemeral ports...
* initialise inpt_lastlow in in_pcbinit
called "MACHINE_NEW_NONCONGIG". this is required for UVM, the new VM
system (also written by chuck) that is coming soon. adds new functions:
vm_page_physload() -- tell the VM system about an area of memory.
vm_physseg_find() -- returns index in vm_physmem array that this
address is in.
and several new versions of old functions/macros defined in vm_page.h.
this is the sparc portion.
called "MACHINE_NEW_NONCONGIG". this is required for UVM, the new VM
system (also written by chuck) that is coming soon. adds new functions:
vm_page_physload() -- tell the VM system about an area of memory.
vm_physseg_find() -- returns index in vm_physmem array that this
address is in.
and several new versions of old functions/macros defined in vm_page.h.
this is the MI portion. sparc, and then later i386 portions to come.
all other ports need to change to this ASAP! (alpha is already being
worked on)
enabled with the LOCAL_CREDS socket option on the listener. Semantics are
similar to BSD/OS's:
- Creds are available with first data on SOCK_STREAM, and with every datagram
on SOCK_DGRAM.
- It is not possible to forge credentials.
Different in that:
- Different credential data structure (ours does not rely on the format
of internal kernel data structures, and does not pass the login name).
- We can pass creds and file descriptors at the same time (this does not
work in BSD/OS).
Luke Mewburn <lukem@netbsd.org> gets credit for inspiring me to implement
this. :-)
* IP_PORTRANGE socket option, which controls how the ephemeral ports
are allocated. it takes the following settings:
IP_PORTRANGE_DEFAULT use anonportmin (49152) -> anonportmax (65535)
IP_PORTRANGE_HIGH as IP_PORTRANGE_DEFAULT (retained for FreeBSD
compat reasons, where these are separate)
IP_PORTRANGE_LOW use 600 -> 1023. only works if uid==0.
* in_pcb flag INP_ANONPORT. set if port was allocated ephmerally
- make sure all sigreturn error conditions are reported to the caller,
instead of the place jumped to.
This is the bugfix part of pr 4628 by ITOH Yasufumi.
The performance optimization part will be handled seperately, after evaluating
its implications.
Testing on 68040 and removing the performance change from the proposed patch
by scottr. Half of the Amiga machdep.c change had to be done manually by me,
as the patchfile didn't apply cleanly.
XXX Yes, Amiga should be changed to use the common sig_machdep.c instead.
XXX Really soon now. I promise.
function (thought, we might revisit that later). Just call pmap_pinit()
in pmap_create(), instead of inlining what pmap_pinit() does.
Also, g/c a TAILQ_FIRST() macro that is now defined in <sys/queue.h>
was converted to use Mach VM for Net2/4.4BSD. The user segment table
pointer was originally stored in the PCB. When Mach VM came along,
however, it was also stored in the pmap, and loaded into the PCB in
pmap_activate(). pmap_activate() would then note that the PCB's USTP
was now in sync with the pmap's USTP, and the low-level context switch
code would use the value from the PCB.
However, pmap_activate() would also load the hardware MMU context if
the pmap was the current pmap (or, in the case where pmaps can be shared,
such as in NetBSD, if the proc was the current proc). The low-level
context switch code would then reload the hardware _again_ using the
USTP from the PCB.
However, the optimization of not calling pmap_activate() if "stchanged"
was false ended up causing some processes to use stale USTP values from
the PCB when the low-level context switch code reloaded the hardware!
This was noticed by using a real vfork(2) (which worked for some time
before failing, surprisingly!)
Since I'm hard pressed to find any real optimization here (since the
hardware was always reloaded once, sometimes twice!), the code now always
calls pmap_activate(), which uses the correct USTP value (the one in the
pmap). The PCB's USTP is now ignored, and should eventually be g/c'd.
Another optimization can actually be performed, and I have added a comment
describing what it is, but have not yet implemented it.
Also note that most of the loadustp() functions where actually incomplete.
This has been corrected. These functions should probably be split up into
MMU-specific operations, and called indirectly, rather than doing constant
run-time decision making based on values that will never change during the
course of a boot's lifetime.
* support sysctl net.inet.ip.anonportmin (lowest ephemeral port)
and net.inet.ip.anonportmax (highest ephemeral port).
these can't be set to >65535, < IPPORT_RESERVED (unless IPNOPRIVPORTS
is defined), and anonportmin has to be < anonportmax.
* use a cleaner way of only cycling through the available set once;
this will be useful for when a random allocation scheme is used
* define IPPORT_ANON{MIN,MAX} instead of IPPORT_USER{LOW,HIGH}
so_linger is used as an argument to tsleep(), so was stuffed with
clockticks for the TCP linger time. However, so_linger is set directly from
l_linger if the linger time is specified, and l_linger is seconds (although
this is not currently documented anywhere). Fix this to set the TCP
linger time in seconds, and multiply so_linger by hz when tsleep() is
called to actually perform the linger.
The problem is that the timespec structures now how 7 32-bit values before
them, which causes them to be implicitly padded on the Alpha (because the
timespecs have an alignment of 64 bits). However, the alignment constraints
changed if _POSIX_SOURCE was defined (thus replacing the timespecs with
time_ts and longs). This had no effect on 32-bit architectures, but changed
the offsets of several stat structure members on the Alpha.
XXX The ABI has not changed; explicit padding is added in the _POSIX_SOURCE
XXX case, enabled by an #ifdef __alpha__. This should be changed if the
XXX stat(2) ABI is ever changed again (e.g. if we change time_t to 64 bits).
3BSD vfork(2), i.e. share address space w/ parent and block parent.
Keep statistics on the total number of forks, the number of forks that
block the parent, and the number of forks that share the address space
with the parent.
Store the page {0,1} base and length registers in the pmap structure,
and implement pmap_activate(), which stores them in the PCB (for the
hardware's use).
- Re-implement pmap_pinit(); allocate the PTEs here, not in cpu_fork().
page {0,1} base and length registers in the pmap structure. They will
be loaded in to the PCB when the process's address space is activated
by way of pmap_activate().
- Remove pmap_pinit() macro; it's now a real function.
- Prototypes for pmap_pinit(), pmap_activate(), pmap_deactivate().
backoff mechanism we use for receiving the response. This is particularly
helpful when we have transient errors on transmit, e.g. a very busy
network or router.