Commit Graph

724 Commits

Author SHA1 Message Date
Kazutaka YOKOTA
ab4918cbff Reserve a major number for the frame buffer device. 1999-05-09 05:02:15 +00:00
Doug Rabson
566643e39e Move the declaration of the interrupt type from the driver structure
to the BUS_SETUP_INTR call.
1999-05-08 21:59:43 +00:00
Peter Wemm
6d04a6cb97 I'm sick of the automatic rename of /kernel to /kernel.old while doing
development that leads to lots of crashes during boot.

I have made a 'reinstall' target (like in ports, and reinstall.debug)
This is most useful if you want to keep /kernel.old as a known bootable
kernel.  If you test a new kernel and have to reboot for a fix, a
'make reinstall' will install the new kernel over the top of the old
non-viable one, leaving the old one untouched.  This is mainly meant
for development, not general users.
1999-05-08 20:04:39 +00:00
Poul-Henning Kamp
4be2eb8c49 I got tired of seeing all the cdevsw[major(foo)] all over the place.
Made a new (inline) function devsw(dev_t dev) and substituted it.

Changed to the BDEV variant to this format as well: bdevsw(dev_t dev)

DEVFS will eventually benefit from this change too.
1999-05-08 06:40:31 +00:00
Matt Jacob
eacbd96bcb Propagate i386 change to alpha (bdevsw[] -> bdevsw()). 1999-05-07 17:48:44 +00:00
Poul-Henning Kamp
46eede0058 Continue where Julian left off in July 1998:
Virtualize bdevsw[] from cdevsw.  bdevsw() is now an (inline)
        function.

        Join CDEV_MODULE and BDEV_MODULE to DEV_MODULE (please pay attention
        to the order of the cmaj/bmaj arguments!)

        Join CDEV_DRIVER_MODULE and BDEV_DRIVER_MODULE to DEV_DRIVER_MODULE
        (ditto!)

(Next step will be to convert all bdev dev_t's to cdev dev_t's
before they get to do any damage^H^H^H^H^H^Hwork in the kernel.)
1999-05-07 10:11:40 +00:00
Doug Rabson
84b399de51 Changes to support diskless booting on the alpha:
* Make the network code in the bootstrap more chatty (helps debugging)
* Add nfs root stuff to cpu_rootconf(). I also added a check to make sure
  it really was netbooting which allows the use of the same kernel for local
  and network boots.
* Tweak the de driver so that it takes the speed setting from the console
  for the alpha (some PWSs have broken de chipsets). This is the same
  behaviour as NetBSD/alpha.

Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>
1999-05-03 09:36:29 +00:00
Doug Rabson
d4af94988c Declare the return address for __divX, __remX so that gdb can step over
calls properly.
1999-05-02 12:05:09 +00:00
Luoqi Chen
9debe21353 - Handle mixer read ioctls correctly. They have the same group, number and
argument size as their write counterparts and were handled as write ioctls.
- Emulate some cdrom ioctls.
1999-04-29 04:37:57 +00:00
Dmitrij Tejblum
9ade6e676b pmap_emulate_reference: don't ever lose PV_TABLE_MOD bit on page. If
PV_TABLE_REF cleared before PV_TABLE_MOD, the page may get fault on read again.

On fault on write, pmap_emulate_reference mark the page dirty with
vm_page_dirty. That decrease ill effects of the bug.

The problem probably become more serious after my rev.1.18 a week ago.
1999-04-28 15:52:09 +00:00
Luoqi Chen
5206bca10a Enable vmspace sharing on SMP. Major changes are,
- %fs register is added to trapframe and saved/restored upon kernel entry/exit.
- Per-cpu pages are no longer mapped at the same virtual address.
- Each cpu now has a separate gdt selector table. A new segment selector
  is added to point to per-cpu pages, per-cpu global variables are now
  accessed through this new selector (%fs). The selectors in gdt table are
  rearranged for cache line optimization.
- fask_vfork is now on as default for both UP and SMP.
- Some aio code cleanup.

Reviewed by:	Alan Cox	<alc@cs.rice.edu>
		John Dyson	<dyson@iquest.net>
		Julian Elischer	<julian@whistel.com>
		Bruce Evans	<bde@zeta.org.au>
		David Greenman	<dg@root.com>
1999-04-28 01:04:33 +00:00
Poul-Henning Kamp
1c308b817a Change suser_xxx() to suser() where it applies. 1999-04-27 12:21:16 +00:00
Poul-Henning Kamp
f711d546d2 Suser() simplification:
1:
  s/suser/suser_xxx/

2:
  Add new function: suser(struct proc *), prototyped in <sys/proc.h>.

3:
  s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/

The remaining suser_xxx() calls will be scrutinized and dealt with
later.

There may be some unneeded #include <sys/cred.h>, but they are left
as an exercise for Bruce.

More changes to the suser() API will come along with the "jail" code.
1999-04-27 11:18:52 +00:00
Peter Wemm
10cd8cf48b Register the netisr's via SYSINIT rather than linker sets. 1999-04-26 08:57:51 +00:00
Dmitrij Tejblum
4f6f32db57 Added used include. 1999-04-25 10:45:59 +00:00
Peter Wemm
061eb3abb3 Bump configvers; when the updates to generic/lint get committed, the old
config has severe indigestion.
1999-04-24 21:38:50 +00:00
Dmitrij Tejblum
026c2d70eb Fix spelling of '#if 0'. 1999-04-24 16:39:52 +00:00
Dmitrij Tejblum
11a9f83f80 Make pmap_collect() an official pmap interface. 1999-04-23 20:29:58 +00:00
Dmitrij Tejblum
0666dbe1cf Moved cpu_set_fork_handler's prototype from <machine/cpu.h> to <sys/proc.h>.
Suggested by:	bde
1999-04-23 20:22:44 +00:00
Dmitrij Tejblum
e415107779 Fixed several (not all) warnings. 1999-04-23 19:53:38 +00:00
Doug Rabson
344dbae494 Update VERSREQ. 1999-04-21 19:50:27 +00:00
Dmitrij Tejblum
fb431f8bd4 pmap_ts_referenced(): set fault on {read|execute|write} bits on the page on,
so we will know when the page is accessed again.

(Also, make it return an integer, not "boolean" TRUE/FALSE).
1999-04-21 10:51:04 +00:00
Peter Wemm
54a8c69347 Stage 1 of a cleanup of the i386 interrupt registration mechanism.
Interrupts under the new scheme are managed by the i386 nexus with the
awareness of the resource manager.  There is further room for optimizing
the interfaces still.  All the users of register_intr()/intr_create()
should be gone, with the exception of pcic and i386/isa/clock.c.
1999-04-21 07:26:30 +00:00
Dmitrij Tejblum
f998a53420 Added consts to cpu_set_fork_handler prototype. (Follow i386 version.) 1999-04-20 22:53:54 +00:00
Dmitrij Tejblum
1d8ca40c41 alpha/include/param.h: #define NCPUS 1
alpha/include/lock.h: remove nop simplelock macros, which are defined
in <sys/lock.h> if NCPUS == 1.

As a result, NULL_SIMPLELOCK is defined, and a few warnings removed.
1999-04-20 22:20:57 +00:00
Peter Wemm
db42d90829 unifdef -DVM_STACK - it's been on for a while for x86 and was checked
and appeared to be working for the Alpha some time ago.
1999-04-19 14:14:14 +00:00
Doug Rabson
319c0e7fed Add commented out entries for ata driver now that it works on the alpha. 1999-04-19 08:56:38 +00:00
Doug Rabson
a7aeb17acc Add seatbelts. 1999-04-19 08:55:11 +00:00
Peter Wemm
6182fdbda8 Bring the 'new-bus' to the i386. This extensively changes the way the
i386 platform boots, it is no longer ISA-centric, and is fully dynamic.
Most old drivers compile and run without modification via 'compatability
shims' to enable a smoother transition.  eisa, isapnp and pccard* are
not yet using the new resource manager.  Once fully converted, all drivers
will be loadable, including PCI and ISA.

(Some other changes appear to have snuck in, including a port of Soren's
 ATA driver to the Alpha.  Soren, back this out if you need to.)

This is a checkpoint of work-in-progress, but is quite functional.

The bulk of the work was done over the last few years by Doug Rabson and
Garrett Wollman.

Approved by:	core
1999-04-16 21:22:55 +00:00
Andrew Gallatin
22fae70741 zero out switchtime.tv_sec. This fixes a fairly serious problem where
processes were being charged for time when the system was idle.
1999-04-16 13:57:38 +00:00
Hidetoshi Shimokawa
4940ba38d3 - Add another adhoc frame_size detection for stack trace.
egcs manupilates stack pointer with 'subq/addq' rather than 'lha'.
- Surpress warnings
1999-04-16 12:04:39 +00:00
Peter Wemm
bdcedd79c5 Hopefully replicate the install.debug changes from the i386 version. 1999-04-13 18:35:28 +00:00
Hidetoshi Shimokawa
76fcfc1aba Initialize alpha_unaligned_* as I intended.
I misunderstood SYSCTL_INT in previous revision.
1999-04-13 15:42:34 +00:00
Hidetoshi Shimokawa
05f1861b84 Control unaligned access handling via sysctl. 1999-04-11 12:48:15 +00:00
Hidetoshi Shimokawa
2f8c098571 Don't define NMBCLUSTERS here.
It will be defined as appropriate value depending on maxusers.
1999-04-11 12:19:02 +00:00
Greg Lehey
4357ca882d Back out default debug kernel. The flags revert to historical behaviour.
Requested-by:	ache
		bde
		dg

Modify targets for debug kernels:  when -g was specified, make will
now build a debug kernel called kernel.debug, and create a stripped
version called kernel at the same time.  The two targets install and
install.debug are otherwise unchanged.

Requested-by:	dillon

Update man page accordingly.
1999-04-11 03:40:11 +00:00
Andrew Gallatin
61ddd9cc3c A quick fix to get kernels building again under EGCS 1999-04-08 20:32:51 +00:00
Bill Paul
4473c5ec86 Make ASIX driver work on FreeBSD/alpha, add to GENERIC. 1999-04-08 17:42:48 +00:00
Greg Lehey
2005b07aa8 1. Modify config to issue different code for debugging.
2.  Config complains if you use -g:

    Debugging is enabled by default, there is no ned to specify the -g option

3.  Config warns you if you don't use -s:

    Building kernel with full debugging symbols.  Do
    "config -s BSD" for historic partial symbolic support.
    To install the debugging kernel, do make install.debug

    (BSD was the name of the config file I used; I print out the same
    name).

4.  Modify Makefile.i386, Makefile.alpha, Makefile.pc98 and config to
    work if a kernel name other than 'kernel' is specified.  This is
    not absolutely necessary, but useful, and it was relatively easy.
    I now have a kernel called /crapshit :-)

5.  Modify Makefile.i386, Makefile.alpha, Makefile.pc98 "clean" target
    to remove both the debug and normal kernel.

6.  Modify all to install the stripped kernel by default and the debug
    kernel if you enter "make install.debug".

7.  Update version number of Makefiles and config.
1999-04-07 09:28:03 +00:00
Mike Smith
2beb6ea1c9 Remove unused/unimplemented pmap_setdevram() 1999-04-07 03:34:32 +00:00
Julian Elischer
8d17e69460 Catch a case spotted by Tor where files mmapped could leave garbage in the
unallocated parts of the last page when the file ended on a frag
but not a page boundary.
Delimitted by tags PRE_MATT_MMAP_EOF and POST_MATT_MMAP_EOF,
in files alpha/alpha/pmap.c i386/i386/pmap.c nfs/nfs_bio.c vm/pmap.h
    vm/vm_page.c vm/vm_page.h vm/vnode_pager.c miscfs/specfs/spec_vnops.c
    ufs/ufs/ufs_readwrite.c kern/vfs_bio.c

