summaryrefslogtreecommitdiffstats
path: root/sys/ia64
Commit message (Collapse)AuthorAgeFilesLines
* - Protect the callout wheel with a separate spin mutex, callout_lock.jake2000-11-191-0/+2
| | | | | | | | | | | - Use the mutex in hardclock to ensure no races between it and softclock. - Make softclock be INTR_MPSAFE and provide a flag, CALLOUT_MPSAFE, which specifies that a callout handler does not need giant. There is still no way to set this flag when regstering a callout. Reviewed by: -smp@, jlemon
* - Split the run queue and sleep queue linkage, so that a processjake2000-11-171-1/+1
| | | | | | | | | may block on a mutex while on the sleep queue without corrupting it. - Move dropping of Giant to after the acquire of sched_lock. Tested by: John Hay <jhay@icomtek.csir.co.za> jhb
* Don't release and acquire Giant in mi_switch(). Instead, release andjhb2000-11-161-0/+2
| | | | | | | | acquire Giant as needed in functions that call mi_switch(). The releases need to be done outside of the sched_lock to avoid potential deadlocks from trying to acquire Giant while interrupts are disabled. Submitted by: witness
* Don't perform an mi_switch() when we release Giant during cpu_exit(). Wejhb2000-11-151-1/+2
| | | | | | are about to call cpu_switch() anyways. Found by: witness
* Make MINSIGSTKSZ machine dependent, and have the sigaltstackmarcel2000-11-091-0/+6
| | | | | | | | | | | | | | | | | | | | | | syscall compare against a variable sv_minsigstksz in struct sysentvec as to properly take the size of the machine- and ABI dependent struct sigframe into account. The SVR4 and iBCS2 modules continue to have a minsigstksz of 8192 to preserve behavior. The real values (if different) are not known at this time. Other ABI modules use the real values. The native MINSIGSTKSZ is now defined as follows: Arch MINSIGSTKSZ ---- ----------- alpha 4096 i386 2048 ia64 12288 Reviewed by: mjacob Suggested by: bde
* Convert all users of fldoff() to offsetof(). fldoff() is badphk2000-10-272-2/+5
| | | | | | | | | | | | | | | | | | | | | | | because it only takes a struct tag which makes it impossible to use unions, typedefs etc. Define __offsetof() in <machine/ansi.h> Define offsetof() in terms of __offsetof() in <stddef.h> and <sys/types.h> Remove myriad of local offsetof() definitions. Remove includes of <stddef.h> in kernel code. NB: Kernelcode should *never* include from /usr/include ! Make <sys/queue.h> include <machine/ansi.h> to avoid polluting the API. Deprecate <struct.h> with a warning. The warning turns into an error on 01-12-2000 and the file gets removed entirely on 01-01-2001. Paritials reviews by: various. Significant brucifications by: bde
* As the blocking model has seems to be troublesome for many, disablemarkm2000-10-271-0/+1
| | | | | | | it for now with an option. This option is already deprecated, and will be removed when the entropy-harvesting code is fast enough to warrant it.
* Minor build fixes.dfr2000-10-264-3/+4
|
* - Overhaul the software interrupt code to use interrupt threads for eachjhb2000-10-256-71/+4
| | | | | | | | | | | | | | | | | | | type of software interrupt. Roughly, what used to be a bit in spending now maps to a swi thread. Each thread can have multiple handlers, just like a hardware interrupt thread. - Instead of using a bitmask of pending interrupts, we schedule the specific software interrupt thread to run, so spending, NSWI, and the shandlers array are no longer needed. We can now have an arbitrary number of software interrupt threads. When you register a software interrupt thread via sinthand_add(), you get back a struct intrhand that you pass to sched_swi() when you wish to schedule your swi thread to run. - Convert the name of 'struct intrec' to 'struct intrhand' as it is a bit more intuitive. Also, prefix all the members of struct intrhand with 'ih_'. - Make swi_net() a MI function since there is now no point in it being MD. Submitted by: cp
* Implement atomic_{set,clear,add,subtract}_{acq_,rel_,}_ptr()jhb2000-10-251-12/+26
|
* * Various fixes to breakage introduced by the atomic and mutex reorgs.dfr2000-10-2414-86/+173
| | | | | | | * Fixes to the signal delivery code. Not quite right yet. I would have preferred to wait until I have signal delivery actually working but the current kernel in CVS doesn't build.
* Adjust commentsobrien2000-10-242-8/+20
| | | | | | | Submitted by: bde Add ISO C99's long long type limits. Reviewed by: bde
* CURTHD now defines in globals.hmjacob2000-10-231-0/+2
|
* Define the mtx_legal2block() macro used in the witness code that managedjhb2000-10-201-0/+2
| | | | | | to get lost during the MI mutex conversion. Reported by: Steve Kargl <sgk@troutmask.apl.washington.edu>
* - machine/mutex.h -> sys/mutex.hjhb2000-10-201-1/+1
| | | | | - Catch up to the MI mutex structure due to saveflags,saveipl,savepsr becoming saveintr.
* - machine/mutex.h -> sys/mutex.hjhb2000-10-201-4/+4
| | | | - Use MUTEX_DECLARE() and MTX_COLD for Giant and sched_lock.
* - Make the mutex code almost completely machine independent. This greatlyjhb2000-10-202-1032/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | reducues the maintenance load for the mutex code. The only MD portions of the mutex code are in machine/mutex.h now, which include the assembly macros for handling mutexes as well as optionally overriding the mutex micro-operations. For example, we use optimized micro-ops on the x86 platform #ifndef I386_CPU. - Change the behavior of the SMP_DEBUG kernel option. In the new code, mtx_assert() only depends on INVARIANTS, allowing other kernel developers to have working mutex assertiions without having to include all of the mutex debugging code. The SMP_DEBUG kernel option has been renamed to MUTEX_DEBUG and now just controls extra mutex debugging code. - Abolish the ugly mtx_f hack. Instead, we dynamically allocate seperate mtx_debug structures on the fly in mtx_init, except for mutexes that are initiated very early in the boot process. These mutexes are declared using a special MUTEX_DECLARE() macro, and use a new flag MTX_COLD when calling mtx_init. This is still somewhat hackish, but it is less evil than the mtx_f filler struct, and the mtx struct is now the same size with and without mutex debugging code. - Add some micro-micro-operation macros for doing the actual atomic operations on the mutex mtx_lock field to make it easier for other archs to override/optimize mutex ops if needed. These new tiny ops also clean up the code in some places by replacing long atomic operation function calls that spanned 2-3 lines with a short 1-line macro call. - Don't call mi_switch() from mtx_enter_hard() when we block while trying to obtain a sleep mutex. Calling mi_switch() would bogusly release Giant before switching to the next process. Instead, inline most of the code from mi_switch() in the mtx_enter_hard() function. Note that when we finally kill Giant we can back this out and go back to calling mi_switch().
* - Expand the set of atomic operations to optionally include memory barriersjhb2000-10-201-57/+207
| | | | | | | | | | | | | | | | | | | | | | | | | | in most of the atomic operations. Now for these operations, you can use the normal atomic operation, you can use the operation with a read barrier, or you can use the operation with a write barrier. The function names follow the same semantics used in the ia64 instruction set. An atomic operation with a read barrier has the extra suffix 'acq', due to it having "acquire" semantics. An atomic operation with a write barrier has the extra suffix 'rel'. These suffixes are inserted between the name of the operation to perform and the typename. For example, the atomic_add_int() function now has 3 variants: - atomic_add_int() - this is the same as the previous function - atomic_add_acq_int() - this function combines the add operation with a read memory barrier - atomic_add_rel_int() - this function combines the add operation with a write memory barrier - Add 'ptr' to the list of types that we can perform atomic operations on. This allows one to do atomic operations on uintptr_t's. This is useful in the mutex code, for example, because the actual mutex lock is a pointer. - Add two new operations for doing loads and stores with memory barriers. The new load operations use a read barrier before the load, and the new store operations use a write barrier after the load. For example, atomic_load_acq_int() will atomically load an integer as well as enforcing a read barrier.
* Axe the barrier_{read,write,rw}() helper functions as this method ofjhb2000-10-201-23/+0
| | | | | | | doing memory barriers doesn't really scale well for the ia64. Also, memory barriers are more a property of the CPU than bus space. Requested by: dfr
* Don't force bootverbose anymore.dfr2000-10-191-2/+1
|
* Decrease the number of ticks between clock interrupts by a factor of tendfr2000-10-191-1/+1
| | | | to place more pressure on the exception handling code.
* * Disable interrupts when restoring a trapframe.dfr2000-10-192-4/+8
| | | | | * Make sure we reset ar.k6 (used to hold the kernel stack pointer when we are returning to user mode after a syscall.
* Add in a simple API for memory barriers to machine/bus.h:jhb2000-10-181-0/+22
| | | | | | - barrier_read() enforces a memory read barrier - barrier_write() enforces a memory write barrier - barrier_rw() enforces a memory read/write barrier
* Implement write combining for crashdumps. This is useful whenps2000-10-172-2/+3
| | | | | | | | | | | | | | | | | | write caching is disabled on both SCSI and IDE disks where large memory dumps could take up to an hour to complete. Taking an i386 scsi based system with 512MB of ram and timing (in seconds) how long it took to complete a dump, the following results were obtained: Before: After: WCE TIME WCE TIME ------------------ ------------------ 1 141.820972 1 15.600111 0 797.265072 0 65.480465 Obtained from: Yahoo! Reviewed by: peter
* In pmap_remove_pv(), only manipulate the page's list if the pv isdfr2000-10-161-1/+1
| | | | managed.
* Do a full exception_restore after an execve syscall to ensure that thedfr2000-10-162-0/+10
| | | | new program gets the right values for its arguments etc.
* Clear the register stack frame before using loadrs to invalidate thedfr2000-10-161-0/+1
| | | | stacked registers.
* Clear ar.pfs for the child process in cpu_fork - switch_trampolinedfr2000-10-161-0/+1
| | | | doesn't want a stack frame.
* Track changes to trapframe.dfr2000-10-161-3/+3
|
* * Correct some of my misunderstandings about how best to switch to thedfr2000-10-169-111/+525
| | | | | | | | | | | kernel backing store. * Implement syscalls via break instructions. * Fix backing store copying in cpu_fork() so that the child gets the right register values. This thing is actually starting to work now. This set of changes takes me up to the second execve (the one which runs the first shell). Next stop single-user mode :-).
* Use the right mask for extracting sof from cr.ifs.dfr2000-10-161-1/+1
|
* Remember to re-initialise cr.itm on clock interrupts so that we get moredfr2000-10-162-14/+4
| | | | than just one tick.
* Merge a fix from the alpha port - put softintr in the right place in thedfr2000-10-161-1/+1
| | | | table.
* Give names to app registers and control registers. Fix a typo handlingdfr2000-10-161-65/+65
| | | | mov from branch register instructions.
* Move DELAY() from <machine/clock.h> to <sys/systm.h>phk2000-10-151-1/+0
|
* Implement a rudimentary interrupt handling system which should be gooddfr2000-10-128-79/+96
| | | | enough for clock interrupts in SKI.
* Turn off a debugging printf.dfr2000-10-121-2/+3
|
* * Fix exception handling so that it actually works. We can now handledfr2000-10-1216-447/+605
| | | | | | | | | | | | | | | | exceptions from both kernel and user mode. * Fix context switching so that we can switch back to a proc which we switched away from (we were saving the state in the wrong place). * Implement lazy switching of the high-fp state. This needs to be looked at again for SMP to cope with the case of a process migrating from one processor to another while it has the high-fp state. * Make setregs() work properly. I still think this should be called cpu_exec() or something. * Various other minor fixes. With this lot, we can execve() /sbin/init and we get all the way up to its first syscall. At that point, we stop because syscall handling is not done yet.
* Fix this so that it can cope with transfers to/from regions which are notdfr2000-10-121-6/+22
| | | | physically contiguous.
* * Allocate kernel stacks with contigmalloc() to make exception handlingdfr2000-10-121-68/+34
| | | | | | safe - we can't afford to take a TLB trap when we are writing a trapframe. Possibly revisit this later. * Various fixes to pmap_enter() so that it actually works properly.
* Some minor fixes and simplifications.dfr2000-10-121-29/+29
|
* * Add rudimentary DDB support (no kgdb, no backtrace, no single step).dfr2000-10-1022-428/+5595
| | | | | | * Track recent changes to SWI code. * Allocate RIDs for pmaps (untested). * Implement assembler version of cpu_switch - its cleaner that way.
* Initiate deorbit burn sequence for <machine/mouse.h>.phk2000-10-091-334/+4
| | | | | | | | | | Replace all in-tree uses with <sys/mouse.h> which repo-copied a few moments ago from src/sys/i386/include/mouse.h by peter. This is also the appropriate fix for exo-tree sources. Put warnings in <machine/mouse.h> to discourage use. November 15th 2000 the warnings will be converted to errors. January 15th 2001 the <machine/mouse.h> files will be removed.
* Initiate deorbit burn sequence for <machine/console.h>.phk2000-10-081-0/+4
| | | | | | | | | Replace all in-tree uses with necessary subset of <sys/{fb,kb,cons}io.h>. This is also the appropriate fix for exo-tree sources. Put warnings in <machine/console.h> to discourage use. November 15th 2000 the warnings will be converted to errors. January 15th 2001 the <machine/console.h> files will be removed.
* Cleanup comment in machine/param.h regarding mbuf-related sizes, and get ridbmilekic2000-10-081-8/+6
| | | | | of MCLOFSET, which does not appear to be used anywhere anymore, and if it is, it probably shouldn't be.
* Work around a bug by adding struct tags. gcc-2.95 apparently gets thebde2000-10-061-2/+2
| | | | | | | | | check in the [basic.link] section of the C++ standard wrong. gcc-2.7.2.3 apparently doesn't do the check, so the bug doesn't affect RELENG_3. PR: 16170, 21427 Submitted by: Max Khon <fjoe@lark.websci.ru> (i386 version) Discussed with: jdp
* Reduce userland namespace polution.jasone2000-10-061-2/+4
| | | | #include <proc.h>, since curproc is needed.
* Next round of fixes to the ia64 code. This includes simulated clock anddfr2000-10-0428-419/+959
| | | | | | | disk drivers along with a load of fixes to context switching, fork handling and a load of other stuff I can't remember now. This takes us as far as start_init() before it dies. I guess now I will have to finish off the VM system and syscall handling :-).
* Next round of ia64 work, including fixes to context switching,dfr2000-09-3019-1157/+854
| | | | | implementing cpu_fork(), copy*str(), bcopy(), copy{in,out}(). With these changes, my test kernel reaches the mountroot prompt.
* Ansify and fix warnings.dfr2000-09-291-14/+6
|
OpenPOWER on IntegriCloud