Commit Graph

347 Commits

Author SHA1 Message Date
Mike Barcroft
0ac2d551f2 o Add new header <sys/stdint.h>.
o Make <stdint.h> a symbolic link to <sys/stdint.h>.
o Move most of <sys/inttypes.h> into <sys/stdint.h>, as per C99.
o Remove <sys/inttypes.h>.
o Adjust includes in sys/types.h and boot/efi/include/ia64/efibind.h
  to reflect new location of integer types in <sys/stdint.h>.
o Remove previously symbolicly linked <inttypes.h>, instead create a
  new file.
o Add MD headers <machine/_inttypes.h> from NetBSD.
o Include <sys/stdint.h> in <inttypes.h>, as required by C99; and
  include <machine/_inttypes.h> in <inttypes.h>, to fill in the
  remaining requirements for <inttypes.h>.
o Add additional integer types in <machine/ansi.h> and
  <machine/limits.h> which are included via <sys/stdint.h>.

Partially obtain from:	NetBSD
Tested on:		alpha, i386
Discussed on:		freebsd-standards@bostonradio.org
Reviewed by:		bde, fenner, obrien, wollman
2001-11-02 18:05:43 +00:00
Matt Jacob
831039f850 Detach the prom console when platform.cons_init is called. This seems
to avoid most of the double character kernel goop we've been having by having
both a prom console && a normal console.

Was not able to test with graphics head. Hope this doesn't break anything.

Reviewed by:	silence on alpha
2001-10-26 16:13:47 +00:00
Mike Barcroft
3a72286480 Remove funky right justification.
Pointed out by:	bde
2001-10-23 00:42:15 +00:00
Dag-Erling Smørgrav
1f04261973 [partially forced commit due to pilot error in earlier commit attempt]
{set,fill}_{,fp,db}regs() fixup:

 - Add dummy {set,fill}_dbregs() on architectures that don't have them.

 - KSEfy the powerpc versions (struct proc -> struct thread).

 - Some architectures had the prototypes in md_var.h, some in reg.h, and
   some in both; for consistency, move them to reg.h on all platforms.

These functions aren't really MD (the implementation is MD, but the interface
is MI), so they should move to an MI header, but I haven't figured out which
one yet.

Run-tested on i386, build-tested on Alpha, untested on other platforms.
2001-10-21 22:16:48 +00:00
David E. O'Brien
9f9bd82e15 Try two on the preprocessing logic.
Reviewed by:	ru
2001-10-19 20:01:01 +00:00
David E. O'Brien
4b16cf4f8a Blah, fix braino where ru had to remind me of proper preprocessor syntax.
Bad fingers, no cookie.
2001-10-19 19:17:11 +00:00
David E. O'Brien
e3ddd70789 My attempts at minimizing the number of #def's got me in trouble. 2001-10-18 16:07:21 +00:00
David E. O'Brien
4a3391b5a1 Add support for "__gnuc_va_list". Some overly "smart" libraries assume
the existence of the __gnuc_va_list type[*] because our compiler is GCC.

[*] __gnuc_va_list is defined in the GCC ginclude/stdarg.h replacement
headerwhich we don't use.
2001-10-18 00:27:39 +00:00
David E. O'Brien
a3fc3de448 Sync comments with i386. 2001-10-18 00:00:31 +00:00
Paul Saab
cbc89bfbfe Make MAXTSIZ, DFLDSIZ, MAXDSIZ, DFLSSIZ, MAXSSIZ, SGROWSIZ loader
tunable.

Reviewed by:	peter
MFC after:	2 weeks
2001-10-10 23:06:54 +00:00
John Baldwin
fd54558a83 - If we ever do the per-cpu KTR stuff, the index won't be volatile as it
will be private to each CPU.
- Re-style(9) the globaldata structures.  There really needs to be a MI
  struct pcpu that has a MD struct mdpcpu member at some point.