Submitted by: Matt Dillon <dillon@freebsd.org>
Reviewed by: Alan Cox <alc@freebsd.org>
1999-04-05 19:38:30 +00:00
John Polstra
4fe88fe637 Restore support for executing BSD/OS binaries on the i386 by passing
the address of the ps_strings structure to the process via %ebx.
For other kinds of binaries, %ebx is still zeroed as before.

Submitted by:	Thomas Stephens <tas@stephens.org>
Reviewed by:	jdp
1999-04-03 22:20:03 +00:00
Bill Paul
8919d7d4e7 Make the Macronix driver work on FreeBSD/alpha and add to GENERIC.
Like the PNIC, we have to copy packet headers in the receive handler
because the chip will only DMA to longword aligned buffers.

Also do some mindor cleanups.
1999-04-01 02:09:37 +00:00
Bill Paul
25223996f1 Insert ifmedia_set() that I forgot and put in the vtophys() hack for
the alpha. Now the ThunderLAN driver works on the alpha (both my
sample cards check out.) Update the alpha GENERIC config to include
ThunderLAN driver now that I've tested it.
1999-03-31 04:04:14 +00:00
Doug Rabson
f1f1b5e0c1 Fix some warnings. 1999-03-28 17:52:17 +00:00
Doug Rabson
e8d4dc28dc Fix a few warnings. 1999-03-28 17:33:38 +00:00
Doug Rabson
7e2bb9dbfe Remove trigraph. 1999-03-28 17:33:14 +00:00
Bill Paul
8fe2c75e31 Make the xl and pn drivers work on FreeBSD/alpha and add them to
sys/alpha/conf/GENERIC.

Note: the PNIC ignores the lower few bits of the RX buffer DMA address,
which means we have to add yet another kludge to make it happy. Since
we can't offset the packet data, we copy the first few bytes of the
received data into a separate mbuf with proper alignment. This puts
the IP header where it needs to be to prevent unaligned accesses.

Also modified the PNIC driver to use a non-interrupt driven TX
strategy. This improves performance somewhat on x86/SMP systems where
interrupt delivery doesn't seem to be as fast with an SMP kernel as
with a UP kernel.
1999-03-27 20:41:25 +00:00
Doug Rabson
1a94f2a6e8 Don't lower the ipl for splsoftcam, splsoftvm and splsoftnet. 1999-03-19 10:56:28 +00:00
Andrew Gallatin
19fa470d92 Enable crashdumps on alphas.
Reviewed by: Doug Rabson <dfr@nlsystems.com>
1999-03-12 14:44:46 +00:00
Kazutaka YOKOTA
e9deda23ae Keyboard driver update in preparation for the USB keyboard driver.
- Refined internal interface in keyboard drivers so that:
  1. the side effect of device probe is kept minimal,
  2. polling mode function is added,
  3. and new ioctl and configuration options are added (see below).

- Added new ioctl: KDSETREPEAT
  Set keyboard typematic rate.  There has existed an ioctl command,
  KDSETRAD, for the same purpose.  However, KDSETRAD is dependent on
  the AT keyboard.  KDSETREPEAT provides more generic interface.
  KDSETRAD will still be supported in the atkbd driver.

- Added new configuration options:
  ATKBD_DFLT_KEYMAP
  Specify a keymap to be used as the default, built-in keymap.
  (There has been undocumented options, DKKEYMAP, UKKEYMAP, GRKEYMAP,
  SWKEYMAP, RUKEYMAP, ESKEYMAP, and ISKEYMAP to set the default keymap.
  These options are now gone for good.  The new option is more general.)

  KBD_DISABLE_KEYMAP_LOADING
  Don't allow the user to change the keymap.
1999-03-10 10:36:53 +00:00
Garrett Wollman
acc8326d0c Expose a slightly-lower-level interface to timeouts which allows callers
to manage their own memory.  Tested on my machine (make buildworld).
I've made analogous changes on the alpha, but don't have a machine
to test.

Not-objected-to by:	dg, gibbs
1999-03-06 04:46:20 +00:00
Warner Losh
1684ea5706 Don't define MACHINE, MACHINE_ARCH, _MACHINE or _MACHINE_ARCH if
already defined.  This allows for cross building to work because we
need to lie to make to tell it to use the target names rather than the
host names.

This should have no effect on either architecture.  I've confirmed
that the intel build by make buildworld's for the past 3 months.
1999-03-01 06:10:16 +00:00
Bruce Evans
e7ba67f274 Removed all traces of `p_switchtime'. The relevant timestamp is per-cpu,
not per-process.  Keep it in `switchtime' consistently.

It is now clear that the timestamp is always valid in fork_trampoline()
except when the child is running on a previously idle cpu, which
can only happen if there are multiple cpus, so don't check or set
the timestamp in fork_trampoline except in the (i386) SMP case.
Just remove the alpha code for setting it unconditionally, since
there is no SMP case for alpha and the code had rotted.

Parts reviewed by:	dfr, phk
1999-02-28 10:53:29 +00:00
Doug Rabson
b49f17156f * Add support for hw.physmem and hw.usermem sysctls (this allows sysinstall
to calculate a reasonable size for the swap partition).
* Fix a typo in remrq() where a process with idle priority would not be
  correctly removed from the relavent queue.  Note that realtime and idle
  priorities are still not supported since the assembler code in
  cpu_switch() does not check the realtime and idle queues.
