Option 'P1003_1B_SEMAPHORES' to compile them in, or load the "sem" module
to activate them.
Have kern/makesyscalls.sh emit an include for sys/_semaphore.h into sysproto.h
to pull in the typedef for semid_t.
Add the syscalls to the syscall table as module stubs.
that are shareable between processes.
There will be a cleanup shortly along with the necessary changes made to
libc, libc_r, libpthread as well as the hooks into sys/conf and sys/modules.
file servers fail to do it in the right way.
New NFLUSHWIRE flag marks pending flush request(s).
NB: not all cases covered by this commit.
Obtained from: Darwin
- Remove all instances of the mallochash.
- Stash the slab pointer in the vm page's object pointer when allocating from
the kmem_obj.
- Use the overloaded object pointer to find slabs for malloced memory.
<sys/types.h>.
o Use the relatively new visibility primitives for conditionals.
o Make O_SYNC an alias for O_FSYNC.
o Mark the F* names as deprecated.
o Add some comments to note missing POSIX requirements or options.
Windows 2000 box and a FreeBSD box could stall. The problem turned out
to be a timestamp reply bug in the W2K TCP stack. FreeBSD sends a
timestamp with the SYN, W2K returns a timestamp of 0 in the SYN+ACK
causing FreeBSD to calculate an insane SRTT and RTT, resulting in
a maximal retransmit timeout (60 seconds). If there is any packet
loss on the connection for the first six or so packets the retransmit
case may be hit (the window will still be too small for fast-retransmit),
causing a 60+ second pause. The W2K box gives up and closes the
connection.
This commit works around the W2K bug.
15:04:59.374588 FREEBSD.20 > W2K.1036: S 1420807004:1420807004(0) win 65535 <mss 1460,nop,wscale 2,nop,nop,timestamp 188297344 0> (DF) [tos 0x8]
15:04:59.377558 W2K.1036 > FREEBSD.20: S 4134611565:4134611565(0) ack 1420807005 win 17520 <mss 1460,nop,wscale 0,nop,nop,timestamp 0 0> (DF)
Bug reported by: Guido van Rooij <guido@gvr.org>
from the kernel build. This broke linux_genassym on the alpha. For the
kernel, the correct place to get offsetof() is not in /usr/include/stddef.h
but rather <sys/types.h>
under way to move the remnants of the a.out toolchain to ports. As the
comment in src/Makefile said, this stuff is deprecated and one should not
expect this to remain beyond 4.0-REL. It has already lasted WAY beyond
that.
Notable exceptions:
gcc - I have not touched the a.out generation stuff there.
ldd/ldconfig - still have some code to interface with a.out rtld.
old as/ld/etc - I have not removed these yet, pending their move to ports.
some includes - necessary for ldd/ldconfig for now.
Tested on: i386 (extensively), alpha
- Use ucontext_t's to store KSE thread state.
- Synthesize state for the UTS upon each upcall, rather than
saving and copying a trapframe.
- Save and restore FPU state properly in ucontext_t's.
- Deliver signals to KSE-aware processes via upcall.
- Rename kse mailbox structure fields to be more BSD-like.
- Store the UTS's stack in struct proc in a stack_t.
Reviewed by: bde, deischen, julian
Approved by: -arch
- Use ucontext_t's to store KSE thread state.
- Synthesize state for the UTS upon each upcall, rather than
saving and copying a trapframe.
- Deliver signals to KSE-aware processes via upcall.
- Rename kse mailbox structure fields to be more BSD-like.
- Store the UTS's stack in struct proc in a stack_t.
Reviewed by: bde, deischen, julian
Approved by: -arch
- Maintain fpu state across signals.
- Use ucontext_t's to store KSE thread state.
- Synthesize state for the UTS upon each upcall, rather than
saving and copying a trapframe.
- Save and restore FPU state properly in ucontext_t's.
Reviewed by: deischen, julian
Approved by: -arch
Removed unused includes.
Removed used includes of <sys/queue.h> and <sys/time.h>, since these are
standard pollution (especially the latter).
Reviewed by: sobomax
next step is to allow > 1 to be allocated per process. This would give
multi-processor threads. (when the rest of the infrastructure is
in place)
While doing this I noticed libkvm and sys/kern/kern_proc.c:fill_kinfo_proc
are diverging more than they should.. corrective action needed soon.
X_db_search_symbol(). Otherwise we don't see important symbols in
non-verbosely written assembler code.
NetBSD already has this. The kld version already has a stronger form
of it without really trying -- linker_ddb_search_symbol() doesn't
support ddb's symbol search strategy parameter, so the kld
X_db_search_symbol() doesn't pass the parameter to linker_ddb...() and
linker_ddb...() doesn't make distinctions based on the symbol type.
db_elf.c now works better than db_kld.c when it works (which is essentially
when there are no modules except the kernel). It works after booting
with -d. db_kld.c doesn't work until lots of SYSINIT()s have run.
symbol table sections. Reconstruct the necessary section headers from
(ksym_start, ksym_end). This was much easier than converting to use
module metadata, and just works for static symbols, unlike db_kld when
there is no module metadata. Initialize (ksym_start, ksym_end) from
bootinfo on i386's only.
The boot loader should load section headers for all sections that it
loads, and apparently did this for at least the symbol table sections
when this file last worked under FreeBSD (on alphas only) and always
did this under NetBSD (where this file was obtained from). At least
on i386's, boot2 discards the section headers (except for converting
them to (bootinfo.bi_symtab, bootinfo.bi_esymtab), and as far as I can
tell, loader(8) discards them apart from converting them to the bootinfo
values and module metadata.
and renaming ALIGNED_POINTER() to _ALIGNED_POINTER() plus the following
hacks for i386's:
- define _ALIGNED_POINTER() if it is not already defined. Most non-i386
arches define it <machine/param.h> define it in <machine/param.h>,
although none actually used it in the kernel.
- define ksym_start and ksym_end. Most non-i386 arches still define and
initialize these in machdep.c although they didn't used them. Here is
a better place to define them but not to initialize them.
to control the mapping of things like the ACPI and APM into memory.
The problem is that starting X changes these values, so if something
was using the bits of BIOS mapped into memory (say ACPI or APM),
then next time they access this memory the machine would hang.
This patch refuse to change MTRR values it doesn't understand,
unless a new "force" option is given. This means X doesn't change
them by accident but someone can override that if they really want
to.
PR: 28418
Tested by: Christopher Masto <chris@netmonger.net>,
David Bushong <david@bushong.net>,
Santos <casd@myrealbox.com>
MFC after: 1 week
Don't set __LONG_LONG_SUPPORTED for gcc-1. I didn't check exactly
when gcc started to support long long, but it was in the version
of gcc in FreeBSD-1.0 (gcc-2.4.5).
Other C99 features should be ifdefed similarly, but the ifdefs for
old versions of gcc will be more complicated since the features
weren't in all versions of gcc-2.
previous commit:
Include <sys/mutex.h> and its prerequisite <sys/lock.h> instead of
depending on namespace pollution in <sys/buf.h>. Only do this in the
__FreeBSD_version > 500000 case although the __FreeBSD_version < 500000
case has already rotted.
functions. We add pnpinfo, locationinfo, devflags (the newbus flags
on the device), flags (the flags that device_get_flags returns) and
state to the list of things we return.
pnpinfo and locationinfo are place holders at the moment that will be
filled in by the device's parent (optionally). Userland programs will
likely use this information from time to time and take appropriate
actions.
Improvements to devinfo to follow.
recursion when closef() calls pfind() which also wants the proc lock.
This case only occurred when setugidsafety() needed to close unsafe files.
Reviewed by: truckman
v_tag is now const char * and should only be used for debugging.
Additionally:
1. All users of VT_NTS now check vfsconf->vf_type VFCF_NETWORK
2. The user of VT_PROCFS now checks for the new flag VV_PROCDEP, which
is propagated by pseudofs to all child vnodes if the fs sets PFS_PROCDEP.
Suggested by: phk
Reviewed by: bde, rwatson (earlier version)
build on, let alone actually do some useful work on real hardware.
Namely, put it in i386/pc98. There is no bus_dma.h on the other architecures,
tra la.
Introduce biowait() function. Currently there is a race condition and the
mitigation is a timeout/retry. It is not obvious what kind of locking (if any)
is suitable for BIO_DONE, since the majority of users take are of this
themselves, and only a few places actually rely on the wakeup.
Sponsored by: DARPA & NAI Labs.
them visible from userland, if need be.
I wish that the C language contained this as part of struct definintions,
but failing that, I would settle for an agreed upon set of functions for
packing/unpacking integers in various sizes from byte-streams which may
have unfriendly alignment.
This really belongs in <sys/endian.h> I guess.
(what we want to mask is the ATA interrupts, which run at level splbio),
and add interrupt masking around the statement that modifies the
request queue for a SIM.
This resolves problems reported by users under heavy ATAPI load.
Reviewed by: roberto
to be dropped, 2) attempting to lock acct_mtx while already holding it.
Sorry to those who experienced pain.
- Added two comments referring to two areas in which acct_mtx is held over
vnode operations that might sleep. Patch in the works for this.
I should have committed this ages ago.
The MFC for if_ethersubr.c could be done in the usual few days (only
ipfw2 uses it), the one for bridge.c should probably wait until
after 4.7 because it changes an existing though mostly undocumented
behaviour (on which i hope nobody relies). All in all, i'll wait for
both things unless there is demand.
MFC after: 35 days
The 550 version is location at address 1 but since it works right we
let the code find whatever PHY it can.
Fix a fragment issue on TX. If the number of frags are more then the
driver has allocated then bring all the frags together into one packet
and send it out. Code derived from the fxp driver.
Tested and found by: Francois Tigeot <francois.tigeot@nic.fr>
Hellmuth Michaelis <hm@kts.org>
MFC after: 1 week
request structure.
- Re-optimize the case of utrace being disabled by doing an explicit
KTRPOINT check instead of relying on the one in ktr_getrequest() so that
we don't waste time on a malloc in the non-tracing case.
- Change utrace() to return an error if the copyin() fails. Before it
would just ignore the request but still return success. This last is
a change in behavior and can be backed out if necessary.
transfer to a malloc'd buffer and use that bufer for the ktrace event.
This means that genio ktrace events no longer need to be synchronous.
- Now that ktr_buffer isn't overloaded to sometimes point to a cached uio
pointer for genio requests and always points to a malloc'd buffer if not
NULL, free the buffer in ktr_freerequest() instead of in
ktr_writerequest(). This closes a memory leak for ktrace events that
used a malloc'd buffer that had their vnode ripped out from under them
while they were on the todo list.
Suggested by: bde (1, in principle)
- Rename kern.ktrace_request_pool tunable/sysctl to
kern.ktrace.request_pool.
- Add a variable to control the max amount of data to log for genio events.
This variable is tunable via the tunable/sysctl kern.ktrace.genio_size
and defaults to one page.
and __stop_set_* became friendlier. This trick to force the export
of the section delimiter symbols is no longer necessary. We needed to
force this so that we could look up the symbols via a symbol table search
when the module was loaded at run time. ld used to eliminate them if
they were not referenced at compile/link time.
- use `struct uma_zone *' instead of uma_zone_t, so that <sys/uma.h> isn't
a prerequisite.
- don't include <sys/uma.h>.
Namespace pollution makes "opaque" types like uma_zone_t perfectly
non-opaque. Such types should never be used (see style(9)).
"Fixed" subsequently grown dependencies of this header on its own
pollution by polluting explicitly:
- include <sys/mutex.h> and its prerequisite <sys/lock.h> instead of
depending on namespace pollution 2 layers deep in <sys/uma.h>.
- use `struct uma_zone *' instead of uma_zone_t, so that <sys/uma.h> isn't
a prerequisite.
- don't include <sys/uma.h>.
Namespace pollution makes "opaque" types like uma_zone_t perfectly
non-opaque. Such types should never be used (see style(9)).
Changed rename(2) to follow the letter of the POSIX spec. POSIX
requires rename() to have no effect if its args "resolve to the same
existing file". I think "file" can only reasonably be read as referring
to the inode, although the rationale and "resolve" seem to say that
sameness is at the level of (resolved) directory entries.
ext2fs_vnops.c, ufs_vnops.c:
Replaced code that gave the historical BSD behaviour of removing one
link name by checks that this code is now unreachable. This fixes
some races. All vnodes needed to be unlocked for the removal, and
locking at another level using something like IN_RENAME was not even
attempted, so it was possible for rename(x, y) to return with both x
and y removed even without any unlink(2) syscalls (one process can
remove x using rename(x, y) and another process can remove y using
rename(y, x)).
Prodded by: alfred
MFC after: 8 weeks
PR: 42617
reprobe code working. This bogusness was thrust upon me.
o Don't delete the device if no drivers attach. I had thrust this bogusness
upon others.
These two changes make kldload of a pccard driver work again.
in their library (STYP_LIB) section.
- Attempt to make the code which calculates the next entry and
string offsets look clearer.
PR: kern/42580
Tested by: Olaf Klein <ok@adimus.de> (on 4.7-PRERELEASE)
packets in addition to IPPROTO_IPV4 and IPPROTO_IPV6, explicitly specify
IPPROTO_IPV4 or IPPROTO_IPV6 instead of -1 when calling encap_attach().
MFC after: 28 days
(along with other if_gre changes)
address space yet.
- Check whether a process is a system process prior to dereferencing
its p_vmspace. Aio assumes that only the curthread switches the address
space of a system process.
to MAX-1 -> 0. This should allow for less potential for conflict
between pccardd/pccardc and drivers. As far as I can tell no drivers
try to use window 4, so this should be a no-op for them.
cards to test; however the submitter reports that this patch works
with the on-board interface on the IBM x235 server.
Submitted by: Jung-uk Kim <jkim@niksun.com>
MFC after: 1 month
- Get the initial mode from the prom settings and don't clobber the mode
on open.
- Copy output into an internal ring buffer instead of accessing the tty
outq directly in the interrupt handler. This fixes a problem where
garbage would show up in the output stream.
- Reset the console port completely and reprogram all the parameters
before enabling it. This fixes seemingly random hangs on startup
when using a fast interrupt handler.
- Add minimal locking in place of spls.
- Remove dead code and minor cleanups.
available at module compile time. Do not #include the bogus
opt_kstack_pages.h at this point and instead refer to the variables that
are also exported via sysctl.
PS_STRINGS and USRSTACK is. This is necessary in order to decode a.out
core dumps. kern_proc.c was already referring to both of these values
but was missing the #include "opt_kstack_pages.h". Make the sysctl
variables visible so that certain kld modules can see how their parent
kernel was configured.
support this, we do have MI code that references it and is otherwise
unaware of an override. The alternative is to put knowledge in these
MI files about which platforms have the opt_kstack_pages.h option file.
It is more likely that other platforms will gain the ability to tune the
kstack size.
to userland in the signal handler that were not being iflled out before, but
should and can be.
This part of sendsig could be slightly refactored to use an MI interface, or
ideally, *sendsig*() would have an API change to accept a siginfo_t, which
would be filled out by an MI function in the level above sendsig, and said MI
function would make a small call into MD code to fill out the MD parts (some
of which may be bogus, such as the si_addr stuff in some places). This would
eventually make it possible for parts of the kernel sending signals to set up
a siginfo with meaningful information.
Reviewed by: mux
MFC after: 2 weeks
- add dependencies on opt_cpu.h and opt_kstack_pages.h to the linux module
Makefile in the i386 case. The latter is needed by an i386-only file, the
former by the i386 implementation of linux_sysvec.c (opt_cpu.h is used for
architecture-dependent options, so I added it only for i386, although this
file is also generated for the alpha).
- add a dependency on opt_kstack_pages.h to the pecoff module Makefile.
if compiling with I686_CPU as a target. CPU_DISABLE_SSE will prevent
this from happening and will guarantee the code is not compiled in.
I am still not happy with this, but gcc is now generating code that uses
these instructions if you set CPUTYPE to p3/p4 or athlon-4/mp/xp or higher.
route interrupts if the child bus is described in the PCIBIOS interrupt
routing table. For child busses that are in the routing table, they do
not necessarily use a 'swizzle' on their pins on the parent bus to route
interrupts for child devices. If the child bus is an embedded device then
the pins on the child devices can be (and usually are) directly connected
either to a PIC or to a Interrupt Router. This fixes PCIBIOS interrupt
routing across PCI-PCI bridges for embedded devices.
IRQ for an entry in a PCIBIOS interrupt routing ($PIR) table.
- Change pci_cfgintr() to except the current IRQ of a device as a fourth
argument and to use that IRQ for the device if it is valid.
- If an intpin entry in a $PIR entry has a link of 0, it means that that
intpin isn't connected to anything that can trigger an interrupt. Thus,
test the link against 0 to find invalid entries in the table instead of
implicitly relying on the irqs field to be zero. In the machines I have
looked at, intpin entries with a link of 0 often have the bits for all
possible interrupts for PCI devices set.
any machine dependent initialization. This allows the MD code to set the
interrupt routing model so that PCI interrupts are routed correctly when
using an APIC or SAPIC for example.