2001-09-18 21:46:26 +00:00
John Baldwin
855cda2e3b Whitespace fixes. 2001-09-12 22:00:06 +00:00
John Baldwin
21b1f10ade Style(9) fixes. 2001-09-12 21:57:30 +00:00
John Baldwin
2b2aea6c2f Restore style(9) fixes from commit prior to previous commit. 2001-09-12 21:56:28 +00:00
Julian Elischer
b40ce4165d KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

Sorry john! (your next MFC will be a doosie!)

Reviewed by: peter@freebsd.org, dillon@freebsd.org

X-MFC after:    ha ha ha ha
2001-09-12 08:38:13 +00:00
David E. O'Brien
1792335469 style(9) the structure definitions. 2001-09-05 01:36:46 +00:00
Mike Barcroft
03516cfeb0 o Remove some GCCisms in src/powerpc/include/endian.h.
o Unify <machine/endian.h>'s across all architectures.
o Make bswapXX() functions use a different spelling of u_int16_t and
  friends to reduce namespace pollution.  The bswapXX() functions
  don't actually exist, but we'll probably import these at some
  point.  Atleast one driver (if_de) depends on bswapXX() for big
  endian cases.
o Deprecate byteorder(3) prototypes from <sys/types.h>, these are
  now prototyped indirectly in <arpa/inet.h>.
o Deprecate in_addr_t and in_port_t typedefs in <sys/types.h>, these
  are now typedef'd in <arpa/inet.h>.
o Change byteorder(3) prototypes to use standards compliant uint32_t
  (spelled __uint32_t to reduce namespace pollution).
o Document new preferred headers and standards compliance.

Discussed with:	bde
PR:		29946
Reviewed by:	bmilekic
2001-08-30 00:04:19 +00:00
Peter Wemm
547a9e66fd vm_page_zero_idle() is no longer MD. 2001-08-25 04:54:25 +00:00
Peter Wemm
95a6562598 Strip out some #if's for old implementations of global data pointers. 2001-08-21 22:14:13 +00:00
John Baldwin
a71c43dd2b Protect prototype of ptrace_clear_single_step() with #ifdef _KERNEL/#endif.
Requested by:	bde
2001-08-21 13:42:39 +00:00
John Baldwin
be08df7290 Remove redundant declarations of functions that are declared in
sys/ptrace.h.
2001-08-18 00:57:32 +00:00
David E. O'Brien
e113a479b2 Prototype the ptrace_*() 2001-08-16 19:57:36 +00:00
David E. O'Brien
589278dbae style(9) and make consistent across platforms 2001-08-16 09:29:35 +00:00
Andrey A. Chernov
2a54e09dff OFF_T -> OFF (more standard style) 2001-08-15 19:50:59 +00:00
Andrey A. Chernov
527b997c3d Add OFF_T_MAX/OFF_T_MIN 2001-08-15 19:12:46 +00:00
David E. O'Brien
059d1e91d8 Style changes to commonize the various platforms. 2001-08-15 04:02:41 +00:00
John Baldwin
6937ca29dc Remove IPI_HALT to make way for a more correct fix for halts and restarts
on SMP alphas.
2001-08-13 22:41:15 +00:00
John Baldwin
688ebe120c - Close races with signals and other AST's being triggered while we are in
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)
2001-08-10 22:53:32 +00:00
Peter Wemm
2aca0c28d3 Zap 'ptrace(PT_READ_U, ...)' and 'ptrace(PT_WRITE_U, ...)' since they
are a really nasty interface that should have been killed long ago
when 'ptrace(PT_[SG]ETREGS' etc came along.  The entity that they
operate on (struct user) will not be around much longer since it
is part-per-process and part-per-thread in a post-KSE world.

gdb does not actually use this except for the obscure 'info udot'
command which does a hexdump of as much of the child's 'struct user'
as it can get.  It carries its own #defines so it doesn't break
compiles.
2001-08-08 05:25:15 +00:00
Jake Burkholder
7e5102989e Use a machine dependent type, Elf_Hashelt, for the elements of the elf
dynamic symbol table buckets and chains.  The sparc64 toolchain uses 32
bit .hash entries, unlike other 64 bits architectures (alpha), which use
64 bit entries.