1999-02-27 18:41:40 +00:00
Bruce Evans
025a06fd58 Added a per-cpu variable `switchticks' for use in scheduling. 1999-02-22 15:13:34 +00:00
Luoqi Chen
1c6d46f93c Introduce machine-dependent macro pgtok() to convert page count to number
of kilobytes. Its definition for each architecture could be optimized to
avoid potential numerical overflows.
1999-02-19 19:34:49 +00:00
Luoqi Chen
b1028ad122 Hide access to vmspace:vm_pmap with inline function vmspace_pmap(). This
is the preparation step for moving pmap storage out of vmspace proper.

Reviewed by:	Alan Cox	<alc@cs.rice.edu>
		Matthew Dillion	<dillon@apollo.backplane.com>
1999-02-19 14:25:37 +00:00
John Polstra
71e48bbacb Fix typo in comment. 1999-02-19 01:31:38 +00:00
Matt Jacob
8f5381965d add now required queue.h include 1999-02-16 20:34:56 +00:00
Dag-Erling Smørgrav
ad5ebf3fba Ignore errors from chflags. This makes it possible to make installworld
with DESTDIR set to an NFS-mounted file system.
1999-02-14 13:56:15 +00:00
Matthew Dillon
dd2f9956e2 Adjust idle zero-page fill hysteresis based on tests. Use 2/3 and 4/5
zero-fill levels.

    Adjust comment for ozfod in vmmeter.h - this counter represents
    non-optimal ( on the fly ) zero fills, not prefills.
1999-02-08 02:42:13 +00:00
Matthew Dillon
d718be7be7 Add hysteresis to alpha version of vm_page_zero_idle(). 1999-02-08 00:47:32 +00:00
Matthew Dillon
faa273d5c2 Rip out PQ_ZERO queue. PQ_ZERO functionality is now combined in with
PQ_FREE.  There is little operational difference other then the kernel
    being a few kilobytes smaller and the code being more readable.

    * vm_page_select_free() has been *greatly* simplified.
    * The PQ_ZERO page queue and supporting structures have been removed
    * vm_page_zero_idle() revamped (see below)

    PG_ZERO setting and clearing has been migrated from vm_page_alloc()
    to vm_page_free[_zero]() and will eventually be guarenteed to remain
    tracked throughout a page's life ( if it isn't already ).

    When a page is freed, PG_ZERO pages are appended to the appropriate
    tailq in the PQ_FREE queue while non-PG_ZERO pages are prepended.
    When locating a new free page, PG_ZERO selection operates from within
    vm_page_list_find() ( get page from end of queue instead of beginning
    of queue ) and then only occurs in the nominal critical path case.  If
    the nominal case misses, both normal and zero-page allocation devolves
    into the same _vm_page_list_find() select code without any specific
    zero-page optimizations.

    Additionally, vm_page_zero_idle() has been revamped.  Hysteresis has been
    added and zero-page tracking adjusted to conform with the other changes.
    Currently hysteresis is set at 1/3 (lo) and 1/2 (hi) the number of free
    pages.  We may wish to increase both parameters as time permits.  The
    hysteresis is designed to avoid silly zeroing in borderline allocation/free
    situations.
1999-02-08 00:37:36 +00:00
John Polstra
47633640aa Change the load address of the ELF dynamic linker from "2L*MAXDSIZ"
to an architecture-specific value defined in <machine/elf.h>.  This
solves problems on large-memory systems that have a high value for
MAXDSIZ.

The load address is controlled by a new macro ELF_RTLD_ADDR(vmspace).
On the i386 it is hard-wired to 0x08000000, which is the standard
SVR4 location for the dynamic linker.

On the Alpha, the dynamic linker is loaded MAXDSIZ bytes beyond
the start of the program's data segment.  This is the same place
a userland mmap(0, ...) call would put it, so it ends up just below
all the shared libraries.  The rationale behind the calculation is
that it allows room for the data segment to grow to its maximum
possible size.

These changes have been tested on the i386 for several months
without problems.  They have been tested on the Alpha as well,
though not for nearly as long.  I would like to merge the changes
into 3.1 within a week if no problems have surfaced as a result of
them.
1999-02-07 23:49:56 +00:00
Kazutaka YOKOTA
1c27745f73 - Don't assume the line length in the video memory is always the same as
the screen width.
- Store the current video mode information in the `video_adapter' struct.
- The size of the `v_offscreensize' field in the VESA mode information
  block is u_int16, not u_int8.
1999-02-05 11:52:13 +00:00
Mark Newton
d27583423e Added call to elf_brand_inuse() to prevent you from cutting your own
legs out from under you.
1999-02-04 21:20:13 +00:00
Doug Rabson
f422bef257 Use the bsd.kern.mk from the source tree rather than the installed one
if possible.
1999-02-02 18:34:23 +00:00
Bruce Evans
79a2501238 Added a hopefully-machine-independent macro for determining if a
reschedule is pending.
1999-02-02 09:08:23 +00:00
Poul-Henning Kamp
4e2d2aa1cd Use suser() to check for super user rather than examining cr_uid directly.
Use TTYDEF_SPEED rather than 9600 a couple of places.

Reviewed by:	bde, with a few grumbles.
1999-01-30 12:17:38 +00:00
Julian Elischer
2907af2a96 Mostly remove the VM_STACK OPTION.
This changes the definitions of a few items so that structures are the
same whether or not the option itself is enabled. This allows
people to enable and disable the option without recompilng the world.

As the author says:

|I ran into a problem pulling out the VM_STACK option.  I was aware of this
|when I first did the work, but then forgot about it.  The VM_STACK stuff
|has some code changes in the i386 branch.  There need to be corresponding
|changes in the alpha branch before it can come out completely.

what is done:
|
|1) Pull the VM_STACK option out of the header files it appears in.  This
|really shouldn't affect anything that executes with or without the rest
|of the VM_STACK patches.  The vm_map_entry will then always have one
|extra element (avail_ssize).  It just won't be used if the VM_STACK
|option is not turned on.
|
|I've also pulled the option out of vm_map.c.  This shouldn't harm anything,
|since the routines that are enabled as a result are not called unless
|the VM_STACK option is enabled elsewhere.
|
|2) Add what appears to be appropriate code the the alpha branch, still
|protected behind the VM_STACK switch.  I don't have an alpha machine,
|so we would need to get some testers with alpha machines to try it out.
|
|Once there is some testing, we can consider making the change permanent
|for both i386 and alpha.
|
[..]
|
|Once the alpha code is adequately tested, we can pull VM_STACK out
|everywhere.
|

Submitted by:	"Richard Seaman, Jr." <dick@tar.com>
1999-01-26 02:49:52 +00:00
Matthew Dillon
7dbf82dc13 Change all manual settings of vm_page_t->dirty = VM_PAGE_BITS_ALL
to use the vm_page_dirty() inline.

    The inline can thus do sanity checks ( or not ) over all cases.
1999-01-24 06:04:52 +00:00
Doug Rabson
8a99777019 Update the alpha port to use the new syscons.
Submitted by: Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp> (partly)
1999-01-23 16:53:30 +00:00
Matthew Dillon
1c7c3c6a86 This is a rather large commit that encompasses the new swapper,
changes to the VM system to support the new swapper, VM bug
    fixes, several VM optimizations, and some additional revamping of the
    VM code.  The specific bug fixes will be documented with additional
    forced commits.  This commit is somewhat rough in regards to code
    cleanup issues.

Reviewed by:	"John S. Dyson" <root@dyson.iquest.net>, "David Greenman" <dg@root.com>
1999-01-21 08:29:12 +00:00
Andrew Gallatin
b8b442b5ab Fix some mildly annoying compiler warnings about unused variables
and incorrect types in printf() format strings.
1999-01-20 20:51:39 +00:00
Peter Wemm
f75ccec2a1 *blush*. As a quick fix, move configure()'s SYSINIT back a little to allow
CAM's xpt_init() to get in first.  I hope this will fix the build again,
sorry guys. :-(
XXX configure_start() and configure_end() seem to be a bit excessive.. both
here and in the i386 code.
1999-01-20 19:22:24 +00:00
Andrew Gallatin
a671d614ca Reserve a major number for use by the Iprobe device driver.
Iprobe is an alpha-only system profiling suite which I'm porting from
Linux/alpha to FreeBSD.

Iprobe works by using the hardware profiling support built into
alpha cpus.  In a nutshell,  what Iprobe does is to setup the alpha
performance counters to sample the pc at a fairly high rate & dumps
those pc samples out to user space.  Then some code runs to map the
sampled PCs to functions.  You get a bit more than that (like the PSL
word, so you can tell if you're in the kernel or userland, what the
ipl is, etc).
1999-01-18 20:38:37 +00:00
Andrew Gallatin
1e176a8ad1 Added support for the DEC EB64PLUS systype. (Part III)
o Add the EB64PLUS systype into the kernel configuration files
and add it to the GENERIC kernel

o Correct mcclock_isa.c's dependence on cia, it should depend on isa.
  This will allow avanti and eb64+ kernels to be built without the cia
  chipset support code.
1999-01-18 20:26:50 +00:00
Andrew Gallatin
5a51b2f3b6 Added support for the DEC EB64PLUS systype. (part II)
The DEC EB64PLUS support code.  Based on NetBSD's dec_eb64plus.c,v 1.15

Submitted by: Wilko Bulte <wilko@yedi.iaf.nl>
1999-01-18 20:18:49 +00:00
Andrew Gallatin
2c478084d6 Added support for the DEC EB64PLUS systype. (part I)
The new file pci_eb64plus_intr.s deals with the interrupt hardware
on the EB64PLUS and was obtained from NetBSD with the NetBSD
copyright intact

The apecs chipset support code was altered to allow routing interrupts
through pci if we're not running on an avanti.  Avanti's route all
interrupts through isa.

Tested by: Wilko Bulte <wilko@yedi.iaf.nl>
Partially reviewed by: dfr
1999-01-18 20:15:07 +00:00
Peter Wemm
1e65ef01b0 Minor cleanup; no more references to LKM's. 1999-01-17 20:36:14 +00:00
Mike Smith
a07089226d Oops, add the NMBCLUSTERS initialiser for the Alpha as well. 1999-01-15 18:00:19 +00:00
Mike Smith
84252d6300 dftp -> dtfp Get it right... 1999-01-14 03:47:55 +00:00
Mike Smith
4f029d3999 Assign cdev major 84 to 'dftp' for "Louis A. Mamakos" <louie@UU.NET> 1999-01-13 08:05:16 +00:00
Doug Rabson
88835c656b A couple more osf/1 compat tweaks.
Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>
1999-01-12 10:54:14 +00:00
Doug Rabson
784521ae53 Add hooks for the Iprobe kernel profiler.
Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>
1999-01-10 12:35:39 +00:00
John Polstra
f92bdbd010 Switch to using ".So" as the extension for PIC object files rather
than ".so".  The old extension conflicted with well-established
naming conventions for dynamically loadable modules.

The "clean" targets continue to remove ".so" files too, to deal with
old systems.
1999-01-09 21:51:00 +00:00
Julian Elischer
2267af789e Add (but don't activate) code for a special VM option to make
downward growing stacks more general.
Add (but don't activate) code to use the new stack facility
when running threads, (specifically the linux threads support).
This allows people to use both linux compiled linuxthreads, and also the
native FreeBSD linux-threads port.

The code is conditional on VM_STACK. Not using this will
produce the old heavily tested system.

Submitted by: Richard Seaman <dick@tar.com>
1999-01-06 23:05:42 +00:00
Kazutaka YOKOTA
67a2ac4a23 Assign CDEV 112 to the keyboard driver. 1999-01-06 06:43:51 +00:00
Doug Rabson
d1fd776a79 Fix fubyte to actually return the correct value (it was always returning
zero).  This caused device reads to corrupt the first byte of the page
being read into (the cause of frozen keyboards in sysinstall).
1999-01-05 18:39:02 +00:00
Dag-Erling Smørgrav
70bfbd280e Correct typo in macro name. 1999-01-01 14:38:30 +00:00
Søren Schmidt
e76bba09e3 Commit patch in
PR: 9232
Submitted by:	marcel@scc.nl <Marcel Moolenaar>
1998-12-30 21:20:00 +00:00
Søren Schmidt
abbc72c904 Commit #1 of:
PR: 9235
1998-12-30 20:58:28 +00:00
Doug Rabson
9c0fed3dcf Various changes to support OSF1 emulation:
* Move the user stack from VM_MAXUSER_ADDRESS to a place below the 32bit
  boundary (needed to support 32bit OSF programs).  This should also save
  one pagetable per process.
* Add cvtqlsv to the set of instructions handled by the floating point
  software completion code.
* Disable all floating point exceptions by default.
* A minor change to execve to allow the OSF1 image activator to support
  dynamic loading.
1998-12-30 10:38:59 +00:00
Gary Palmer
c656fddc16 Add fxp0. It seems to be Alpha-OK, although I don't have a card to test. 1998-12-29 03:59:49 +00:00
Matt Jacob
c5217a03af reserve 110 for ses (SCSI Environmental Services) driver 1998-12-29 00:13:37 +00:00
Doug Rabson
486bddb033 Fix some 64bit truncation problems which crept into SYSCTL_LONG() with the
last cleanup.  Since the oid_arg2 field of struct sysctl_oid is not wide
enough to hold a long, the SYSCTL_LONG() macro has been modified to only
support exporting long variables by pointer instead of by value.

Reviewed by: bde
1998-12-27 18:03:29 +00:00
Matt Jacob
803ee29602 Not quite right for the goal of using swi_register, but on the way there. 1998-12-24 06:05:48 +00:00
Doug Rabson
b7f762137a Implement fpsetmask() and other fp*() functions. Programs should use
#include <ieeefp.h>

to access these functions instead of the i386 specific

	#include <machine/floatingpoint.h>

Submitted by: Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
1998-12-23 11:50:52 +00:00
Søren Schmidt
ec4e636d4c Fix NOIMPL -> NOPROTO as per bruce. 1998-12-22 08:59:19 +00:00
Søren Schmidt
81bca0e98c Syscall 168 (poll) is not implemented in the Linux emulator. This
syscall is used by Oracle.

PR:		9154
Submitted by:	Marcel Moolenaar <marcel@scc.nl>
1998-12-21 19:28:13 +00:00
Doug Rabson
20982dfb10 Add LDGP(pv) to suword, subyte, fuword, fubyte so that they can be called
from kernel modules.
1998-12-20 13:21:55 +00:00
Søren Schmidt
9073a41122 Make it compile again.
I have no idea if the new stuff works though.

Broken by: Julian
1998-12-19 19:05:57 +00:00
Julian Elischer
6626c6045c Reviewed by: Luoqi Chen, Jordan Hubbard
Submitted by:	 "Richard Seaman, Jr." <lists@tar.com>
Obtained from:	linux :-)

Code to allow Linux Threads to run under FreeBSD.

By default not enabled
This code is dependent on the conditional
COMPAT_LINUX_THREADS (suggested by Garret)
This is not yet a 'real' option but will be within some number of hours.
1998-12-19 02:55:34 +00:00
Dmitrij Tejblum
8252a465b9 Little reorganization:
- created internal names for fixed-size integral types, like __int32_t. They
  will be used to make several headers self-sufficient.
- <stdlib.h> don't include <machine/types.h> anymore.
- created <sys/inttypes.h>, which can be used as <inttypes.h>.
- declaration of uoff_t and ufs_daddr_t moved to <sys/types.h>.

Reviewed by:	bde
1998-12-19 00:02:34 +00:00
Doug Rabson
65be2aace6 Move some compile flags from the kernel makefile to bsd.kern.mk so that
kernel modules are built with the right flags.

Suggested by: Andrew Gallatin <gallatin@cs.duke.edu>
1998-12-17 22:36:21 +00:00
Bruce Evans
4c56fcdead Removed the cast to a pointer in the definition of PS_STRINGS and
adjusted related casts to match (only in the kernel in this commit).
The pointer was only wanted in one place in kern_exec.c.  Applications
should use the kern.ps_strings sysctl instead of PS_STRINGS, so they
shouldn't notice this change.
1998-12-16 16:28:58 +00:00
Bruce Evans
4f2129fa86 Removed bogus casts of USRSTACK and/or the other operand in binary
expressions involving USRSTACK.
1998-12-16 15:21:51 +00:00
Dmitrij Tejblum
85f118c801 Added 3 new errno values, requred by various standards: EOVERFLOW,
ECANCELED, EILSEQ.

Fixed ibcs2 and especially linux EIDRM and ENOMSG errno mapping.
Reviewed by:	Dan Nelson <dnelson@emsphone.com>
1998-12-14 18:54:04 +00:00
Eivind Eklund
d51523c6c9 Get rid of CTLTYPE_OPAQUE in a SYSCTL_OPAQUE - it is added my the
SYSCTL_OPAQUE macro.
1998-12-09 02:26:45 +00:00
Warner Losh
f7c9e34bea If there is no .depends file, use the standard ad-hoc way of ensuring
that the generated files are generated before any of the object files.
Also minor cleanup of dependencies in conf/files that I bogusly added
before.

This should fix the requirement that make depend be done starting from
a clean config directory.  If you don't have a clean directory, make
depend is still required if you want the proper .o's to be recompiled.

Reviewed by: bde
1998-12-07 22:36:54 +00:00
Matt Jacob
0a194dfe3f fix warning messages from previous delta 1998-12-06 00:10:52 +00:00
Matt Jacob
80592d5b75 Fix it so that it works on an eb164 when you have a serial console on com1.
Obtained from:gallatin@freebsd.org
1998-12-05 22:36:31 +00:00
Archie Cobbs
2127f26023 Examine all occurrences of sprintf(), strcat(), and str[n]cpy()
for possible buffer overflow problems. Replaced most sprintf()'s
with snprintf(); for others cases, added terminating NUL bytes where
appropriate, replaced constants like "16" with sizeof(), etc.

These changes include several bug fixes, but most changes are for
maintainability's sake. Any instance where it wasn't "immediately
obvious" that a buffer overflow could not occur was made safer.

Reviewed by:	Bruce Evans <bde@zeta.org.au>
Reviewed by:	Matthew Dillon <dillon@apollo.backplane.com>
Reviewed by:	Mike Spengler <mks@networkcs.com>
1998-12-04 22:54:57 +00:00
Doug Rabson
5b38fe900d Implement 'software completion' for floating point arithmetic. On the
alpha, operations involving non-finite numbers or denormalised numbers
or operations which should generate such numbers will cause an arithmetic
exception.  For programs which follow some strict code generation rules,
the kernel trap handler can then 'complete' the operation by emulating
the faulting instruction.

To use software completion, a program must be compiled with the arguments
'-mtrap-precision=i' and '-mfp-trap-mode=su' or '-mfp-trap-mode=sui'.
Programs compiled in this way can use non-finite and denormalised numbers
at the expense of slightly less efficient code generation of floating
point instructions.  Programs not compiled with these options will receive
a SIGFPE signal when non-finite or denormalised numbers are used or
generated.

Reviewed by: John Polstra <jdp@polstra.com>
1998-12-04 10:52:48 +00:00
Doug Rabson
28ae06aad0 Restore the user HAE all the time, not just when returning to usermode.
This closes a very small window where the use HAE might not be restored
at all.  This only happens when switching to a process which has used the
HAE.
1998-12-02 10:24:56 +00:00
Doug Rabson
5ac82ff587 Enable BWX i/o access. I disabled it by mistake with the last commit.
Pointed out by: Andrew Gallatin <gallatin@cs.duke.edu>
1998-12-02 09:33:27 +00:00
Doug Rabson
e63149c330 Add support for 'vmstat -i'.
Submitted by: Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
Obtained from: NetBSD
1998-11-28 09:55:16 +00:00
Doug Rabson
d24b518319 Port top to the alpha.
Submitted by: Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
1998-11-25 09:45:28 +00:00
Kazutaka YOKOTA
570f565d11 Oops, I forgot to update this file when I changed moused recently. 1998-11-22 11:57:59 +00:00
Doug Rabson
75410e3d0e Fix things so that pci interrupts can be registered correctly on apecs
and lca machines (which route PCI interrupts through the ISA PIC).

Reviewed by: dima
1998-11-18 23:53:12 +00:00
Doug Rabson
eae8e50443 Add sc_traparg_a0, sc_traparg_a1 and sc_traparg_a2 to the sigcontext
structure for the alpha.  These give extra information about some
signals (such as SIGSEGV) and should be compatible with Digital Unix.

Submitted by: jdp
1998-11-18 23:51:40 +00:00
Dima Ruban
fa1303baf8 Remove -U__NetBSD__ 1998-11-18 23:51:17 +00:00
Doug Rabson
b0a6dfad26 Definitions for alpha specific device resources. 1998-11-17 10:40:33 +00:00
Doug Rabson
9b0e7f94af Definitions for alpha specific system calls. 1998-11-17 10:40:07 +00:00
Doug Rabson
08b6a4cbee * Add hooks to allow the X server to access I/O ports and memory.
* Update drivers to the latest version of the bus interface.

The ISA drivers' use of the new resource api is minimal.  Garrett has
some much cleaner drivers which should be more easily shared between
i386 and alpha.  This has only been tested on cia based machines.  It
should work on lca and apecs but I might have broken something.
1998-11-15 18:25:17 +00:00
Doug Rabson
225b9157e6 Don't include link_elf.c twice in the link. 1998-11-15 18:15:06 +00:00
Doug Rabson
2f2dcad41b * Change 'struct resource' to 'struct config_resource'.
* Bump config version.
1998-11-15 18:07:35 +00:00
Bruce Evans
c25ded316f Finished updating module event handlers to be compatible with
modeventhand_t.
1998-11-15 15:33:52 +00:00
Dima Ruban
9ffad24346 indent 1998-11-15 00:50:59 +00:00
Jordan K. Hubbard
845491fe8d MF22: Bring in some linux sound ioctl support which I committed to 2.2
for PR 7792 but did not bring forward.

Submitted by:	Avatar Liang <avatar@www.mmlab.cse.yzu.edu.tw>
PR:		8656
1998-11-12 00:42:08 +00:00
Mike Smith
2831f40f0b Use an at_shutdown hook to drop back to the SRM in the case where the system
is being halted, rather than hanging waiting for a keypress.

Submitted by:	Andrew Gallatin <gallatin@freebsd.org>
1998-11-11 00:02:25 +00:00
Dima Ruban
46e79a3c0e Add some bogus stuff to make systat/vmstat happy.
Reviewed by:	dfr
1998-11-09 10:47:19 +00:00
Poul-Henning Kamp
5adee71e55 Update interface to timecounter to last change to the generic code. 1998-11-08 19:26:23 +00:00
Nicolas Souchu
710c119cf7 Update configuration files for the perl based makedevops script.
Submitted by: Nick Hibma <nick.hibma@jrc.it>
Approved by:  Doug Rabson <dfr@nlsystems.com>
1998-11-08 18:39:57 +00:00
Nicolas Souchu
7a8ecb9e64 Add semicolon to INTERFACE declarations 1998-11-08 18:35:53 +00:00
Doug Rabson
7095ee912b * Fix a couple of places in the device pager where an address was
truncated to 32 bits.
* Change the calling convention of the device mmap entry point to
  pass a vm_offset_t instead of an int for the offset allowing
  devices with a larger memory map than (1<<32) to be supported
  on the alpha (/dev/mem is one such).

These changes are required to allow the X server to mmap the various
I/O regions used for device port and memory access on the alpha.
1998-11-08 12:39:07 +00:00
Alexander Langer
9184fb847b Optimize bzero() by unrolling the aligned quadword loop and moving the length
manipulation away from the length comparison.  Measurements on beast.cdrom.com
show >3X improvement over the original code on large block sizes, putting the
performance on par with the optimized assembly code in libc.
1998-11-02 00:14:50 +00:00
Doug Rabson
57250ffb42 * Fix vga_probe() so that it doesn't report a non-vga display adapter as
a vga.
* Fix broken logic in syscons for a failed probe.
* Fix AlphaStation 500/600 so that non-serial consoles are supported.

Submitted by: Thomas Valentino Crimi <tcrimi+@andrew.cmu.edu> (vga bits),
	      Andrew Gallatin <gallatin@cs.duke.edu> (AS500/AS600)
1998-10-31 10:35:24 +00:00
Mike Smith
35d27a0f39 Add the ability to specify where on the at_shutdown queue a handler is
installed.

Remove cpu_power_down, and replace it with an entry at the end of the
SHUTDOWN_FINAL queue in the only place it's used (APM).

Submitted by:	Some ideas from Bruce Walter <walter@fortean.com>
1998-10-30 05:41:15 +00:00
Jordan K. Hubbard
4b3c37b2a8 Put back MFS_ROOT now that it's been fixed correctly. 1998-10-30 01:37:33 +00:00
Jordan K. Hubbard
522bda27ae Fix this correctly - check if mfs_getimage() succeeds before settings
the MFS root unconditionally, just as on the x86.
Prompted by:	msmith
1998-10-30 01:36:40 +00:00
Jordan K. Hubbard
4df550a942 Take MFS_ROOT out for now; for some reason, the alpha GENERIC chokes
and dies if it can't find the MFS root whereas the x86 one seems to sail
past.  Looking at the code, I can't see how either one works, so I'm
confused. :)
1998-10-30 01:17:42 +00:00
Dima Ruban
a8bdc29849 Bump VERSREQ to make ``config'' happy.
Obtained from: Makefile.i386
1998-10-29 17:09:36 +00:00
David Greenman
730075613a Added a second argument, "activate" to the vm_page_unwire() call so that
the caller can select either inactive or active queue to put the page on.
1998-10-28 13:37:02 +00:00
Paul Richards
a57faa7b13 Fix the interrupt mask generated for enabling/disabling interrupts 8 to 15. 1998-10-25 01:30:16 +00:00
David Greenman
9b827155f8 Decrement the now unused page table page's wire_count prior to freeing it.
It will soon be required that pages have a zero wire_count when being
freed.
1998-10-21 11:38:14 +00:00
Doug Rabson
0c942a8eef R_ALPHA_RELATIVE relocations need to add the value to the existing memory
contents.
1998-10-18 19:04:13 +00:00
Jordan K. Hubbard
2f40a12b31 fixup for the alpha. tag slid forward, since it's benign for the x86. 1998-10-16 10:13:09 +00:00
Peter Wemm
aa855a598d *gulp*. Jordan specifically OK'ed this..
This is the bulk of the support for doing kld modules.  Two linker_sets
were replaced by SYSINIT()'s.  VFS's and exec handlers are self registered.
kld is now a superset of lkm.  I have converted most of them, they will
follow as a seperate commit as samples.
This all still works as a static a.out kernel using LKM's.
1998-10-16 03:55:01 +00:00
Doug Rabson
43c6fba4f6 Fix a typo preventing the correct value of kernend from being picked up
from the bootstrap.  Also change some debug printfs from #if 0 to
#ifdef DEBUG_CLUSTER to make it easier to debug startup memory problems.
1998-10-15 22:00:54 +00:00
Doug Rabson
e4b0567b9b Change a bogus cast to the correct one. 1998-10-15 09:53:27 +00:00
Peter Wemm
9fd9f49c01 Fix a warning I missed before. 1998-10-14 10:08:35 +00:00
Peter Wemm
68d2bdcbb0 Typo fix. 1998-10-14 10:04:32 +00:00
Peter Wemm
da6c15d597 Initial attempt to update the Alpha loader and kernel to use the machine
independent elf loader and have access to kld modules.  Jordan and I were
not sure how to create boot floppies, and the things we tried just made
SRM laugh in our faces - but it was upset at boot1 which was not touched
by these changes.  Essentially this has been untested. :-(

What this does is to steal the last three slots from the nine spare longs
in the bootinfo_v1 struct to pass the module base pointer through.

The startup code now to set up and fills in the module and environment
structures, hopefully close enough to the i386 layout to be able to use
the same kernel code.  We now pass though the updated end of the kernel
space used, rather than _end. (like the i386).

If this does not work, it needs to be beaten into shape pronto.  Otherwise
it should be backed out before 3.0.

Pre-approved in principle by: dfr
1998-10-14 09:53:25 +00:00
Jordan K. Hubbard
39048e2d62 DB_ELF_SYMBOLS doesn't appear to do anything yet, or if it does it's
not been added to the appropriate options file.  Comment it out to
prevent config(8) warnings.
1998-10-14 00:42:02 +00:00
Jordan K. Hubbard
89041bafbd Sync up with some needed x86 options. 1998-10-13 21:38:46 +00:00
Alexander Langer
2b65ea051a Bring in _BSD_UINT8_T_, _BSD_UINT16_T_, and _BSD_UINT32_T from the i386
ansi.h.
1998-10-12 23:57:58 +00:00
Alexander Langer
514058dc0d Unregister the glibc2 brand at module unload time.
Change the ELF registration/unregistration scheme to be less error prone.
Adding a new brand requires a single addition to linux_brandlist instead of
modifying linux_load(), linux_unload(), and linux_elf_init().

Approved by:	jkh
Reviewed by:	msmith
1998-10-11 21:08:02 +00:00
Gary Palmer
1383f617d2 Make kernel build on alpha again. New kld stuff needs rindex. 1998-10-10 18:32:18 +00:00
Doug Rabson
a0ab71761c Add functions for accessing dense and bwx memory for pci devices. These
routines are necessary to allow the use of certain types of hardware on
the alpha, particularly a Myrinet card.

Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>
1998-10-06 14:18:40 +00:00
Doug Rabson
ac43c74df8 Add support for adjkerntz (largely untested). 1998-10-06 08:40:18 +00:00
Doug Rabson
0f222cb034 Fix unaligned accesses when checking DOS MBRs. 1998-10-06 08:38:58 +00:00
Doug Rabson
6516e08825 Add MFS_ROOT support. 1998-10-06 08:38:04 +00:00
John Fieber
98fd9ce8c9 Make async I/O on a socket work.
Although the current Sybase license does not permit running under
emulation, FreeBSD 3.0 is now "Sybase Ready" should the license change.
1998-10-05 16:37:36 +00:00
John Fieber
f18bad6e73 Add several missing ioctl handlers. One needed by Sybase, the others
found while looking for the one.
1998-09-30 01:42:53 +00:00
Doug Rabson
63bbbfc70e Update SimOS scsi driver to use CAM. 1998-09-26 14:49:26 +00:00
Doug Rabson
6ecd6bbf9b Don't try to attach an isa bus if there isn't one. 1998-09-26 14:48:19 +00:00
Doug Rabson
da653c6148 Start using the new SWI registration system instead of hardwiring everything. 1998-09-26 14:25:32 +00:00
Doug Rabson
b1a0cced61 Automatically detect which disk was booted and change the root to that disk. 1998-09-26 12:22:53 +00:00
Mike Smith
09d2cff163 Fix type 0 configuration accesses, and use a virtual rather than physical
address for the LCA PCI configuration register address.

FreeBSD/Alpha now boots on the NoName (aka AXPpci 33, Alpha PC), and probably
also on the Multia (mine hasn't arrived yet, so I can't tell for sure).

Submitted by:	Doug Rabson <dfr@freebsd.org>
1998-09-23 21:23:51 +00:00
Doug Rabson
4e6823805e Add splsoftvm().
Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>
1998-09-19 09:29:40 +00:00
Doug Rabson
4ada0d2731 Change sd to da and comment out the non-cam TurboChannel scsi drivers.
Fix a typo which prevented VGA consoles from working.
1998-09-18 18:43:52 +00:00
Doug Rabson
c6f34b8987 Change version number. 1998-09-18 18:41:49 +00:00
Doug Rabson
2a8d2696cd Cam changes sd to da. 1998-09-18 18:40:59 +00:00
Matt Jacob
3dd37e4387 (requested by gibbs) Remove the SCSI_CAM option (and rework the isp driver
that had depended on it for compilation within or without CAM to use
__FreeBSD_version instead).
1998-09-18 00:46:42 +00:00
Mike Smith
4e138a28a0 Add support for glibc consumers using the new ld-linux.so.2 linker.
I can't say this was the most inspired fix, but it matches the design OK.
1998-09-17 22:08:34 +00:00
Doug Rabson
9604f809cd Merge with the latest i386 syscons. 1998-09-17 09:38:36 +00:00
Doug Rabson
888aeaaa72 Fix printf format errors. 1998-09-17 09:35:31 +00:00
Doug Rabson
7f323059fa Workaround some EB164 wierdness.
Obtained from: NetBSD
1998-09-16 08:24:30 +00:00
Doug Rabson
f9f51c39c3 Disable unwanted isa interrupts. 1998-09-16 08:23:51 +00:00
Doug Rabson
129957363e Add cam spls. 1998-09-16 08:23:21 +00:00
Doug Rabson
75275c7630 Port i386 bus_space and bus_dma to alpha. 1998-09-16 08:22:57 +00:00
Doug Rabson
657d6e769c Change to cam. 1998-09-16 08:22:09 +00:00
Doug Rabson
bbe7f35658 Add cam software interrupts. 1998-09-16 08:21:12 +00:00
Doug Rabson
3bb8652fa7 Port the i386 bus_dma implementation to alpha. 1998-09-16 08:20:45 +00:00
John Polstra
1a291e0cd4 Add new functions fill_fpregs() and set_fpregs(), like fill_regs()
and set_regs() but for the floating point register state.  The code
is stolen from procfs_machdep.c, and moved out of there into
machdep.c.

These functions are needed for generating ELF core dumps.
1998-09-14 22:43:40 +00:00
John Polstra
c8afdc1dcf Add generic defines ELF_ARCH, ELF_CLASS, and ELF_DATA. These give
the relevant characteristics of the native machine, for building
and checking Elf_Ehdr structures.

Add structures to represent ELF "note" headers.  Add defines for the
note types used in ELF core files.
1998-09-14 20:30:13 +00:00
John Polstra
22d4b0fb41 Add provisions for variant core dump file formats, depending on the
object format of the executable being dumped.  This is the first
step toward producing ELF core dumps in the proper format.  I will
commit the code to generate the ELF core dumps Real Soon Now.  In
the meantime, ELF executables won't dump core at all.  That is
probably no less useful than dumping a.out-style core dumps as they
have done until now.

Submitted by:	Alex <garbanzo@hooked.net> (with very minor changes by me)
1998-09-14 05:36:51 +00:00
Doug Rabson
a6ee6725b1 Machine dependant relocations for KLD. 1998-09-11 08:47:02 +00:00
John Polstra
cfa4d73988 Add a new library function getobjformat(). It checks all the
standard places ("/etc/objformat", ${OBJFORMAT}, argv) for an
indication of the user's preferred object file format.  This
consolidates some code that was starting to be duplicated in more
and more places.

Use the new function in ldconfig.

Note: I don't think that gcc should use getobjformat(), even though
it could.  The compiler should limit itself to functions that are
widespread, to ease porting and cross-compilation.
1998-09-09 01:21:25 +00:00
Doug Rabson
feb6634586 Device framework code now declared in MI code. 1998-09-07 07:29:30 +00:00
Doug Rabson
26cdc317be Cosmetic changes to the PAGE_XXX macros to make them consistent with
the other objects in vm.
1998-09-04 18:49:35 +00:00
Doug Rabson
bd2bbbf2f3 Make SimOS work again. 1998-09-04 08:01:26 +00:00
Doug Rabson
9872f76253 Make this build even if sio is not in the kernel. 1998-09-04 07:58:33 +00:00
Jordan K. Hubbard
2394cd9adb Initial support for using linux X servers under emulation - to use an
XFree86 server, users need to create the following links in their
/compat/linux/dev directory (assuming kernel configured with 4 VTs).

lrwxrwxrwx  1 root  wheel  7 Aug 30 22:59 tty0 -> console
lrwxrwxrwx  1 root  wheel  5 Aug 30 22:45 tty1 -> ttyv0
lrwxrwxrwx  1 root  wheel  5 Aug 30 22:45 tty2 -> ttyv1
lrwxrwxrwx  1 root  wheel  5 Aug 30 22:45 tty3 -> ttyv2
lrwxrwxrwx  1 root  wheel  5 Aug 30 22:45 tty4 -> ttyv3

VT switching is still not yet supported. Attempting to switch VT
currently will cause Xserver bus error.

Submitted by:	Chain Lee <chain@110.net>
1998-08-31 06:55:02 +00:00
Doug Rabson
506a7a2ed4 Remove some duplicated devices. 1998-08-30 10:50:30 +00:00
Doug Rabson
2e809930ba Add atomic.s. 1998-08-24 08:48:22 +00:00
Doug Rabson
069e9bc1b4 Change various syscalls to use size_t arguments instead of u_int.
Add some overflow checks to read/write (from bde).

Change all modifications to vm_page::flags, vm_page::busy, vm_object::flags
and vm_object::paging_in_progress to use operations which are not
interruptable.

Reviewed by: Bruce Evans <bde@zeta.org.au>
1998-08-24 08:39:39 +00:00
Doug Rabson
2386a98ddd Use address space numbers to reduce TLB flushes. 1998-08-23 16:05:55 +00:00
Doug Rabson
b687821494 Remove bogus unused code. 1998-08-22 10:32:38 +00:00
Gary Palmer
6722fe2d35 Add BREAK_TO_DEBUGGER so that config stops whining 1998-08-21 23:43:15 +00:00
Doug Rabson
19df33b637 Add support for TurboChannel alphas (DEC 3000/300 and 3000/500).
Obtained from: NetBSD
Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>
1998-08-20 08:27:11 +00:00
Doug Rabson
a5f96f457f Add Miata system type and pull in the LOCATE_PCS macro from NetBSD. 1998-08-17 08:26:12 +00:00
Doug Rabson
ca13e4a93b Add breakpoint() for BREAK_TO_DEBUGGER. 1998-08-17 08:21:31 +00:00
Doug Rabson
e00c264242 Update to use elf_generic.h. 1998-08-17 08:05:55 +00:00
Doug Rabson
e99a8ba0c4 Disable some unnecessary debugging code. 1998-08-17 08:04:42 +00:00
Bruce Evans
86a14a7a0a Use [u]intptr_t instead of [u_]long for casts between pointers and
integers.  Don't forget to cast to (void *) as well.
1998-08-16 01:21:52 +00:00
Doug Rabson
d890a393ca I managed to break sparse configuration accesses with my last commit.
Pointed out by: Andrew Gallatin <gallatin@cs.duke.edu>
1998-08-13 08:11:27 +00:00
Doug Rabson
a1eff3a036 Add code from NetBSD to print CIA capabilities and try to detect Pyxis bugs. 1998-08-11 08:51:09 +00:00
Doug Rabson
c2d9f943e0 Sync with i386/isa/diskslice_machdep.c 1.31. 1998-08-11 07:17:36 +00:00
Doug Rabson
8a7b91802a Lots of changes, including:
* Support for AlphaStation 200, 250, 255, 400
* Untested support for UDB, Multia, AXPpci33 (Noname)
* Support for Personal Workstation 433a/433au, 500a/500au, 600a/600au (Miata)
* Some minor fixes and improvements to interrupt handling.

Submitted by: Andrew Gallatin <gallatin@cs.duke.edu> (AS200, Miata)
Obtained from: NetBSD (some code for AS200, Miata, Noname)
1998-08-10 07:53:59 +00:00
Doug Rabson
6aa91d039a Add support for type1 pci configuration cycles for cia (not pyxis yet).
Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>
1998-08-07 08:18:44 +00:00
Doug Rabson
88db503390 Add some more useful macros.
Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>
1998-08-07 08:17:39 +00:00
Doug Rabson
a8360ebd82 Update so that it should build a working kernel for the platforms supported
so far.
1998-08-07 08:16:31 +00:00
Doug Rabson
29a8d2fd7e Tweaks to console support.
Fixes for AS 600.
1998-08-07 08:15:16 +00:00
Doug Rabson
08b66b4483 Port syscons to the alpha. The driver itself has moved to sys/isa as it will
hopefully become a portable driver usable by all architectures.  The api
support files have had to be copied to sys/alpha/include since userland
programs expect to find them in <machine/*.h>.

All the revision history of the i386 syscons has been retained by a
repository copy.
1998-08-06 09:15:54 +00:00
Kazutaka YOKOTA
88a5f0cca7 1. Reorganized screen saver related code so that both the LKM screen
saver and splash screen can all work properly with syscons.  Note that
the splash screen option (SC_SPLASH_SCREEN) does not work yet, as it
requires additional code from msmith.

- Reorganized the splash screen code to match the latest development
  in this area.
- Delay screen switch in `switch_scr()' until the screen saver is
  stopped, if one is running,
