Commit graph

1033 commits

Author SHA1 Message Date
Andrew Gallatin b36abb04e5 Move the linux abi's alpha md files over to using David's build-time
syscall generation method
2000-11-01 23:07:25 +00:00
Andrew Gallatin e70ce4d9c5 fix linux_termio and linux_termios structs on alpha. alpha differences
are in the termios struct (probably because linux wants to be compatible
with the osf/1 termios struct), not the termio struct.
2000-11-01 22:36:41 +00:00
John Baldwin a07b7a4e35 Pass in the new-bus flags to alpha_setup_intr(). 2000-11-01 18:40:42 +00:00
John Baldwin 90652ed180 - Modify alpha_setup_intr() to take interrupt handler flags as an additional
argument.  These flags include INTR_FAST, INTR_MPSAFE, etc.
- Properly handle INTR_EXCL when it is passed in to allow an interrupt
  handler to claim exclusive ownership of an interrupt thread.
- Add support for psuedo-fast interrupts on the alpha.  For fast interrupts,
  we don't allocate an interrupt thread; instead, during dispatching of an
  interrupt, we run the handler directly instead of scheduling the thread
  to run.  Note that the handler is currently run without Giant and must be
  MP safe.  The only fast handler currently is for the sio driver.

Requested by:	dfr
2000-11-01 18:40:02 +00:00
David E. O'Brien ac4c54948c Apply style(9). 2000-11-01 16:38:40 +00:00
David E. O'Brien 7b4cc3fd44 Minimal set of diffs from the i386 bits to the AlphaLinux.
(based on a patch to sys/i386/linux/linux_dummy.c by gallatin)
2000-11-01 16:34:16 +00:00
David E. O'Brien 23d3a6fe6e Need to dummy-out rt_sigreturn.
submitted by:	gallatin
2000-11-01 08:52:24 +00:00
David E. O'Brien 60f618a04d Need to include sys/proc.h. 2000-11-01 08:49:48 +00:00
David E. O'Brien 727fba5373 I don't know why this used to compile for me, but now struct
linux_sigcontext seems to have changed and some members are gone.
2000-11-01 08:48:53 +00:00
David E. O'Brien 83d2913008 Make the target a little bit more generic. 2000-11-01 08:47:34 +00:00
Matt Jacob 2170c2d960 Remember to decrement interrupt nesting level if leaving early
(in the unlikely case we get a clock interrupt on a non-primary CPU).
2000-10-30 04:18:54 +00:00
Andrew Gallatin a415ada785 remove a stddef.h missed by phk 2000-10-27 18:57:31 +00:00
Matt Jacob 657e6b0d78 Add M_ZERO to malloc calls where the result is just bzeroed.
PR:		22188
Submitted (partially) by:	josh@zipperup.org
2000-10-27 16:36:26 +00:00
Poul-Henning Kamp 46aa3347cb Convert all users of fldoff() to offsetof(). fldoff() is bad
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
2000-10-27 11:45:49 +00:00
Roger Hardiman 5d4152e3e8 Merge from i386: Add MSP ioctl 2000-10-27 07:07:24 +00:00
Mark Murray 5f3431b5ad As the blocking model has seems to be troublesome for many, disable
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.
2000-10-27 06:06:04 +00:00
Andrew Gallatin 382e2ab4b1 add a version tag for the alpha linulator to depend on 2000-10-26 16:31:29 +00:00
Andrew Gallatin af06b8d8a5 Update osf1_setuid() and osf1_setgid() to use the new change_euid() and
change_ruid() in kern_prot.c.  This fixes an incorrect use
of chgproccnt().

Update both osf1_setuid() and osf1_setgid() to use setsugid() instead
of just frobbing the flag.

(mostly) submitted by: truckman
2000-10-26 15:53:00 +00:00
John Baldwin 8088699f79 - Overhaul the software interrupt code to use interrupt threads for each
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
2000-10-25 05:19:40 +00:00
Andrew Gallatin 2acbb2b129 fix bogus cast in osf1_getrlimit/osf1_setrlimit 2000-10-25 00:37:34 +00:00
John Baldwin 2a1c4d6378 Only use 1 set of memory barrier operations with the atomic_*_{acq,rel}_ptr
functions.
2000-10-25 00:15:21 +00:00
Andrew Gallatin 785640153d teach the osf1_getsysinfo() function about a few more fields
submitted by: Jim.Pirzyk@disney.com
PR: alpha/22263
2000-10-25 00:14:11 +00:00
David E. O'Brien 2d26708326 Adjust comments
Submitted by:	bde

Add ISO C99's long long type limits.
Reviewed by:	bde
2000-10-24 10:49:56 +00:00
Matt Jacob eb661345a9 Move bogus proc reference stuff into <machine/globals.h>. There is no
more include file including <sys/proc.h>, but there still is this wonky
and (causes warnings on i386) reference in globals.h.

