Matthew Dillon [Sat, 25 Jun 2005 19:06:22 +0000 (19:06 +0000)]
Do a quick cleanup pass on the userland scheduler and move resetpriority()
from kern_synch.c to kern_switch.c. No code changes.
Matthew Dillon [Sat, 25 Jun 2005 19:04:37 +0000 (19:04 +0000)]
Fix a race between fork() and ^Z. If the ^Z is handled just as the forked
child is returning from the fork trampoline, the current process designation
is not released and the system stops scheduling userland processes. Also
fix an initial priority bug.
Reported-by: YONETANI Tomokazu <qhwt+dfly@les.ath.cx>
Max Okumoto [Wed, 22 Jun 2005 22:03:36 +0000 (22:03 +0000)]
Renamed struct MakeFlags to struct CLI.
Max Okumoto [Wed, 22 Jun 2005 22:03:19 +0000 (22:03 +0000)]
Split Dir_Init() into two functions.
Max Okumoto [Wed, 22 Jun 2005 22:03:03 +0000 (22:03 +0000)]
Move sections of init code that do not take any input into the
above section.
Max Okumoto [Wed, 22 Jun 2005 22:02:43 +0000 (22:02 +0000)]
Cleanup Dir_Init*() functions.
Joerg Sonnenberger [Wed, 22 Jun 2005 20:11:59 +0000 (20:11 +0000)]
Instead of emulating a userland system call via stackgap, use
kern_open directly.
Joerg Sonnenberger [Wed, 22 Jun 2005 20:09:34 +0000 (20:09 +0000)]
Defancy the infinite loop. Fix a bug where the loop wasn't left when
all ptys have been processed.
Matthew Dillon [Wed, 22 Jun 2005 19:58:44 +0000 (19:58 +0000)]
The recent file descriptor work is significant enough to deserve a
DragonFly copyright.
Suggested-by: Hiten Pandya <hmp@backplane.com>
Matthew Dillon [Wed, 22 Jun 2005 19:55:30 +0000 (19:55 +0000)]
Document cleanvar_enable in rc.conf.5 and document the purge code
in cleanvar.
Submitted-by: "George Georgalis" <george@galis.org>
Matthew Dillon [Wed, 22 Jun 2005 19:40:35 +0000 (19:40 +0000)]
Randomize the initial stack pointer for a user process. Introduce a
sysctl, kern.stackgrap_random, to specify the random range. The value must
be a power of two.
Submitted-by: Craig Dooley <xlnxminusx@gmail.com>
Adapted-from: OpenBSD
Max Okumoto [Wed, 22 Jun 2005 18:04:49 +0000 (18:04 +0000)]
Remove extra semi colin and a few remove redundent checks.
Max Okumoto [Wed, 22 Jun 2005 18:04:13 +0000 (18:04 +0000)]
Some cleanup
o constify input to Main_ParseArgLine()
o split complex if-statement into seperate assignment and if-statements
o use strsep()
Joerg Sonnenberger [Wed, 22 Jun 2005 15:27:45 +0000 (15:27 +0000)]
SuSE includes a special .note.SuSE section descriping the version of
the distribution the binary is from. This is a problem because they
forget to use a note type other than 1, which is used for ABI tag
sections.
Using a second match function is the easiest solution, otherwise we
would have to scan either the header section list or the full section
list twice. As long as no other vendor created such idiosyncrasy,
this is faster.
Matthew Dillon [Wed, 22 Jun 2005 02:08:19 +0000 (02:08 +0000)]
Synchronize the ipfilter contrib code with recent file descriptor cleanups.
Matthew Dillon [Wed, 22 Jun 2005 01:51:40 +0000 (01:51 +0000)]
Synchronize libkcore with recent file descriptor cleanups.
Matthew Dillon [Wed, 22 Jun 2005 01:50:03 +0000 (01:50 +0000)]
Synchronize the fstat program with recent file descriptor cleanups.
Matthew Dillon [Wed, 22 Jun 2005 01:33:34 +0000 (01:33 +0000)]
File descriptor cleanup stage 2, remove the separate arrays for file
pointers, fileflags, and allocation counts and replace the mess with a
single structural array. Also revamp the code that checks whether the
file descriptor array is built-in or allocated.
Note that the removed malloc's were doing something weird, allocating
'nf * OFILESIZE + 1' bytes instead of 'nf * OFILESIZE' bytes. I could
not find any reason at all why it was doing that. It's gone now anyway.
Jeffrey Hsu [Tue, 21 Jun 2005 23:58:53 +0000 (23:58 +0000)]
Replace the linear search in file descriptor allocation with an O(log N)
algorithm based on full in-place binary search trees augmented with
subtree free file descriptor counts.
Idea from: Solaris
Max Okumoto [Tue, 21 Jun 2005 21:06:24 +0000 (21:06 +0000)]
Use strsep() instead of custom loop.
Max Okumoto [Tue, 21 Jun 2005 21:05:54 +0000 (21:05 +0000)]
Move compatMake test up.
Max Okumoto [Tue, 21 Jun 2005 21:04:49 +0000 (21:04 +0000)]
cleanup ReadInputFiles()
Max Okumoto [Tue, 21 Jun 2005 21:04:32 +0000 (21:04 +0000)]
fix comments
Max Okumoto [Tue, 21 Jun 2005 20:59:42 +0000 (20:59 +0000)]
Move code from main into subroutine.
Max Okumoto [Tue, 21 Jun 2005 20:59:00 +0000 (20:59 +0000)]
cleanup built_stuff()
moving function description comment
move exit status, the code will be moved into the called function.
Matthew Dillon [Tue, 21 Jun 2005 17:59:47 +0000 (17:59 +0000)]
Bump fd_lastfile, freefile, and refcnt to 32 bit ints. Also bump cmask
(though that doesn't fix any particular bug). lastfile and freefile were
previously unsigned shorts which caused the system to become very confused
when any single user process had more then 65535 open file descriptors.
Reported-by: Jeffrey Hsu <hsu@leaf.dragonflybsd.org>
Joerg Sonnenberger [Tue, 21 Jun 2005 15:27:55 +0000 (15:27 +0000)]
Add BCM5751.
Submitted-by: Pablo Méndez Hernández <pablomh@gmail.com>
Joerg Sonnenberger [Tue, 21 Jun 2005 15:25:56 +0000 (15:25 +0000)]
Regen.
Joerg Sonnenberger [Tue, 21 Jun 2005 15:24:04 +0000 (15:24 +0000)]
Add BCM5751.
Submitted-by: Pablo Méndez Hernández <pablomh@gmail.com>
Joerg Sonnenberger [Tue, 21 Jun 2005 12:35:14 +0000 (12:35 +0000)]
Restore copy of revid in softc.
Problem-reported-by: walt <wa1ter@myrealbox.com>
Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>
David Xu [Tue, 21 Jun 2005 07:47:01 +0000 (07:47 +0000)]
Fix off-by-one error.
Matthew Dillon [Tue, 21 Jun 2005 06:50:28 +0000 (06:50 +0000)]
Have ktrdump run 'nm' on the kernel execfile and translate the caller1,2
pointers into symbols, unless the -n (numeric only) option is specified.
If no display options are specified, enable a few of them by default.
Reverse the printing order from caller1, caller2 to caller2, caller1,
so the procedural display order matches the procedure chain order.
Matthew Dillon [Tue, 21 Jun 2005 05:25:17 +0000 (05:25 +0000)]
Add KTR support to the IPIQ code.
Matthew Dillon [Tue, 21 Jun 2005 05:03:12 +0000 (05:03 +0000)]
Add additional sanity checks to IPIQ processing, do some cleanups,
and make minor changes to the function dispatch.
Matthew Dillon [Tue, 21 Jun 2005 00:47:07 +0000 (00:47 +0000)]
Rewrite a good chunk of the ktrdump utility to work with the new DragonFly
KTR facility.
Matthew Dillon [Mon, 20 Jun 2005 23:21:34 +0000 (23:21 +0000)]
Correct KTR masks for memory logging.
Matthew Dillon [Mon, 20 Jun 2005 21:12:49 +0000 (21:12 +0000)]
Correct a missing macro element for the NON-KTR case.
Matthew Dillon [Mon, 20 Jun 2005 21:11:13 +0000 (21:11 +0000)]
Add KTR support to the slab allocator. Track malloc's, free's, oversized
chunks, and IPI operations.
Matthew Dillon [Mon, 20 Jun 2005 20:49:14 +0000 (20:49 +0000)]
Include a bitmap of allocated entries when built with INVARIANTS. I
considered making this a separate option but decided it was too important
to leave out of a basic INVARIANTS build.
The kernel will panic if it tries to allocate memory that has already
been allocated or free memory that has already been freed.
Matthew Dillon [Mon, 20 Jun 2005 20:38:01 +0000 (20:38 +0000)]
Use KTR's built-in call chain recording rather then hacking it up ourselves.
Matthew Dillon [Mon, 20 Jun 2005 20:37:28 +0000 (20:37 +0000)]
Add a caller backtrace feature (enabled by default), which records part of
the call chain leading up to the traced function. Two call chain instruction
addresses are recorded.
Matthew Dillon [Mon, 20 Jun 2005 18:00:28 +0000 (18:00 +0000)]
Use the KTR facility to trace token operations.
Matthew Dillon [Mon, 20 Jun 2005 17:59:33 +0000 (17:59 +0000)]
Reimplement the kernel tracepoint facility. The new implementation is
completely generic and very easy to implement in modules. Compile-time
optimizations are retained and sysctl generation is completely automatic.
Only the DDB command code has been retained from FreeBSD.
The logging macros are designed to allow subsystems to trivially declare
and use the facility.
This implementation is not quite complete, we also want to integrate a
stack backtrace logging facility.
Matthew Dillon [Mon, 20 Jun 2005 17:43:39 +0000 (17:43 +0000)]
Introduce an ultra-simple, non-overlapping, int-aligned bcopy called bcopyi().
Joerg Sonnenberger [Mon, 20 Jun 2005 16:48:02 +0000 (16:48 +0000)]
queue(3) for if_multiaddrs.
Joerg Sonnenberger [Mon, 20 Jun 2005 15:10:41 +0000 (15:10 +0000)]
Use queue(3) macros for if_multiaddrs.
Joerg Sonnenberger [Mon, 20 Jun 2005 13:56:08 +0000 (13:56 +0000)]
Setup interrupt last in txp_attach. Protect against concurrent interrupts
in txp_detach. Use M_WAITOK in txp_attach.
Joerg Sonnenberger [Mon, 20 Jun 2005 13:51:54 +0000 (13:51 +0000)]
Common PCI probe style.
Joerg Sonnenberger [Mon, 20 Jun 2005 13:49:52 +0000 (13:49 +0000)]
Explicitly set error before jumping to fail.
Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>
Joerg Sonnenberger [Mon, 20 Jun 2005 13:41:51 +0000 (13:41 +0000)]
Use local storage for MAC instead of arpcom.ac_enaddr.
Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>
Joerg Sonnenberger [Mon, 20 Jun 2005 13:39:17 +0000 (13:39 +0000)]
Use ether_crc32_be.
Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>
Joerg Sonnenberger [Mon, 20 Jun 2005 13:30:53 +0000 (13:30 +0000)]
Use queue(3).
Joerg Sonnenberger [Mon, 20 Jun 2005 13:26:15 +0000 (13:26 +0000)]
Use PCI accessor functions, don't change memory / port bit manually.
Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>
Joerg Sonnenberger [Mon, 20 Jun 2005 13:24:14 +0000 (13:24 +0000)]
- pass dev directly to txp_release_resources, call it only once
- use only if_printf outside of txp_attach.
- remove sc_dev, sc_cold, TXP_DEVNAME
Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>
Joerg Sonnenberger [Mon, 20 Jun 2005 13:08:01 +0000 (13:08 +0000)]
Use vr_detach as common error path.
Setup interrupt last in vr_attach.
Use M_WAITOK for contigmalloc, now that we don't have to protect
against concurrent interrupts.
Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>
Joerg Sonnenberger [Mon, 20 Jun 2005 13:04:52 +0000 (13:04 +0000)]
Use ether_crc32_be.
Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>
Obtained-from: FreeBSD
Joerg Sonnenberger [Mon, 20 Jun 2005 13:02:48 +0000 (13:02 +0000)]
Use PCI accessor functions. Stop changing port / memory bits manually.
Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>
Joerg Sonnenberger [Mon, 20 Jun 2005 13:01:15 +0000 (13:01 +0000)]
- initialise interface name early
- use common PCI probe style
- remove unused vr_info and vr_type field from softc
Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>
Matthew Dillon [Mon, 20 Jun 2005 07:58:39 +0000 (07:58 +0000)]
Add a DEBUG_TOKENS option which causes token operations to be logged to
a static array, suitable for post-morten investigation.
Matthew Dillon [Mon, 20 Jun 2005 07:40:30 +0000 (07:40 +0000)]
Tokens are recursive in the context of the same thread. This also means
that fast interrupts such as IPIs cannot safely use any token function.
Assert this requirement in the implementation.
Add miscellanious other assertions to enforce correct operation.
Remove the 'no giveaway' warning. This warning was being used to determine
where recursive tokens were being used. It turns out that they are used
in the mountlist scan code (which has historically been rather buggy). Now
that we know where they are used and we fixed the recursion release bug in
a prior commit, this printf() can be removed.
Matthew Dillon [Mon, 20 Jun 2005 07:31:05 +0000 (07:31 +0000)]
Fix a serious SMP bug. The RWLOCK support used by dev/raid/aac,
ACPI, and dev/drm improperly tries to use a token in lwkt_schedule().
Because lwkt_schedule() can be called from an IPI in the context of
the current thread it cannot safely manipulate the current thread,
much less the td_toks field.
To fix this problem the RW lock functions in lwkt_rwlock.c have to be
covered by a critical section as well as the token, and lwkt_schedule()
then simply checks to see if the token is owned by the current cpu. RWLocks
may require some rethinking.
The token code is designed to operate mostly without having to use a
critical section, but in order for this to work it depends on the td_toks
list not being ripped out from under it. The nested trytoken/release
call in lwkt_schedule() should not have caused mainline token code to
fail as it restored td_toks to the same state it was in on entry, but
we can't take that chance.
Matthew Dillon [Mon, 20 Jun 2005 02:56:09 +0000 (02:56 +0000)]
Add a missing crit_exit(). The code path in question only got executed
if an error occurs.
Matthew Dillon [Sun, 19 Jun 2005 22:43:32 +0000 (22:43 +0000)]
Fix a bug in the physmap[] array limit calculation and rewrite portions of
the physmap code to try to clean up some of the mess. Increase the number
of physmap entries supported to 10.
Matthew Dillon [Sun, 19 Jun 2005 22:07:17 +0000 (22:07 +0000)]
Add more magic numbers for the token code.
Matthew Dillon [Sun, 19 Jun 2005 21:50:50 +0000 (21:50 +0000)]
Fix two bugs in the LWKT token code.
(1) When releasing a token reference we cannot give away the token to
another cpu if we are still holding it via a another reference. This
can cause recursive token references to silently fail when the inner
reference is released. It is unclear where such references exist and
a temporary printf has been added to identify occurances.
(2) When obtaining a token reference if the underlying token was not owned
by the current cpu we spun to gain ownership, but then failed to check
whether the token was being held by a preempted thread.
This can result in a preempting thread holding a token also being held
by an underyling thread. Theoretically, this case can only
occur if the preempted thread was is the process of obtaining the
token in question since otherwise (by definition) our cpu will already
own the token. On return the preempted thread will check and obtain
ownership. However, the situation is complex enough that we really
need to check unconditionally.
Joerg Sonnenberger [Sun, 19 Jun 2005 17:13:59 +0000 (17:13 +0000)]
Also include files in the .OBJDIR.
Joerg Sonnenberger [Sun, 19 Jun 2005 16:45:32 +0000 (16:45 +0000)]
Fix some glitches.
Joerg Sonnenberger [Sun, 19 Jun 2005 16:19:42 +0000 (16:19 +0000)]
Remove old libf2c.
Joerg Sonnenberger [Sun, 19 Jun 2005 16:18:22 +0000 (16:18 +0000)]
Unhook old g2c from build and start building the GCC 3.4.4 version.
While they should be binary compatible, don't take any risk and add
them as SHLIB_MAJOR 3.
Joerg Sonnenberger [Sun, 19 Jun 2005 16:11:16 +0000 (16:11 +0000)]
Merge from vendor branch GCC:
Include the fortran library sources from GCC 3.4.4.
Joerg Sonnenberger [Sun, 19 Jun 2005 16:11:16 +0000 (16:11 +0000)]
Include the fortran library sources from GCC 3.4.4.
Max Okumoto [Sun, 19 Jun 2005 14:31:03 +0000 (14:31 +0000)]
cleanup exit status handling
Max Okumoto [Sun, 19 Jun 2005 14:30:29 +0000 (14:30 +0000)]
Rename noBuiltins to builtins and invert logic.
Max Okumoto [Sun, 19 Jun 2005 14:30:02 +0000 (14:30 +0000)]
Add better comments for main()
Max Okumoto [Sun, 19 Jun 2005 14:29:42 +0000 (14:29 +0000)]
o cleanup usage of outOfDate variable.
Simon Schubert [Sat, 18 Jun 2005 19:05:02 +0000 (19:05 +0000)]
remove conditional to get required macros
Eirik Nygaard [Sat, 18 Jun 2005 12:56:41 +0000 (12:56 +0000)]
We are in callout_stop, not callout_reset. Tell that to the world.
Max Okumoto [Sat, 18 Jun 2005 09:01:12 +0000 (09:01 +0000)]
Pass DEFSHELLNAME into Shell_Init(), and remove the dependency of
shell.o on the Makefile.
Sascha Wildner [Fri, 17 Jun 2005 23:17:02 +0000 (23:17 +0000)]
Use csh for {foo,bar} filename substitutions.
Sascha Wildner [Fri, 17 Jun 2005 23:10:11 +0000 (23:10 +0000)]
Mop up OLDCARD remains.
Max Okumoto [Fri, 17 Jun 2005 22:22:44 +0000 (22:22 +0000)]
Add a few highlevel comments in main, describing what variables should be set.
Liam J. Foy [Fri, 17 Jun 2005 21:06:21 +0000 (21:06 +0000)]
- Document mined(1) key bindings
Submitted by: Steven G. Kargl <kargl@troutmask.apl.washington.edu>
Matthew Dillon [Fri, 17 Jun 2005 19:12:23 +0000 (19:12 +0000)]
Abstract out the location of an m_tag's data by adding a m_tag_data() inline.
Replace all instances of 'mtag + 1' with the new inline.
Fix numerous bugs, mainly in ipfw/ipfw2, where the m_tag data was being stored
in the wrong place and corrupting the m_tag, resulting in a panic. This
primarily occured with the use of divert rules.
Reported-by: Ben Woolley <tautolog@gmail.com>
Matthew Dillon [Fri, 17 Jun 2005 18:58:02 +0000 (18:58 +0000)]
When cleaning an mbuf header for reinsertion into the objcache, make sure
m_pkthdr.tags is reset.
Simon Schubert [Fri, 17 Jun 2005 14:59:07 +0000 (14:59 +0000)]
take cvs 1.12.11 sources out of duty
Max Okumoto [Fri, 17 Jun 2005 10:27:53 +0000 (10:27 +0000)]
Better comment for chdir_verify_path()
Max Okumoto [Fri, 17 Jun 2005 08:49:49 +0000 (08:49 +0000)]
Style(9) - add blank line before first statement in a function.
Max Okumoto [Fri, 17 Jun 2005 08:11:28 +0000 (08:11 +0000)]
Remove extra white space.
Max Okumoto [Fri, 17 Jun 2005 07:54:24 +0000 (07:54 +0000)]
Remove spaces infront of tabs.
Max Okumoto [Fri, 17 Jun 2005 07:50:49 +0000 (07:50 +0000)]
Fix order of functions Shell_Init() uses ShellMatch()
Max Okumoto [Thu, 16 Jun 2005 23:33:15 +0000 (23:33 +0000)]
Reduce diffs
Max Okumoto [Thu, 16 Jun 2005 23:11:42 +0000 (23:11 +0000)]
Some more style(9) stuff and took some comment from FreeBSD.
Max Okumoto [Thu, 16 Jun 2005 23:06:56 +0000 (23:06 +0000)]
Fix some style(9) errors.
Max Okumoto [Thu, 16 Jun 2005 22:59:15 +0000 (22:59 +0000)]
FreeBSD-Date: 2005/06/14 12:50:52
Author: ru
Markup and wording fixes.
Approved by: re (blanket)
Max Okumoto [Thu, 16 Jun 2005 22:46:48 +0000 (22:46 +0000)]
FreeBSD-Date: 2005/05/25 17:06:14
Author: harti
Under certain conditions the condition parser would go one past end of
the string. Until now this caused no harm, because the buffer code used
to tack two NULs onto buffers. With the new, soon to come, parsing code
this isn't the case anymore in all cases, so fix this.
Max Okumoto [Thu, 16 Jun 2005 22:35:15 +0000 (22:35 +0000)]
Reorder functions to reduce determining what harti did.
Max Okumoto [Thu, 16 Jun 2005 22:02:36 +0000 (22:02 +0000)]
FreeBSD-Date: 2005/05/25 09:46:31
Author: harti
Document why there is a dependency of certain object files from the
Makefile.
Requested by: ru
Max Okumoto [Thu, 16 Jun 2005 21:50:50 +0000 (21:50 +0000)]
FreeBSD-Date: 2005/05/24 16:48:10
Author: harti
Make shell.o dependend on the Makefile just in case someone changes
the default shell in the Makefile.
Max Okumoto [Thu, 16 Jun 2005 21:47:38 +0000 (21:47 +0000)]
FreeBSD-Date: 2005/05/24 16:45:11
Author: harti
Fix a 64-bit warning by casting an int64_t to intmax_t and printing it
with %jd.
Liam J. Foy [Thu, 16 Jun 2005 21:39:50 +0000 (21:39 +0000)]
- Make rwhod now use poll(2) instead of signals
If anyone can test this further than me, please do!
Taken from: OpenBSD with my timing modifications
Reviewed by: Joerg@