- Start the screen saver immediately, if any, when the `saver' key is
  pressed. (There will be another commit for `kbdcontrol' to support
  this keyword in the keymap file.)
- Do not always stop the screen saver when mouse-related ioctls
  are called.  Stop it only if the mouse is moved or buttons are
  clicked; don't stop it if any other mouse ioctls are called.

2. Added provision to write userland screen savers.  (Contact me if you
are interested in writing one.)

- Added CONS_IDLE, CONS_SAVERMODE, and CONS_SAVERSTART ioctls to
  support userland screen savers.

3. Some code clean-ups.
1998-08-03 11:30:45 +00:00
Doug Rabson
e35d857d64 Cosmetic change to driver registration. 1998-07-31 09:20:35 +00:00
Doug Rabson
bb6e8960ac Only perform byte/word accesses in the correct EV56 memory space.
Sparse macros have moved to <machine/swiz.h>.
Fix sparse memory access so that it actually works as intended.
Tidy up sparse configuration access slightly.
1998-07-31 09:17:51 +00:00
Doug Rabson
1ba83e535e Add definitions of EV56 INT1/INT2/INT4/INT8 memory spaces. 1998-07-31 09:14:49 +00:00
Doug Rabson
df317c7516 Merge with i386/isa/diskslice_machdep.c 1.30 1998-07-31 09:13:25 +00:00
Doug Rabson
82153dc247 Change load address to 0xfffffc0000300000 to help support AS200. 1998-07-30 08:12:14 +00:00
Doug Rabson
25729629a2 Remove spurious printf. 1998-07-30 08:10:26 +00:00
Doug Rabson
ab1fdd6291 Fix msgbuf so that it actually works properly. 1998-07-29 18:36:29 +00:00
Bruce Evans
e4e6ae1366 Fixed print format errors. 1998-07-29 16:43:00 +00:00
Bruce Evans
e33e271f08 Fixed printf format errors.
Use offsetof() instead of null pointer hacks.  Use a home made offsetof()
because including <stddef.h> is not permitted in LKMs.
1998-07-29 15:50:41 +00:00
Doug Rabson
51f14853fd Record the new physical address of the pcb in pmap_swapin_proc.
Third attempt at pmap_remove().  This one actually works properly :-).
1998-07-28 09:34:50 +00:00
Doug Rabson
3260ced375 Macros for accessing alpha sparse device ports and memory. 1998-07-27 09:40:35 +00:00
Doug Rabson
86dd710847 Support the disabled keyword for isa devices. 1998-07-27 09:38:26 +00:00
Doug Rabson
976a1a2b57 Fix a stupid bug preventing gdb from seeing the right value of 'v0'. 1998-07-26 18:47:47 +00:00
Doug Rabson
c99399cccd Fix a stupid bug in the new pmap_remove().
Arrange for soft modified/referenced flags to be cleared when a page is freed.
1998-07-26 18:13:28 +00:00
Doug Rabson
72c36e1413 Fix pmap_enter_quick() to stop it hanging when the level 2 pte exists
but isn't valid.