Discussed with: dfr, jdp
2001-07-31 03:46:39 +00:00
Doug Rabson
d4127edb9d Simplify the implementation of pmap_emulate_reference(). The new version
simply manipulates the pte which faulted instead of traversing the mapping
list for that page. This makes it possible to complete the trap without
needing locks and incidentally improves the accuracy of some statistics
used by the VM system.
2001-07-24 07:13:07 +00:00
Matt Jacob
8f01c08a34 Fix reboot hangs that have happened with multiple processors
on Alpha 4100s.

Basically, if you're halting or you're rebooting, you should
tell all other processors to halt first. Define IPI_HALT- IPI_STOP
is not what we want for this purpose, which will call prom_halt(0)
on receipt.

The processor running the halt or reboot wil send an IPI_HALT to all
other processors, delay a bit, then continue to do what what it was
planning on doing (prom_halt({0|1})).
2001-07-14 21:37:57 +00:00
Matt Jacob
d99b6ac2d7 Follow Bruce's suggestions. They're probably wrong, but better than before. 2001-07-04 05:16:56 +00:00
John Baldwin
7aa7260e4a Move ast() and userret() to sys/kern/subr_trap.c now that they are MI. 2001-06-29 19:51:37 +00:00
John Baldwin
6be523bca7 Add a new MI pointer to the process' trapframe p_frame instead of using
various differently named pointers buried under p_md.

Reviewed by:	jake (in principle)
2001-06-29 11:10:41 +00:00
John Baldwin
49f886f5d3 Be conservative and always perform an mb after an atomic_cmpset operation. 2001-06-22 21:13:20 +00:00
Andrew Gallatin
4d38dc6689 Use struct device * rather than device_t for (*pci_intr_route args), so
as to match other prototypes in the file.
2001-06-11 18:19:44 +00:00
David E. O'Brien
f9b58b41a3 Fix style of defines. 2001-06-09 05:21:17 +00:00
Andrew Gallatin
8c8fdd1fa2 Sync up to v 1.9 of NetBSD's db_trace.c to get access to the
greatly improved traceback code from Ross Harvey.  This code
requires the use of more traceback friendly temporary labels
at kernel entry points, hence the changes to exception.s and
asm.h

Reviewed by: jhb, dfr
Obtained from: NetBSD
MFC after: 1 week
2001-06-08 13:38:02 +00:00
Joerg Wunsch
e774b25111 Nuke the various poorly maintained copies of ioctl_fd.h. The file is
not machine-dependant, thus it has been moved out (repo-copied) into
<sys/fdcio.h>.
2001-06-06 06:15:03 +00:00
Poul-Henning Kamp
0d31cbfab7 Properly wrap mtx_intr_enable() macro in "do $bla while (0)" 2001-06-02 08:17:42 +00:00
Andrew Gallatin
150cd07213 Resurrect platform.pci_intr_map() and essentially undo the effects of
the interface conversion to platform.pci_intr_route().  I've left the
platform.pci_intr_route() function pointer in place, as well as
alpha_pci_route_interrupt(), but no platform currently implements it.

To work around the removal of alpha_platform_assign_pciintr(cfg);
from the pci probe code, I've hooked in calls to platform.pci_intr_map()
in pcib_read_config (similar to the x86 APIC_IO ifdef in pci_cfgregread)
for every chipset that has a platform which needs it.

While here, I've removed the interupt mapping/routing code from the
AS2x00 platform because its not required (it has never been present in
-stable).

Tested on: UP1000, Miata(GL), XP1000, AS2100, AS500
2001-06-01 17:39:11 +00:00
Thomas Moestl
d279178df7 Clean up the code exporting interrupt statistics via sysctl a bit:
- move the sysctl code to kern_intr.c
- do not use INTRCNT_COUNT, but rather eintrcnt - intrcnt to determine
  the length of the intrcnt array
- move the declarations of intrnames, eintrnames, intrcnt and eintrcnt
  from machine-dependent include files to sys/interrupt.h
- remove the hw.nintr sysctl, it is not needed.
- fix various style bugs