CURTHD is now defined in <machine/globals.h> as well. The correct thing
to do is provide a platform function for this.
2000-10-23 18:36:03 +00:00
David E. O'Brien 45428438f7 Apply style(9). [best I could] 2000-10-23 08:46:25 +00:00
David E. O'Brien e413f7bf97 Apply style(9).
(best I could)
2000-10-23 08:36:59 +00:00
David E. O'Brien 30e3f60f75 Sort the #define's. 2000-10-23 08:29:04 +00:00
David E. O'Brien 683713f8e9 Minimal set of diffs from the i386 bits to the AlphaLinux. 2000-10-23 08:15:58 +00:00
David E. O'Brien d1121275d5 Re-order the #define's into a more logical one. 2000-10-23 08:13:19 +00:00
David E. O'Brien 2159c8905f We need to explicitly tell the args struct for COMPAT functions we use
that use the same args struct as their non-COMPAT counter parts.
2000-10-23 02:20:01 +00:00
David E. O'Brien b608e3ff66 Somehow I left out sycall #98 2000-10-22 21:47:07 +00:00
David E. O'Brien dd3ccfd92e Minor whitespace cleanup. 2000-10-22 21:42:03 +00:00
David E. O'Brien 8c2c12607a Minimal set of diffs from the i386 bits to the AlphaLinux.
Submitted by:	gallatin (content, minimization by me)
2000-10-22 21:36:27 +00:00
John Baldwin bd4635599d Define the mtx_legal2block() macro used in the witness code that managed
to get lost during the MI mutex conversion.

Reported by:    Steve Kargl <sgk@troutmask.apl.washington.edu>
2000-10-20 22:44:06 +00:00
John Baldwin 9aea17a792 Fix a braino in the ASS_SIEN() macro in the MUTEX_DEBUG case by using
mtx_saveintr instead of saveintr.
2000-10-20 20:27:12 +00:00
John Baldwin 8a6149a3a3 Don't bother setting the saved IPL in the sched_lock mutex as it doesn't
really do anything since the first mtx_enter() will overwrite the value
saved here.
2000-10-20 20:14:55 +00:00
John Baldwin 8cc99fae9a Catch up to some of the changes to _getlock_spin_block. Specifically,
use _obtain_lock() instead of a manual atomic_cmpset_ptr.
2000-10-20 19:54:47 +00:00
John Baldwin bb352e20a2 Grrrr. Fix the order of the #define's so atomic_cmpset_{acq,rel}_long
are defined before atomic_cmpset_{acq,rel}_ptr tries to call them.
2000-10-20 19:53:52 +00:00
John Baldwin 6d02703c2f Fix the atomic_cmpset_{acq,rel}_ptr() functions to do proper type-casting. 2000-10-20 19:46:02 +00:00
John Baldwin 35e0e5b311 Catch up to moving headers:
- machine/ipl.h -> sys/ipl.h
- machine/mutex.h -> sys/mutex.h
2000-10-20 07:58:15 +00:00
John Baldwin bce7f05af8 - machine/mutex.h -> sys/mutex.h
- Catch up to the MI mutex structure due to saveflags,saveipl,savepsr
  becoming saveintr.
2000-10-20 07:38:44 +00:00
John Baldwin 557b927eca - machine/mutex.h -> sys/mutex.h
- Use MUTEX_DECLARE() and MTX_COLD for Giant and sched_lock.
2000-10-20 07:32:48 +00:00
John Baldwin 36412d79b4 - Make the mutex code almost completely machine independent. This greatly
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().
2000-10-20 07:26:37 +00:00
John Baldwin ccbdd9ee59 - Expand the set of atomic operations to optionally include memory barriers
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.
2000-10-20 07:00:48 +00:00
John Baldwin 3f4809dd0d Axe the barrier_{read,write,rw}() helper functions as this method of
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
2000-10-20 06:45:48 +00:00
John Baldwin 25f3f7c530 Add in a simple API for memory barriers to machine/bus.h:
- barrier_read() enforces a memory read barrier
- barrier_write() enforces a memory write barrier
- barrier_rw() enforces a memory read/write barrier
2000-10-18 10:30:12 +00:00
Paul Saab c794ceb56a Implement write combining for crashdumps. This is useful when
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
2000-10-17 10:05:49 +00:00
Andrew Gallatin 7936339495 A start at an implemention of linux_rt_sendsig & linux_rt_sigreturn
and associated user-level signal trampoline glue.

Without this patch, an SA_SIGINFO style handler can be installed by a linux
app, but if the handler accesses its sip argument, it will get a garbage
pointer and likely segfault.

We currently supply a valid pointer, but its contents are mainly
garbage.  Filling this in properly is future work.

This is the second of 3 commits that will get IBM's JDK 1.3 working with
FreeBSD ...
2000-10-17 00:00:20 +00:00
Andrew Gallatin 1e78526274 Fix problems booting large kernels on alphas. The symptom is that the kernel
loads, prints the copyright, and either hangs or locks solid.  The
PC tends to be in the data segment and the RA is in XentMM

Doug really came up with the fix, I'm just the monkey typing.  Doug says:
	The alpha can only support 64k of globals with $gp pointing at
	base+32k so that the code can use 16bit signed offsets from $gp to
	access it. ....  it is possible to have multiple .got subsections
	and the linker handles this with the relocations for 'ldgp' pseudo
	instructions.  [Without this patch] the code in exception.s has been
	linked  to use a different gp from locore.s (where pal_kgp is set).

Reviewed by: dfr
2000-10-16 20:15:43 +00:00
Poul-Henning Kamp 398bc678aa Move DELAY() from <machine/clock.h> to <sys/systm.h> 2000-10-15 09:51:49 +00:00