Reimplement pmap_remove() to be much more efficient at removing large
stretches of addresses.

As part of reimplementing pmap_remove() fix pmap_protect() so that it stands
a hope of working.
1998-07-24 09:43:27 +00:00
Doug Rabson
b9ca15f807 Add ISA support.
Remove mcclock hack which was only needed because ISA wasn't done yet.
1998-07-22 08:34:19 +00:00
Doug Rabson
ec0bebbce7 Add some convenience functions for accessing device memory.
Add a DDB command to allow access to inb/inw/inl from the debugger.
1998-07-22 08:33:30 +00:00
Doug Rabson
53db2ca0b6 Merge KN20AA support from Andrew Gallatin.
Add support for device memory access.
Add support for ISA irqs.
1998-07-22 08:32:17 +00:00
Doug Rabson
31de2a7751 Move the mcclock from root to isa. 1998-07-22 08:30:25 +00:00
Doug Rabson
905f48d3af Add a simple ISA bus. No support for memory mapped devices or DMA as yet. 1998-07-22 08:29:26 +00:00
Doug Rabson
dd5f72e1fc Add sio support. 1998-07-22 08:28:24 +00:00
Doug Rabson
68f6efc27f Add platform functions for manipulating PCI irqs.
Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>
1998-07-22 08:27:56 +00:00
Doug Rabson
41fc8fe7b9 Add declaration of {aquire,release}_timer2(). 1998-07-22 08:26:23 +00:00
Doug Rabson
bb4752537d Add macros and chipset support for accessing device i/o memory on the alpha. 1998-07-22 08:25:39 +00:00
Doug Rabson
515cfabc48 Add KN20AA support.
Add entries for syscons.
1998-07-22 08:24:39 +00:00
Doug Rabson
237064085b Tweaks to stop config(8) warnings and to avoid an unfinished experiment of
mine.

Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>
1998-07-22 08:23:26 +00:00
Doug Rabson
eb7262ea39 Support header for sysbeep() implementation. 1998-07-22 08:21:36 +00:00
Doug Rabson
e0fbfbb576 Make ptrace single steps over branches work as intended. 1998-07-22 08:20:57 +00:00
Doug Rabson
cbda18ce6e Add support for sio's soft interrupts. 1998-07-22 08:20:15 +00:00
Doug Rabson
e17e8bbe72 Support the DEC_KN20AA platform (AlphaStation 500 or 600).
Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>
1998-07-22 08:19:39 +00:00
Doug Rabson
bba326e18d Merge changes from Andrew Gallatin to support different CIA based platforms.
Add code to identify and attach either serial or VGA console as appropriate.
1998-07-22 08:18:34 +00:00
Doug Rabson
b50b3bda1d Add code from i386 to support sysbeep(). Doesn't work quite right but it
makes a noise.
1998-07-22 08:16:34 +00:00
Doug Rabson
e344c90c80 Change siocn{put,get}c to siogdb{put,get}c to allow a serial console on one
line with serial debugging on another line.
1998-07-22 08:15:34 +00:00
Doug Rabson
3a4215418c Simplify access to PCI config registers. 1998-07-16 13:38:35 +00:00
Doug Rabson
a22401deb1 Make ptrace work. 1998-07-15 20:16:28 +00:00
Doug Rabson
6a5694427a Tweaks for cross-building from NetBSD/alpha.
Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>
1998-07-15 20:12:54 +00:00
Doug Rabson
718c0cbefb Add some debug code. 1998-07-15 20:07:33 +00:00
Doug Rabson
a6481f0baf An mc146818a clock attached to an isa bus. 1998-07-15 19:21:31 +00:00
Doug Rabson
28c3132268 Linker script for alpha kernel. 1998-07-15 19:19:24 +00:00
Bruce Evans
37889b394a Changed to the C9x draft spelling of the (unsigned) integral type
suitable for holding object pointers (ptrint_t -> uintptr_t).
Added corresponding signed type (intptr_t).  Changed/added
corresponding non-C9x types for function pointers to match.  Don't
use nonstandard types to implement these types, and don't comment
on them in <machine/types.h>.
1998-07-14 05:09:48 +00:00
Doug Rabson
52c008e810 Overhaul the spl system so that it actually works properly. 1998-07-12 16:32:10 +00:00
Doug Rabson
8e8c234f4d Don't bother calling pmap_emulate_reference() from cpu_fork(). It isn't
needed and it panics a DIAGNOSTIC kernel.
1998-07-12 16:30:58 +00:00
Doug Rabson
bb8a6f725b Define option DEC_EB164 1998-07-12 16:28:09 +00:00
Doug Rabson
3a130d871a Add entry for prom console. 1998-07-12 16:27:34 +00:00
Doug Rabson
8777a8098d Add some bits and pieces for my test box. 1998-07-12 16:26:52 +00:00
Doug Rabson
d538e9fca6 Update to new interrupt api. 1998-07-12 16:23:19 +00:00
Doug Rabson
d19af714d3 Implement CIA interrupts.
Obtained from: SRM console magic from NetBSD
1998-07-12 16:17:54 +00:00
Doug Rabson
b46e6c4115 Implement intr_create/intr_connect. 1998-07-12 16:16:22 +00:00
Doug Rabson
2895b128c7 Implement promcncheckc. 1998-07-12 16:15:06 +00:00
Doug Rabson
a85c203100 Add some debug code.
Always clear TLB in pmap_activate, even if activating curproc's pmap.
1998-07-12 16:13:54 +00:00
Doug Rabson
78e3c75746 Add a couple of sysctls and implement sendsig/sigreturn.
Obtained from: signal code from NetBSD
1998-07-12 16:10:52 +00:00
Doug Rabson
56abfaf4eb Add some generic interrupt dispatch code. 1998-07-12 16:09:30 +00:00
Doug Rabson
cefd88ce75 Add definition of p_switchtime. 1998-07-12 16:08:15 +00:00
Doug Rabson
3b7389bd33 Include opt_ddb.h. 1998-07-12 16:07:43 +00:00
Doug Rabson
323df54807 Hardwire the root disk of my test box for now. 1998-07-12 16:07:05 +00:00
Jordan K. Hubbard
d14897d381 Quick and dirty support for Linux's mremap. Not used by anything
but quake2 AFAIK.

