summaryrefslogtreecommitdiffstats
path: root/sys
Commit message (Collapse)AuthorAgeFilesLines
* Spell "FreeBSD" with "F" and "BSD" in uppercase.ru2001-08-131-1/+1
|
* Use interrupt gates instead of trap gates for breakpoint and tracebde2001-08-132-4/+4
| | | | | | | | | traps, so that ddb can keep control (almost) no matter how it is entered. This breaks time-critical interrupts while the system is stopped in ddb, but I haven't noticed any significant problems except that applications become confused about the time. Lost time will be adjusted for later. Anyway, the half-baked disabling of interrupts in Debugger() gives the same problems for the usual way of entering ddb.
* Removed he BPTTRAP() macro and its use. It was intended for restoringbde2001-08-133-12/+6
| | | | | | bug for bug compatibility to ddb trap handlers after fixing the debugger trap gates to be interrupt gates, but the fix was never committed. Now I want the fix to apply to ddb.
* Fixed minor numbers when there is more than one cy card.bde2001-08-133-18/+45
| | | | | | PR: 19256 Submitted by: initial version by yokota MFC after: 1 week
* Use ttymalloc() instead of a static array of `struct tty'. This willbde2001-08-133-45/+6
| | | | | | | be a regression until `pstat -t' actually understands the results of ttymalloc(). Submitted by: mostly by yokota
* Fix some trivial bugs.iwasaki2001-08-122-20/+24
| | | | | | | | | | | - fix segment limit mis-calculation for GCODE_SEL, GDATA_SEL, GPRIV_SEL, LUCODE_SEL and LUDATA_SEL. - move `loader(8) metadata' related printf() after cninit(). - use atop macro (address to pages) for segment limit calculation instead of i386_btop macro (bytes to pages). - fix style bugs for the declarations of ints. Reviewed by: bde, msmith (and arch & audit ML)
* Remove unused nmdmpoll function.mp2001-08-111-63/+0
| | | | Approved by: julian
* If we've panic'd already, then just bail in lockmgr rather than blocking orjhb2001-08-101-0/+5
| | | | possibly panic'ing again.
* Make the protoswitch definitiosn checkable in the same way thatjulian2001-08-102-30/+30
| | | | | | | | cdevsw entries have been for a long time. Discover that we now have two version sof the same structure. I will shoot one of them shortly when I figure out why someone thinks they need it. (And I can prove they don't) (netinet/ipprotosw.h should GO AWAY)
* Fix some of the GDB linkage setup. The l_name member of the gdb linkagewpaul2001-08-102-4/+28
| | | | | | | | | | | | | | | | | | | | | | | | | structure is always free()ed yet only sometimes malloc()ed. In particular, it was simply set to point to l_filename from the a linker_file_t in link_elf_link_preload_finish(). The l_filename had been malloc()ed inside the kern_linker.c module and was being free()ed twice: once by link_elf_unload_file() and again by linker_file_unload(), leading to a panic. How to duplicate the problem: - Pre-load a kernel module from the loader, i.e. if_sis.ko - Boot system - Attempt to unload module with kldunload if_sis - Bewm The problem here is that the case where the module was loaded with kldload after system boot would work correctly, so this bug went unnoticed until I stubbed my toe on it just now. (Also, you can only trip this bug if you compile a kernel with options DDB, but that's the default now.) Fix: remember to malloc() a separate copy of the module name for the l_name member of the gdb linkage structure in three places where the linkage structure can be initialized.
* Add an optimization where we check hte PS_ASTPENDING and PS_NEEDRESCHEDjhb2001-08-101-0/+10
| | | | | | | | | | | | | | flags with interrupts disabled to see if we should call ast() during doreti. This was mostly submitted by Bruce, but his original patch did the looping in ast() in assembly rather than in the ast() function itself. Once we've actually called into the ast() function, it's cheaper to just loop inside the function rather than returning from the function, performing the check, and then calling the function again. However, we can optimize the first check to avoid calling the function at all. Other architectures may choose to implement this optimization if they wish but it is not required for correct operation. Submitted by: bde
* - Close races with signals and other AST's being triggered while we are injhb2001-08-1029-225/+111
| | | | | | | | | | | | | | | | | | | | | | the process of exiting the kernel. The ast() function now loops as long as the PS_ASTPENDING or PS_NEEDRESCHED flags are set. It returns with preemption disabled so that any further AST's that arrive via an interrupt will be delayed until the low-level MD code returns to user mode. - Use u_int's to store the tick counts for profiling purposes so that we do not need sched_lock just to read p_sticks. This also closes a problem where the call to addupc_task() could screw up the arithmetic due to non-atomic reads of p_sticks. - Axe need_proftick(), aston(), astoff(), astpending(), need_resched(), clear_resched(), and resched_wanted() in favor of direct bit operations on p_sflag. - Fix up locking with sched_lock some. In addupc_intr(), use sched_lock to ensure pr_addr and pr_ticks are updated atomically with setting PS_OWEUPC. In ast() we clear pr_ticks atomically with clearing PS_OWEUPC. We also do not grab the lock just to test a flag. - Simplify the handling of Giant in ast() slightly. Reviewed by: bde (mostly)
* Make witness compile w/o DDB.jhb2001-08-101-1/+7
| | | | Reported by: wpaul
* Style cleanup.obrien2001-08-101-2/+2
|
* Arbitrarily limit to 64k the number of bytes that can be read atiedowse2001-08-102-0/+6
| | | | | | | a time using the ogetdirentries() compatibility syscall. This is a hack to ensure that rediculous values don't get passed to MALLOC(). Reviewed by: kris
* Work around a race between msleep() and endtsleep() where it was possiblejhb2001-08-101-3/+23
| | | | | | | | | for endtsleep() to be executing when msleep() resumed, for endtsleep() to spin on sched_lock long enough for the other process to loop on msleep() and sleep again resulting in endtsleep() waking up the "wrong" msleep. Obtained from: BSD/OS
* Change callout_stop() to return an integer. If callout_stop() succeeds injhb2001-08-102-3/+4
| | | | | | | | | | removing the callout entry, return 1. If callout_stop() fails to remove the callout entry because it is currently executing or has already been executed, then the function returns 0. The idea was obtained from BSD/OS, however, BSD/OS changed untimeout(), and I've just changed callout_stop() to be more conservative. Obtained from: BSD/OS
* Style nit: covert a couple of if (p_wchan) tests to if (p_wchan != NULL).jhb2001-08-101-3/+3
|
* mdoc(7) police: join split punctuation to macro calls.ru2001-08-101-2/+2
|
* Do NOT allocate a 1K buffer on the kernel stack.julian2001-08-101-2/+12
| | | | | Found by: Smashed u-area and hardware watch points. MFC after: 1 week
* Fix missing splx().yokota2001-08-101-0/+1
|
* Eliminate the hot-spare 'r' in Arrray.phk2001-08-101-1/+1
| | | | Submitted by: Søren Schrøder <sch@chaos.dk>
* DO NOT ALLOCATE 2+K OBJECTS ON THE KERNEL STACK!!!!julian2001-08-101-12/+25
| | | | found by: Getting my u-area overwritten
* - Remove asleep(), await(), and M_ASLEEP.jhb2001-08-102-15/+2
| | | | | | | | | - Callers of asleep() and await() have been converted to calling tsleep(). The only caller outside of M_ASLEEP was the ata driver, which called both asleep() and await() with spl-raised, so there was no need for the asleep() and await() pair. M_ASLEEP was unused. Reviewed by: jasone, peter
* - Remove asleep(), await(), and M_ASLEEP.jhb2001-08-101-9/+0
| | | | | | | | | - Callers of asleep() and await() have been converted to calling tsleep(). The only caller outside of M_ASLEEP was the ata driver, which called both asleep() and await() with spl-raised, so there was no need for the asleep() and await() pair. M_ASLEEP was unused. Reviewed by: jasone, peter
* - Remove asleep(), await(), and M_ASLEEP.jhb2001-08-107-220/+4
| | | | | | | | | - Callers of asleep() and await() have been converted to calling tsleep(). The only caller outside of M_ASLEEP was the ata driver, which called both asleep() and await() with spl-raised, so there was no need for the asleep() and await() pair. M_ASLEEP was unused. Reviewed by: jasone, peter
* Move ISA interrupt ISR and timeout routines to pcic from pcic_isa soimp2001-08-103-75/+73
| | | | | that we can use them in the pci code when we have to fall back to ISA interrupt routing.
* Type sanity: use uintptr_t * for read_ivar and u_int8_t instead of u_charimp2001-08-102-3/+3
|
* Rearrange the pcic_irq_type enum (and specifically tag the first oneimp2001-08-101-1/+1
| | | | as being 1) in anticipation of documentation.
* Bump MAXCOMLEN from 16 to 19 to take advantage of 32-bit alignment.jhb2001-08-102-2/+2
| | | | Approved by: peter, jasone
* Correct copyright language.jake2001-08-102-4/+4
|
* Add code to program the tick register and to setup its interrupt handler.jake2001-08-102-0/+99
|
* Add early code to support interrupts.jake2001-08-103-0/+164
|
* Fake up the frame pointers on a process's initial stack so they can bejake2001-08-101-9/+19
| | | | | | restored correctly from the trapframe. Submitted by: tmm
* Handle all types of mmu misses from user mode.jake2001-08-101-5/+16
| | | | Pass a context argument to tlb functions.
* Use the macro for getting the trap type from the trapframe.jake2001-08-101-25/+68
| | | | | | | | | | | | Only set sticks (and acquire sched_lock) on entry from user mode. Add handlers for all kinds of mmu misses, and for interrupts from user mode. Acquire Giant before calling into the vm system so this runs with invariants. Try to get the restrictions for page faults on user memory from kernel mode right. Only set pcb_onfault and return to the alternate return code if this is actually a fault on user memory from kernel mode.
* Store 8 bytes instead of 4 in suword. Use a temporary stack that's knownjake2001-08-102-4/+56
| | | | | | to be locked in the tlb for calling openfirmware. Submitted by: tmm
* Pass a context to tlb_store_slot, use a member(Sync) after setting thejake2001-08-101-7/+19
| | | | secondary context register.
* 1. Start the clock running early for testing.jake2001-08-101-7/+43
| | | | | | | | | | 2. Use the upcoming "tick" interface. 3. Save a call frame as well as a trap frame on proc0's initial stack. 4. Setup a pointer to the per-cpu interrupt queue. 5. Install the per-cpu pointer in interrupt and alternate globals as well. 6. Flush out setregs so exec works. Submitted by: tmm (3, 5, 6)
* Set the pil to something sane on startup.jake2001-08-102-0/+2
|
* Add definitions needed by new assembler code.jake2001-08-101-12/+20
|
* 1. Add code to handle traps and interrupts from user mode.jake2001-08-102-98/+970
| | | | | | | | | | | | 2. Add spill and fill handlers for spills to the user stack on entry to the kernel. 3. Add code to handle instruction mmu misses from user mode. 4. Add code to handle level interrupts from kernel mode and vectored interrupt traps from either. 5. Save the pil in the trapframe on entry from kernel mode and restore it on return. Submitted by: tmm (1, 2)
* Add code to handle stack traces that go all the way back to userland.jake2001-08-101-9/+26
| | | | | | Use a better algorithm for finding out if an address is in the kernel. Submitted by: tmm
* Add trap types for interrupts. Ad definitions to get the interrupt leveljake2001-08-101-5/+17
| | | | from the trap type.
* 1. Add code to demap pages from the tlb for user contexts.jake2001-08-101-20/+43
| | | | | | | 2. Add a context argument to most functions, instead of extracting it from from the tte. Submitted by: tmm (1).
* Add fields that point to per-cpu interrupt data.jake2001-08-102-0/+6
|
* Add a field to trapframe for saving the pil.jake2001-08-101-0/+1
|
* Add asis for interrupt registers.jake2001-08-101-0/+14
|
* Axe spl's obsoleted by the callout mutex.jhb2001-08-101-26/+4
|
* Fix unaligned access (fault) on alpha with ndp -p/-r and sysctl -a.simokawa2001-08-101-2/+2
| | | | | | Discussed on users@jp.ipv6.org MFC candidate.
OpenPOWER on IntegriCloud