Requested by:	bde
Reviewed by:	bde (some time ago)
2001-06-01 13:23:28 +00:00
David E. O'Brien
dfbe5c12ae One needs to introduce things with a `.file' directive before trying to
do a .loc on it.  BTW, the .loc needs to be in a .text section.
gas 2.11.0 catches these oversights where previous versions did not.
2001-05-28 09:52:21 +00:00
David E. O'Brien
ef76752043 Style changes -- revert ordering to mostly two revs ago.
Embellish some comments, fix tab'ing.

Requested by:	bde
2001-05-18 01:40:40 +00:00
David E. O'Brien
0dfc89c188 Consistently define the rune types.
Follow NetBSD's lead and add a _BSD_MBSTATE_T_ type.
2001-05-16 22:32:44 +00:00
David E. O'Brien
1123bf8862 Move the int typedefs to the top so they can be used in defining other types.
Ensure every platform has __offsetof.
Make multiple inclusion detection consistent with other
  <platform>/include/*.h files.
2001-05-16 22:21:43 +00:00
John Baldwin
dec54ac5b5 "Sir, the deorbit burn completed succesfully."
RIP {sys/machine}/ipl.h.
2001-05-15 23:30:37 +00:00
Joerg Wunsch
2995d1100c Implement a few more floppy ioctl commands and IO options, namely:
. FD_CLRERR clears the error counter, thus re-enables kernel error
  printf()s,

. FD_GSTAT obtains the last FDC operation state, if any,

. FDOPT_NOERRLOG (temporarily) turns off kernel printf() floppy
  error logging,

. FDOPT_NOERROR makes the kernel ignore an FDC error, thus can
  enable the transfer of an erroneous sector to the user application

All options are being cleared on (last) close.

Prime consumer of the last features will be fdread(1), to be committed
shortly.

(FD_CLRERR should be wired into fdcontrol(8), but then fdcontrol(8)
needs a major rewrite anyway.)
2001-05-14 20:20:11 +00:00
John Baldwin
6caa8a1501 Overhaul of the SMP code. Several portions of the SMP kernel support have
been made machine independent and various other adjustments have been made
to support Alpha SMP.

- It splits the per-process portions of hardclock() and statclock() off
  into hardclock_process() and statclock_process() respectively.  hardclock()
  and statclock() call the *_process() functions for the current process so
  that UP systems will run as before.  For SMP systems, it is simply necessary
  to ensure that all other processors execute the *_process() functions when the
  main clock functions are triggered on one CPU by an interrupt.  For the alpha
  4100, clock interrupts are delievered in a staggered broadcast fashion, so
  we simply call hardclock/statclock on the boot CPU and call the *_process()
  functions on the secondaries.  For x86, we call statclock and hardclock as
  usual and then call forward_hardclock/statclock in the MD code to send an IPI
  to cause the AP's to execute forwared_hardclock/statclock which then call the
  *_process() functions.
- forward_signal() and forward_roundrobin() have been reworked to be MI and to
  involve less hackery.  Now the cpu doing the forward sets any flags, etc. and
  sends a very simple IPI_AST to the other cpu(s).  AST IPIs now just basically
  return so that they can execute ast() and don't bother with setting the
  astpending or needresched flags themselves.  This also removes the loop in
  forward_signal() as sched_lock closes the race condition that the loop worked
  around.
- need_resched(), resched_wanted() and clear_resched() have been changed to take
  a process to act on rather than assuming curproc so that they can be used to
  implement forward_roundrobin() as described above.
- Various other SMP variables have been moved to a MI subr_smp.c and a new
  header sys/smp.h declares MI SMP variables and API's.   The IPI API's from
  machine/ipl.h have moved to machine/smp.h which is included by sys/smp.h.
- The globaldata_register() and globaldata_find() functions as well as the
  SLIST of globaldata structures has become MI and moved into subr_smp.c.
  Also, the globaldata list is only available if SMP support is compiled in.

Reviewed by:	jake, peter
Looked over by:	eivind
2001-04-27 19:28:25 +00:00