Submitted by:   Luoqi Chen <luoqi@watermarkgroup.com>
1998-07-10 22:30:08 +00:00
Bruce Evans
1009171eb2 Oops, forgot to modify the pointer-int typedefs from the i386 version. 1998-07-10 02:34:50 +00:00
Bruce Evans
2e480d34aa Added a kernel-only typedef (ptrint_t) giving an integral type that is
least unsuitable for holding an object pointer.  This should have been
used to fix warnings about casts between pointers and ints on alphas.

Moved corresponding existing general typedef (fptrint_t) for function
pointers from the i386 <machine/profile.h> to a kernel-only typedef
in <machine/types.h>.  Kludged libc/gmon/mcount.c so that it can
still see this typedef.
1998-07-10 02:27:16 +00:00
Warner Losh
f71f5262b1 Add the ability to suspend as well as hibernate to the system. This
is the kernel part of my commits, the userlevel stuff will be done in
a separate commit.  Add the ability to suspend as well as hibernate to
syscons.  Create a new virtual key like hibernate for suspend.  Update
apm_bios.h to define more apm bios goodies.
1998-07-06 06:29:07 +00:00
Doug Rabson
be90e52a12 Add support for kernel gdb. 1998-07-05 12:24:18 +00:00
Doug Rabson
638ccebd00 Use byte/word access in badaddr if relevant. 1998-07-05 12:22:56 +00:00
Doug Rabson
36ed9b0405 Support channel B as well as channel A. 1998-07-05 12:16:55 +00:00
Doug Rabson
e6d4206665 Add basic support for 2117x pci chipsets. Currently only pyxis (21174)
is supported.  Older chipsets will be easy to support later but right now,
I just want to boot my 164LX scratch machine :-).
1998-07-05 12:16:15 +00:00
Doug Rabson
e16d98b08c Add macros for byte/word sized load and store instructions. 1998-07-05 12:14:15 +00:00
Doug Rabson
ac49021837 Add declaration of the NetBSD/alpha bootinfo. 1998-07-05 12:13:18 +00:00
Doug Rabson
b3cfa43c24 First steps at supporting EB164 (AlphaPC 164, 164LX, 164SX). 1998-07-05 12:10:10 +00:00
Doug Rabson
5aade7d9d3 Define bio_imask to allow the ncr driver to compile. The idea of passing
mask address around when registering interrupts is wrong IMHO.  We should
use a priority level like IPL_BIO and the lower levels can then translate
it into a mask if they want.
1998-07-05 12:08:59 +00:00
Doug Rabson
43ab2043e9 Make the prom console work as a real device as well as a console. 1998-07-05 11:59:44 +00:00
Doug Rabson
86cabe47cb Make sure hold_count for level 2 maps is maintained properly.
Simplify pmap_mapdev (its still totally wrong for the alpha).
1998-07-05 11:58:35 +00:00
Doug Rabson
f4487e1157 Make breakpoints and single-step work. 1998-06-28 01:00:27 +00:00
Doug Rabson
3bf983fb25 Add a macro for testing the e_machine field of Elf64_Ehdr. 1998-06-28 00:50:35 +00:00
Doug Rabson
949398af9d Use elf symbols in DDB. 1998-06-28 00:48:48 +00:00
Doug Rabson
812e7ee3e3 Allow gentrap. 1998-06-28 00:47:50 +00:00
Doug Rabson
eb9fc51b1d Call ddb_trap() for gentrap on SimOS since I am using gentrap for DDB
breakpoints (SimOS uses bpt itself for external debuggers).
1998-06-28 00:47:20 +00:00
Doug Rabson
454157c1d3 Add a hack to get the ELF symbols from where SIMOS leaves them. 1998-06-28 00:45:50 +00:00
Doug Rabson
1b7d1a7357 machine/conf.h no longer exists. 1998-06-28 00:44:51 +00:00
Doug Rabson
44dc956d24 Add some stack backtrace support. Pretty fragile but its a start. 1998-06-27 15:37:43 +00:00
Doug Rabson
eb74dcc872 Use %lx for printing register contents. 1998-06-27 15:35:57 +00:00
Doug Rabson
b87cfa799e Make uoff_t compile. 1998-06-27 15:35:00 +00:00
Bruce Evans
461792a572 The isa device configuration hook was especially useless here. 1998-06-17 15:55:22 +00:00
Amancio Hasty
6797869271 Reviewed by: Amancio
Submitted by:	Randall Hopper <rhh@ct.picker.com>
    The patch supports using the X10 Mouse Remote in both stand-alone and
pass-through configurations, so you can plug your mouse and remote into the
same serial port, use the mouse for X, and use the remote for other apps
like Fxtv. For instance, we can now control fxtv via the remote control
just like a TV : change channels, mute, increase volume, zoom video,
freeze frame 8)

     The mouse events are channeled through the syscons/sysmouse I/F like
normal, and the remote buttons are "syphoned off" to a UNIX-domain stream
socket (defined as _PATH_MOUSEREMOTE in <machine/mouse.h>) for a
remote-aware app to grab and use.

For further info on the X10 Mouse Remote see:
http://www.x10.com/products/x10_mk19a.htm
1998-06-14 20:05:27 +00:00
Bruce Evans
a525aa3424 Added uoff_t. 1998-06-14 15:26:03 +00:00
Doug Rabson
2f41bd7203 Declare zs_cnattach. 1998-06-14 13:58:57 +00:00
Doug Rabson
b1bf661000 [Add missing files from previous commit]
Major changes to the generic device framework for FreeBSD/alpha:

* Eliminate bus_t and make it possible for all devices to have
  attached children.

* Support dynamically extendable interfaces for drivers to replace
  both the function pointers in driver_t and bus_ops_t (which has been
  removed entirely.  Two system defined interfaces have been defined,
  'device' which is mandatory for all devices and 'bus' which is
  recommended for all devices which support attached children.

* In addition, the alpha port defines two simple interfaces 'clock'
  for attaching various real time clocks to the system and 'mcclock'
  for the many different variations of mc146818 clocks which can be
  attached to different alpha platforms.  This eliminates two more
  function pointer tables in favour of the generic method dispatch
  system provided by the device framework.

Future device interfaces may include:

* cdev and bdev interfaces for devfs to use in replacement for specfs
  and the fixed interfaces bdevsw and cdevsw.

* scsi interface to replace struct scsi_adapter (not sure how this
  works in CAM but I imagine there is something similar there).

* various tailored interfaces for different bus types such as pci,
  isa, pccard etc.
1998-06-14 13:53:12 +00:00
Doug Rabson
99d11cde56 Major changes to the generic device framework for FreeBSD/alpha:
* Eliminate bus_t and make it possible for all devices to have
  attached children.

* Support dynamically extendable interfaces for drivers to replace
  both the function pointers in driver_t and bus_ops_t (which has been
  removed entirely.  Two system defined interfaces have been defined,
  'device' which is mandatory for all devices and 'bus' which is
  recommended for all devices which support attached children.

* In addition, the alpha port defines two simple interfaces 'clock'
  for attaching various real time clocks to the system and 'mcclock'
  for the many different variations of mc146818 clocks which can be
  attached to different alpha platforms.  This eliminates two more
  function pointer tables in favour of the generic method dispatch
  system provided by the device framework.

Future device interfaces may include:

* cdev and bdev interfaces for devfs to use in replacement for specfs
  and the fixed interfaces bdevsw and cdevsw.

* scsi interface to replace struct scsi_adapter (not sure how this
  works in CAM but I imagine there is something similar there).

* various tailored interfaces for different bus types such as pci,
  isa, pccard etc.
1998-06-14 13:46:10 +00:00
Doug Rabson
c48c13cb5a Reimplement spl*() as function calls. Implement software interrupts. 1998-06-11 11:51:27 +00:00
Doug Rabson
bcb4edfc14 Add missing Id keywords. 1998-06-11 07:15:55 +00:00
Doug Rabson
71cf4ef7be Add my own copyright to this file. In this case not even the comments
resemble the NetBSD source so the NetBSD copyright has been removed.
1998-06-10 20:48:03 +00:00
Doug Rabson
10bd78e08d Add my own copyright to this file. The only remnants of NetBSD code here
are in the comments.  As such the NetBSD copyright is included to protect
the valuable intellectual copyright included in those comments.
1998-06-10 20:40:59 +00:00
Doug Rabson
ecf6bca146 Add yet another copyright. If some CVS wizard feels like nuking the versions
that so offend Jason Thorpe then they can.
1998-06-10 20:35:10 +00:00
Doug Rabson
64f14464e5 Fix mangled Id keyword. 1998-06-10 20:13:32 +00:00
Doug Rabson
f7491b1657 Add Id keyword. 1998-06-10 20:11:16 +00:00
Doug Rabson
5c09fbfe64 Add missing copyrights. Thanks to Jason Thorpe for politely noting the
mistake...
1998-06-10 19:59:41 +00:00
Doug Rabson
897cd717a5 Add initial support for the FreeBSD/alpha kernel. This is very much a
work in progress and has never booted a real machine.  Initial
development and testing was done using SimOS (see
http://simos.stanford.edu for details).  On the SimOS simulator, this
port successfully reaches single-user mode and has been tested with
loads as high as one copy of /bin/ls :-).

Obtained from: partly from NetBSD/alpha
1998-06-10 10:57:29 +00:00
Bruce Evans
9ae58db7a3 Include "opt_compat.h" explicitly instead of depending on
makesyscalls.sh generating it as pollution.

Don't attempt to separate the includes by newlines.  makesyscalls.sh
just ignores newlines.
1998-06-09 03:28:14 +00:00
Doug Rabson
ecbb00a262 This commit fixes various 64bit portability problems required for
FreeBSD/alpha.  The most significant item is to change the command
argument to ioctl functions from int to u_long.  This change brings us
inline with various other BSD versions.  Driver writers may like to
use (__FreeBSD_version == 300003) to detect this change.

The prototype FreeBSD/alpha machdep will follow in a couple of days
time.
1998-06-07 17:13:14 +00:00
John Birrell
d57ddeeb63 libtcl expects to see ieeefp.h definitions through this header. 1998-05-13 22:40:42 +00:00
Eivind Eklund
d563a53a79 Unbotch whitespace and change switch with two cases to if.
Noticed by:	bde
1998-05-07 00:42:25 +00:00
Eivind Eklund
288078be0f Translate T_PROTFLT to SIGSEGV instead of SIGBUS when running under
Linux emulation.  This make Allegro Common Lisp 4.3 work under
FreeBSD!

Submitted by: Fred Gilham <gilham@csl.sri.com>
Commented on by: bde, dg, msmith, tg
Hoping he got everything right:  eivind
1998-04-28 18:15:08 +00:00
Søren Schmidt
958a082931 Added EIDRM & ENOMSG to errno translation table. 1998-04-13 17:49:51 +00:00
Peter Wemm
1e8dabab3f The linux chown syscall is more like lchown, a new chown syscall that
follows links was added.
1998-03-29 07:59:10 +00:00
Peter Wemm
d5e73b9fe5 Patch up some space/tab problems. It looks like some of this came
from an xterm via cut/paste.  No other changes apart from whitespace.
1998-03-29 07:53:19 +00:00
Peter Wemm
c740a51211 Add in placeholders for the newer linux syscalls 1998-03-29 06:35:22 +00:00
Peter Dufault
8a6472b723 Finish _POSIX_PRIORITY_SCHEDULING. Needs P1003_1B and
_KPOSIX_PRIORITY_SCHEDULING options to work.  Changes:

Change all "posix4" to "p1003_1b".  Misnamed files are left
as "posix4" until I'm told if I can simply delete them and add
new ones;

Add _POSIX_PRIORITY_SCHEDULING system calls for FreeBSD and Linux;

Add man pages for _POSIX_PRIORITY_SCHEDULING system calls;

Add options to LINT;

Minor fixes to P1003_1B code during testing.
1998-03-28 11:51:01 +00:00
John Birrell
fb52ada2d6 Add vm_ooffset_t and vm_pindex_t that FreeBSD uses (but NetBSD doesn't).
Ugh, this is for user code that looks into vm_map_entry. I'd shoot
it but semi-automatic guns aren't legal here anymore. 8-(
1998-03-23 08:17:16 +00:00
John Birrell
afe4dfa050 Added a null entry for sysmk that is generated by makesyscalls.sh.
Gee, I wish there was a better way to run makesyscalls.sh so that
a make world finds missing things like this. Running it manually
sucks.

Pointed out by: Peter Dufault
1998-03-13 19:13:54 +00:00
John Birrell
2bbb0ff141 Updates to reflect differences in what NetBSD does and what FreeBSD
userland expects.
1998-03-09 05:53:13 +00:00
John Birrell
74712ec974 Import NetBSD/Alpha headers needed to get the FreeBSD userland to compile
(and even run). These files don't necessarily make sense for a
FreeBSD/Alpha kernel build. That will come later and these files
will be changed accordingly.
1998-03-09 05:43:16 +00:00
Bruce Evans
9d767d027e Staticized. 1998-02-13 07:34:52 +00:00
Poul-Henning Kamp
befeeb59cb Add display of type KD_PIXEL. 1998-02-12 20:47:39 +00:00
Eivind Eklund
d131a704ed De-staticize enough to make all the LKMs work again. Add comments where
deemed relevant.
1998-02-11 01:46:50 +00:00
Eivind Eklund
303b270b0a Staticize. 1998-02-09 06:11:36 +00:00
Eivind Eklund
0b08f5f737 Back out DIAGNOSTIC changes. 1998-02-06 12:14:30 +00:00
Eivind Eklund
47cfdb166d Turn DIAGNOSTIC into a new-style option. 1998-02-04 22:34:03 +00:00
Bruce Evans
919de96974 Fixed conflicts between <machine/console.h> and <machine/pcvt_ioctl.h>,
so that it is possible for kdump and truss to include them both.  Use
#defines from pcvt_ioctl.h in conflicting cases, since pcvt_ioctl.h
gives a hint about the bogus third arg to _IO().  Ifdef the common
typedefs.  Export `struct key_t' from pcvt_ioctl.h so pcvt_ioctl.h is
bug for bug compatible with console.h (now both are broken in C++
mode).
1998-02-03 19:57:46 +00:00
Bruce Evans
2625bd3484 Declare printf() instead of including <stdio.h>, so that this doesn't
depend on anything outside of the "sys" tree.
1998-02-01 18:47:56 +00:00
John Birrell
013239afdf Suggested by: bde
Move sigjmp_buf and jmp_buf structure definitions to machine/setjmp.h
so that i386 can continue to use int as the basic register type and
alpha can use long. Bruce was concerned about possible differing
alignment. I've left the definition of _JBLEN in machine/setjmp.h
even though Bruce's example used the number directly. I don't know if
any other code relies on _JBLEN, so I left it to avoid potential
breakage.
1998-01-20 09:09:24 +00:00
John Birrell
e1e80781ba Add a machine dependent header to size the jmpbuf instead of piling
machine dependencies in src/include/setjmp.h.
1998-01-10 23:00:06 +00:00
John Birrell
e1f16a3aa3 PAL codes needed for asm.h 1998-01-10 22:42:21 +00:00
John Birrell
a3a38f0526 Header files which are linked from /usr/include to /usr/include/machine.
NetBSD's endian.h needs sys/types.h for the typedefs that are used to
get htonl() correct when a long is 64 bits.
1998-01-10 22:09:53 +00:00
John Birrell
7fed2e3a32 These are a few of the alpha machine dependent header files - the first
referenced by the build of user-space libraries. These files were
obtained from NetBSD (with ansi.h being modified to reflect the FreeBSD
off_t and pid_t implementation).
1998-01-10 10:13:16 +00:00
Kazutaka YOKOTA
a3bd3dac25 Added accent (dead) key support to syscons and kbdcontrol.
With a keymap with accent key definitions loaded to syscons, you press
an accent key followed by a regular letter key to produce an accented
letter.  Press an accent key followed by the space bar to get the
accent letter itself.

Code is based on the ideas and work by jmrueda@diatel.upm.es and
totii@est.is.

PR: i386/4016

console.h
- Defined structures and constants for accent (dead) keys.

syscons.c, kbdtables.h
- When an accent key is pressed, set the corresponding index to
  `accents'.  If the next key is the space key, produce the accent char
  itself.  Otherwise search the accent key map entry, indexed by
  `accents', for a matching pair of a regular char and an accented char.
- Added ioctl functions to set and get the accent key map (PIO_DEADKEYMAP
  and GIO_DEADKEYMAP).
1998-01-07 08:40:34 +00:00
KATO Takenori
c7da3245da I should not edit linux_prot.h directly. Fix the argument of linux_nice.
Pointed out by:	Eivind Eklund <eivind@FreeBSD.ORG>
	NOPROTO	LINUX	{ int getpgrp(void); }
66	NOPROTO	LINUX	{ int setsid(void); }
67	STD	LINUX	{ int linux_sigaction(int sig, \
			    struct linux_sigaction *nsa, \
			    struct linux_sigaction *osa); }
68	STD	LINUX	{ int linux_siggetmask(void); }
69	STD	LINUX	{ int linux_sigsetmask(linux_sigset_t mask); }
70	NOPROTO	LINUX	{ int setreuid(int ruid, int euid); }
71	NOPROTO	LINUX	{ int setregid(int rgid, int egid); }
72	STD	LINUX	{ int linux_sigsuspend(int restart, \
			    linux_sigset_t oldmask, linux_sigset_t mask); }
73	STD	LINUX	{ int linux_sigpending(linux_sigset_t *mask); }
74	NOPROTO	LINUX	{ int osethostname(char *hostname, \
			    u_int len);}
75	NOPROTO	LINUX	{ int osetrlimit(u_int which, \
			    struct ogetrlimit *rlp); }
76	NOPROTO	LINUX	{ int ogetrlimit(u_int which, \
			    struct ogetrlimit *rlp); }
77	NOPROTO	LINUX	{ int getrusage(int who, struct rusage *rusage); }
78	NOPROTO	LINUX	{ int gettimeofday(struct timeval *tp, \
			    struct timezone *tzp); }
79	NOPROTO	LINUX	{ int settimeofday(struct timeval *tp, \
			    struct timezone *tzp); }
80	NOPROTO	LINUX	{ int getgroups(u_int gidsetsize, gid_t *gidset); }
81	NOPROTO	LINUX	{ int setgroups(u_int gidsetsize, gid_t *gidset); }
82	STD	LINUX	{ int linux_select(struct linux_select_argv *ptr); }
83	STD	LINUX	{ int linux_symlink(char *path, char *to); }
84	NOPROTO	LINUX	{ int ostat(char *path, struct ostat *up); }
85	STD	LINUX	{ int linux_readlink(char *name, char *buf, \
			    int count); }
86	STD	LINUX	{ int linux_uselib(char *library); }
87	NOPROTO	LINUX	{ int swapon(char *name); }
88	NOPROTO	LINUX	{ int reboot(int opt); }
89	STD	LINUX	{ int linux_readdir(int fd, struct linux_dirent *dent, \
			    unsigned int count); }
90	STD	LINUX	{ int linux_mmap(struct linux_mmap_argv *ptr); }
91	NOPROTO	LINUX	{ int munmap(caddr_t addr, int len); }
92	STD	LINUX	{ int linux_truncate(char *path, long length); }
93	NOPROTO	LINUX	{ int oftruncate(int fd, long length); }
94	NOPROTO	LINUX	{ int fchmod(int fd, int mode); }
95	NOPROTO	LINUX	{ int fchown(int fd, int uid, int gid); }
96	NOPROTO	LINUX	{ int getpriority(int which, int who); }
97	NOPROTO	LINUX	{ int setpriority(int which, int who, int prio); }
98	NOPROTO	LINUX	{ int profil(caddr_t samples, u_int size, \
			    u_int offset, u_int scale); }
99	STD	LINUX	{ int linux_statfs(char *path, \
			    struct linux_statfs_buf *buf); }
100	STD	LINUX	{ int linux_fstatfs(int fd, \
			    struct linux_statfs_buf *buf); }
101	STD	LINUX	{ int linux_ioperm(unsigned int lo, \
			    unsigned int hi, int val); }
102	STD	LINUX	{ int linux_socketcall(int what, void *args); }
103	STD	LINUX	{ int linux_ksyslog(int what); }
104	STD	LINUX	{ int linux_setitimer(u_int which, \
			    struct itimerval *itv, struct itimerval *oitv); }
105	STD	LINUX	{ int linux_getitimer(u_int which, \
			    struct itimerval *itv); }
106	STD	LINUX	{ int linux_newstat(char *path, \
			    struct linux_newstat *buf); }
107	STD	LINUX	{ int linux_newlstat(char *path, \
			    struct linux_newstat *buf); }
108	STD	LINUX	{ int linux_newfstat(int fd, struct linux_newstat *buf); }
109	STD	LINUX	{ int linux_uname(struct linux_old_utsname *up); }
110	STD	LINUX	{ int linux_iopl(int level); }
111	STD	LINUX	{ int linux_vhangup(void); }
112	STD	LINUX	{ int linux_idle(void); }
113	STD	LINUX	{ int linux_vm86(void); }
114	STD	LINUX	{ int linux_wait4(int pid, int *status, \
			    int options, struct rusage *rusage); }
115	STD	LINUX	{ int linux_swapoff(void); }
116	STD	LINUX	{ int linux_sysinfo(void); }
117	STD	LINUX	{ int linux_ipc(int what, int arg1, int arg2, int arg3, \
			    caddr_t ptr); }
118	NOPROTO	LINUX	{ int fsync(int fd); }
119	STD	LINUX	{ int linux_sigreturn(struct linux_sigcontext *scp); }
access
1997-12-17 03:12:35 +00:00
Eivind Eklund
5591b823d1 Make COMPAT_43 and COMPAT_SUNOS new-style options. 1997-12-16 17:40:42 +00:00
Mike Smith
7ebfc603cf As described by the submitter:
These patches enables us to play quake2 .

Support linux keyboard ioctl for setting RAW, MEDIUMRAW and XLATE.

Support linux virtual terminal operations:
 OPENQRY, GETMODE, SETMODE, GETSTATE, ACTIVATE, and WAITACTIVE.

Submitted by:	Amancio Hasty <hasty@rah.star-gate.com>
1997-12-15 06:09:11 +00:00
Kazutaka YOKOTA
c6d1bed112 - Add support for the following mice to psm/moused/sysmouse:
MS IntelliMouse, Kensington Thinking Mouse, Genius NetScroll,
  Genius NetMouse, Genius NetMouse Pro, ALPS GlidePoint, ASCII
  MieMouse, Logitech MouseMan+, FirstMouse+

- The `psm' driver is made to recognize various models of PS/2 mice
and enable their extra features so that their additional buttons and
wheel/roller are recognized. The name of the detected model will be
printed at boot time.

- A set of new ioctl functions are added to the `psm', `mse' and
`sysmouse' drivers so that the userland program (such as the X server)
can query device information and change driver settings.

- The wheel/roller movement is handled as the `Z' axis movement by the
mouse drivers and the moused daemon. The Z axis movement may be mapped
to another axis movement or buttons.

- The mouse drivers support a new, standard mouse data format,
MOUSE_PROTO_SYSMOUSE format which can encode x, y, and x axis movement
and up to 10 buttons.

/sys/i386/include/mouse.h
- Added some fields to `mousestatus_t' to store Z axis movement
  and flag bits.
- Added the field `model' to `mousehw_t' to store mouse model code.
  Defined model codes.
- Extended `mousemode_t'.
- Added new protocols and some constants for them.
- Added new ioctl functions and structures.
- Removed obsolete ioctl definitions.

/sys/i386/include/console.h
- Added `dz' field to the structure `mouse_data' to pass Z axis movement
  to `syscons/sysmouse'.
- Removed LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON.  Use button bits
  defined in `mouse.h' instead.

/sys/i386/isa/psm.c
- Added a set of functions to detect various mice which have additional
  features (wheel and buttons) unavailable in the standard PS/2 mouse.
- Refined existing ioctl functions and added new ones.  Most important
  of all is MOUSE_SETLEVEL which manipulates the output level of the driver.
  While the output level remains zero, the output from the `psm' driver is
  in the standard PS/2 mouse format (three bytes long).  When the level
  is set to one, the `psm' driver will send data in the extended format.
  At the level two the driver uses the format which is native to the
  connected mouse is used. (Meaning that the output from the device is
  passed to the caller as is, unmodified.)  The `psm'  driver will pass
  such extended data format as is to the caller if the output level is
  two, but emulates the standard format if the output level is zero.
- Added kernel configuration flags to set initial resolution
  (PSM_CONFIG_RESOLUTION) and acceleration (PSM_CONFIG_ACCEL).
- Removed the compile options PSM_ACCEL, PSM_CHECKSYNC and PSM_EMULATION.
  Acceleration ratio is now specified by the kernel configuration flags
  stated above.  Sync check logic is refined and now standard.
  The sync check can be turned off by the new kernel configuration flags
  PSM_CONFIG_NOCHECKSYNC (0x100).  PSM_EMULATION has been of little use.
- Summer clean up :-)  Removed unused code and obsolete comments.

/sys/i386/isa/mse.c
- Created mseioctl() to deal with ioctl functions MOUSE_XXXX.
  Most importantly, the MOUSE_SETLEVEL ioctl will change the
  output format from the 5 byte format to the new, extended format
  so that the caller can take advantage of Z axis movement and additional
  buttons.
- Use constants defined in `mouse.h' rather than magic numbers.

/sys/i386/isa/syscons.c
- Changed scioctl() to reflect the new `console.h' and some of the new
  ioctls defined in `mouse.h'.  Most importantly, the MOUSE_SETLEVEL
  ioctl will change the `sysmouse' output format from the MouseSystems
  5 byte format to the new, extended format so that the caller can
  take advantage of Z axis movement and additional buttons.
- Added support for double/triple click actions of the left button and
  single click action of the right button in the virtual console.  The
  left button double click will select a word under the mouse pointer.
  The triple click will select a line and the single click of the right
  button will extend the selected region to the current position of
  the mouse pointer.  This will make the cut/paste support more compatible
  with xterm.

/sys/i386/isa/kbdio.h
- Added PSM_INTELLI_ID.
1997-12-07 08:09:19 +00:00
Amancio Hasty
53eaeb96ba Added support for linux sound ioctls:
LINUX_SNDCTL_DSP_GETOPTR
LINUX_SNDCTL_DSP_GETIPTR
LINUX_SNDCTL_DSP_SETTRIGGER
LINUX_SNDCTL_DSP_GETCAPS

With this rev level the linux realaudio player 5 and xquake should work.
1997-11-17 04:00:32 +00:00
Poul-Henning Kamp
cb226aaa62 Move the "retval" (3rd) parameter from all syscall functions and put
it in struct proc instead.

This fixes a boatload of compiler warning, and removes a lot of cruft
from the sources.

I have not removed the /*ARGSUSED*/, they will require some looking at.

libkvm, ps and other userland struct proc frobbing programs will need
recompiled.
1997-11-06 19:29:57 +00:00
KATO Takenori
404c835d69 Implement linux_iopl and linux_nice. 1997-10-29 08:17:14 +00:00
KATO Takenori
9b86a4168f Implement linux_semop, linux_semget and linux_semctl.
PR:		4355
1997-10-28 10:50:02 +00:00
Kazutaka YOKOTA
63f87bd194 Rename MOUSE_GETINFO to MOUSE_GETHWINFO. The name collided with the one
in console.h.
Pointed out by bde.
1997-10-19 10:45:18 +00:00
Søren Schmidt
3bd724f2b3 Add a new keyboard mode K_CODE. Returns a single byte for each key
much like the scancode mode.
However the keys that (for no good reason) returns extension codes
etc, are translated into singlebyte codes.
Needed by libvgl.  This makes life ALOT easier, also the XFree86
folks could use this.
1997-10-01 20:46:29 +00:00