Commit Graph

47637 Commits

Author SHA1 Message Date
sommerfeld 926b6ff132 since seg regs are 16 bits, toss high order bits from the trapframe 2001-06-18 03:32:14 +00:00
christos 59abdecf4b Add a linux specific trapsignal() function. This is just a passthrough
on all platforms but the i386. On the i386 we look at T_PROTFLT and send
a SIGSEGV instead of SIGBUS. This makes allegro lisp 5.0 and pvs (a proof
verification system) to work.

XXX[1]: We need to go through each architecture and verify that we send
        the correct signal on each trap type.
XXX[2]: trap.c on all other architectures but i386 needs to be modified
        to s/trapsignal/(*p->p_emul->e_trapsignal)/g
2001-06-18 02:04:42 +00:00
christos 0f380fac15 Add an e_trapsignal member to struct emul, so that emulated processes can
send the appropriate signal depending on the trap type.
2001-06-18 02:00:48 +00:00
simonb 1506d21315 Make error checking/reporting a little more correct. 2001-06-18 01:58:08 +00:00
sommerfeld 7e7d262c34 Add %fs/%gs to trap frame and save/restore them on
trap/interrupt/syscall entry from userspace.

Remove special-case "by hand" validation of fs/gs register values as
well as special handling of them in various signal handling paths.

Now, like %ds and %es, they are validated by the hardware on return to
userland.

This paves the way for the use of %fs for per-cpu data on
multiprocessor systems, and fixes an otherwise difficult-to-fix
interaction between threads/clone(2) and USER_LDT.

Discussed in advance with Frank van der Linden.
2001-06-17 21:01:32 +00:00
tsubai 1614d87d0e Support the new iBook. 2001-06-17 19:54:47 +00:00
tsubai de98ab5b38 Regen. 2001-06-17 19:51:27 +00:00
tsubai b63b6d01e6 Add device IDs on the new iBook. 2001-06-17 19:50:33 +00:00
tsubai 91f99e1981 Forgot to commit this -- move file .../bus_dma.c line to files.${machine}. 2001-06-17 19:32:17 +00:00
jdolecek adaaf11f9f make pckbc_slot_names[], pckbc_portcmd const 2001-06-17 16:15:41 +00:00
nonaka 31794a5423 NEWPMAP 2001-06-17 16:01:28 +00:00
nonaka b83f37566d identified prep model. (I missed it...) 2001-06-17 15:59:57 +00:00
nonaka 5098ff59f6 identified prep model. 2001-06-17 15:57:11 +00:00
thorpej 97354efd4d More corrections. 2001-06-17 14:54:29 +00:00
kleink abaced98c3 Fix context handling for 32-bit environments:
* Really pass PSR ICC bits instead of raw CCR.
* Don't touch ASI and FPRS, which are not part of the 32-bit mcontext.
Also, correct printf conversions in svr4_printmcontext.
2001-06-17 14:39:32 +00:00
simonb 56151c1fef Make this compile and work for the IBM 4xx series CPUs. 2001-06-17 13:39:33 +00:00
simonb d70d5d1ee0 Use _C_LABEL() for externally referenced symbols. 2001-06-17 13:39:02 +00:00
simonb 0647591d3a Globalise "trapexit" for new ddb tracing changes. 2001-06-17 13:38:33 +00:00
simonb 91817c8f5e s/workstations/machines/ for pmax and sgimips. Make the description of
the walnut more technically correct.
2001-06-17 13:37:01 +00:00
kleink db52b31344 Save/restore only the FP register file as far as the 32-bit environment
is concerned; in particular, don't overrun the [mu]context.
2001-06-17 13:10:05 +00:00
perry 407eec5184 minor fixes 2001-06-17 04:10:16 +00:00
lukem 24c92d43e5 minor typo 2001-06-17 00:48:28 +00:00
cyber 662f93aeeb Change the way boot strings are handled and the way the root device
is determined.  This allows multiple internal disks in a raq2 to work.
2001-06-17 00:11:40 +00:00
christos 38527630e2 fixes from perry 2001-06-16 23:17:34 +00:00
christos 002c8b43f1 Add a list with a brief description of each ports. With 43 ports right
now it is a bit tough to collect all the information.

XXX: Portmasters, or people who know better, please correct any mistakes.
2001-06-16 23:04:15 +00:00
manu ff5ce5bd93 Removed obsoletes EMUL_NO_BSD_ASYNCIO_PIPE and EMUL_NO_SIGIO_ON_READ flags.
Async I/O OS specifities should now handled in OS specific code. Linux
has been done, but other emulation should be handled. See case LINUX_F_SETFL
in sys/compat/linux/common/linux_file.c:linux_sys_fcntl() for more details.

The data that has been collected yet:

                                  Net Free Open Linux SunOS AIX OSF1 Darwin
send SIGIO to write end of pipe     Y  N    N     N     N    N   Y     Y
send SIGIO to read end of pipe      Y  Y    N     N     N    ?   Y     ?
send SIGIO to write end of socket   Y  Y    Y     N     N    Y   Y     Y
send SIGIO to read end of socket    Y  Y    Y     Y     Y    ?   Y     ?
2001-06-16 22:05:36 +00:00
manu a7cdf998ec Removed obsoletes EMUL_NO_BSD_ASYNCIO_PIPE and EMUL_NO_SIGIO_ON_READ flags.
Async I/O OS specifities should now handled in OS specific code. Linux
has been done, but other emulation should be handled. See case LINUX_F_SETFL
in sys/compat/linux/common/linux_file.c:linux_sys_fcntl() for more details.

The data that has been collected yet:

                                  Net Free Open Linux SunOS AIX OSF1 Darwin
send SIGIO to write end of pipe		Y  N    N     N     N    N   Y     Y
send SIGIO to read end of pipe      Y  Y    N     N     N    ?   Y     ?
send SIGIO to write end of socket   Y  Y    Y     N     N    Y   Y     Y
send SIGIO to read end of socket    Y  Y    Y     Y     Y    ?   Y     ?
2001-06-16 21:44:27 +00:00
manu ce10f4da5b Linux does not send a SIGIO to the write end of a socket,
neither it does send any SIGIO for pipes. If async I/O
was requested, we keep the SS_ASYNC in struct socket flag
set, but we clear SB_ASYNC flags on the sending buffer
(for socket), and on the sending and the receiving buffer
(for pipes).

Because we do not alter to SS_ASYNC in struct socket,
the Linux process keeps a consistent view of async I/O
status if it attemps to read the async flag (SS_ASYNC)

This async I/O problem does matters, since some Linux
a programs such as the JDK request async I/O on pipes,
but they fail if they happen to get a SIGIO to the write
end of the pipe.
2001-06-16 21:32:51 +00:00
manu 94a4020177 Use SB_ASYNC in struct sockbuf sb_flags field instead of SS_ASYNC in
struct socket so_state field to decide if we need to send asynchronous
notifications. This makes possible to request notification on write but
not on read, and vice versa.

This is used in Linux emulation code, because when async I/O is requested,
Linux does not send SIGIO to write end of sockets, and it never send any
SIGIO to any end of pipes. Il Linux emulation code, we then set SB_ASYNC
only on the read end of sockets, and on no end for pipes.
2001-06-16 21:29:32 +00:00
tsutsui 01704d0990 Add iha at pci, which just works on my CATS. 2001-06-16 13:58:18 +00:00
toshii bf923a99b8 Don't set HPCFB_SWAP_BYTE (if little endian). 2001-06-16 12:53:05 +00:00
jdolecek 60a45fb944 export sys/pipe.h 2001-06-16 12:02:13 +00:00
jdolecek ee882e3a09 Add port of high performance pipe implementation written by John S. Dyson
for FreeBSD project. Besides huge speed boost compared with socketpair-based
pipes, this implementation also uses pagable kernel memory instead of mbufs.

Significant differences to FreeBSD version:
* uses uvm_loan() facility for direct write
* async/SIGIO handling correct also for sync writer, async reader
* limits settable via sysctl, amountpipekva and nbigpipes available via sysctl
* pipes are unidirectional - this is enforced on file descriptor level
	for now only, the code would be updated to take advantage of it
	eventually
* uses lockmgr(9)-based locks instead of home brew variant
* scatter-gather write is handled correctly for direct write case, data
  is transferred by PIPE_DIRECT_CHUNK bytes maximum, to avoid running out of kva

All FreeBSD/NetBSD specific code is within appropriate #ifdef, in preparation
to feed changes back to FreeBSD tree.

This pipe implementation is optional for now, add 'options NEW_PIPE'
to your kernel config to use it.
2001-06-16 12:00:02 +00:00
jdolecek 02d39f046b Import FreeBSD sys/pipe.h rev 1.17 for reference (this was used as a base
for the NetBSD port).
2001-06-16 09:23:11 +00:00
jdolecek 664cf935c7 Import FreeBSD sys_pipe.c rev 1.82 for reference (this was used as a base
for the NetBSD port).
2001-06-16 09:21:34 +00:00
dbj ef86c3badd fix handling of transmit length calculation so we now handle full length xmits 2001-06-16 09:18:46 +00:00
dbj e9d708e25b allow unaligned pointers in bus_dmamap_sync 2001-06-16 09:08:05 +00:00
jdolecek c57b6d9ba4 Add DTYPE_PIPE (to be used by new pipe implementation) and handle
it accordingly.
2001-06-16 08:28:39 +00:00
tsutsui aa35eff5da Enable some devices which I am/was using:
epic* at pci?
 fxp* at pci?
 sip* at pci?
 tlp* at pci?
 inphys* at mii?
 qsphys* at mii?
2001-06-16 05:47:37 +00:00
matt 38fc9e283d Fix pte_spill to set the index on the proper pvo. Deal with recursion
in pmap_syncicache.
2001-06-16 03:32:48 +00:00
tsutsui c5bc6249f0 Make sure to write out the dump header into an independent block
on the dump device on sun3x. (sync with sun3)
Now savecore(8) can find core dump in dumpdev properly.

XXX "target kcore /dev/mem" on gdb does not work yet.
2001-06-16 00:38:19 +00:00
matt 979edf3c4a pmap_syncicache can be called recursively. Properly deal with that
situation.
2001-06-15 22:28:54 +00:00
matt 60f8375758 Replace printf with (*pr) 2001-06-15 22:27:07 +00:00
thorpej 4c49d6fa2a Split the Tx and Rx interrupt routines into separate functions,
and add some (optional) event counters.
2001-06-15 22:16:00 +00:00
dbj 093fab47ce remove extra args from printf 2001-06-15 21:56:06 +00:00
matt e55c9f74af Add missing braces in pmap_pte_to_pvo (DEBUG|PMAPCHECK defined). Rearrange
some code so that consistency check in pmap_pte_to_pvo do not trigger on
false positives.  Correct/enhance some printfs.
2001-06-15 21:29:54 +00:00
matt 25a2c4d481 While not stricly needed, to match pmap_pvo_find_va, mask of the page
offset bits.
2001-06-15 20:53:45 +00:00
matt 787e1b0b36 When comparing VA's, ignore the page offset bits.
Invert and strengthen a test for pte equality.
2001-06-15 20:43:01 +00:00
matt c7c7dab8f1 Stop overloading unused bits in the pte. Use the low 12bits of the vaddr
instead to store them.  Add a macro to fetch the vaddr without them.
Make all variables/routines prefixed with pmap_
Cleanup & fix some of the vsid bitmap usage.
Cleanup DEBUG printfs.  Add some more checks to pmap_pvo_to_pte.
2001-06-15 18:26:06 +00:00
nathanw f71391cb6c Move the check for successful attachment to earlier in the detach
routine, to avoid referencing nonexistent data structures.
2001-06-15 18:05:36 +00:00
drochner b97fed556d vm_map_t -> struct vm_map *
vm_page_t -> struct vm_page *
simple_lock_data_t -> struct simplelock
2001-06-15 17:48:13 +00:00
thorpej 7660fd850d In check_exec(), don't bother checking P_TRACED along with
MNT_NOSUID, just check MNT_NOSUID to clear the S{U,G}ID bits
in the attributes for the vnode we're about to exec.

We now check P_TRACED right before we would actually perform
the s{u,g}id function in the exec code.

This closes a race condition between exec of a setuid binary
and ptrace(2).
2001-06-15 17:24:19 +00:00
nonaka 7f44dfec92 Compile again. 2001-06-15 15:53:27 +00:00
nonaka 80e152f0fc Use new common bus.h framework. 2001-06-15 15:50:04 +00:00
nonaka 3a3661fb58 Delete unused function. 2001-06-15 15:24:03 +00:00
bouyer 17eff1c958 Pass WDC_CAPABILITY_MODE to the wdc core, so that it will set timings
on the drive side too.
Deal properly with the case where master and slave don't have the same timings,
and set PIO timings too.
2001-06-15 10:35:26 +00:00
matt 192642af05 Don't enable PMAPCHECK by default. 2001-06-15 08:17:00 +00:00
matt f6b81171c1 Globalize trapexit. Improve db_trace.c so that you can trace thru traps!
Rework the output so that is also prints the frame address by default.
2001-06-15 08:09:33 +00:00
matt 0278444e19 Add a check to pvo_check which makes sure the pte is really in the
pteg_table.   In pte_to_va, take into account if the PTE_HID is set.
2001-06-15 08:08:04 +00:00
matt ab92d9cd59 phys_map should use kenter/kremove 2001-06-15 08:07:03 +00:00
matt 816a5637cd When releasing the SR VSID, mask off the bits not related to the index
in the pmap vsid bitmap.
2001-06-15 06:27:07 +00:00
sommerfeld d3249871b5 Rework how user-mode instruction and stack fetches are done.
While we're in here, catch another vm86 protocol botch.
2001-06-15 05:43:40 +00:00
thorpej e51a043945 Yet more interrupt cleanup -- the platform mater interrupt establish
function now just takes an "irq", which is an index into the irqmap
table for that platform.
2001-06-15 04:01:39 +00:00
fredette 6000674775 Now unmap the PROM's pages only after we have
installed our own vector table.
2001-06-15 00:32:38 +00:00
bjh21 ddc6e8e6ad I've got an 8-bit Ether3, so I've discovered that the address mapping is
non-linear.  Comment it here so I don't forget.
2001-06-15 00:28:01 +00:00
bjh21 5dc1e8334c Fix abuse of bus_space_handles in podloader functions. 2001-06-14 23:09:23 +00:00
thorpej 8eb3b954f1 Don't need to prototype child_return() here, it's in <sys/proc.h>. 2001-06-14 22:56:55 +00:00
thorpej 80cc38a1af Fix a partial construction problem that can cause race conditions
between creation of a file descriptor and close(2) when using kernel
assisted threads.  What we do is stick descriptors in the table, but
mark them as "larval".  This causes essentially everything to treat
it as a non-existent descriptor, except for fdalloc(), which sees a
filled slot so that it won't (incorrectly) allocate it again.  When
a descriptor is fully constructed, the code that has constructed it
marks it as "mature" (which actually clears the "larval" flag), and
things continue to work as normal.

While here, gather all the code that gets a descriptor from the table
into a fd_getfile() function, and call it, rather than having the
same (sometimes incorrect) code copied all over the place.
2001-06-14 20:32:41 +00:00
mjacob 60a0137d9c Ooops- we need to allocate an array of pointers to scsipi_xfer structures
isp_maxcmds in length- not an array of scsipi_xfer structures isp_maxcmds
in length.
2001-06-14 19:54:07 +00:00
thorpej 1d161cd563 Correct a comment. 2001-06-14 19:03:43 +00:00
thorpej fe87c9aade When the old PCI address map is in use, disable I/O space. Also disable
I/O space on PBC revs < B2.
2001-06-14 18:52:26 +00:00
thorpej 0ddf0d259b Don't use BUS_END to compute SYS_END. 2001-06-14 18:48:23 +00:00
thorpej 80dfaa3e5a Read the PCI memory space base and the PCI DMA window base from the
V3 PBC, and use them in the bus mem tag and the bus dma tag on the
P-4032.  This allows us to get much further when PMON has configured
the PBC using the old-style PCI address map.
2001-06-14 17:57:26 +00:00
uch 6c492e4e70 fix hpcio configuration. 2001-06-14 16:55:34 +00:00
fredette 1a4779d8a4 Now get the prototypes from the common sun68k/sun68k/control.h. 2001-06-14 16:36:46 +00:00
fredette 7ab5601058 Since physical memory below 0x2000 isn't mapped anywhere
for now, return EFAULT when /dev/mem tries to read it.
Other physical memory not managed by the pmap system is
mapped at the same virtual addresses.  Now that we
understand how VME PTEs are constructed, give mmapping
a VME bus a better chance of working..
2001-06-14 16:32:45 +00:00
thorpej 4c73c770ce Add MEMSIZE and ETHADDR options, so that they can be set in
the kernel config file, in case you have a buggy PMON which
doesn't provide the environment variables to the kernel.
2001-06-14 16:14:37 +00:00
fredette 8f6cff260d Now uses the common sun68k bus_space/bus_dma
and autoconf code.
2001-06-14 15:54:18 +00:00
fredette e20baedfd4 Added prototypes for w16zero and w16copy, found
in the new w16copy.s.
2001-06-14 15:49:05 +00:00
fredette c7154a0bfd Added two functions that zero memory and copy memory
in an optimized fashion using only properly aligned
8- and 16-bit accesses.
2001-06-14 15:38:16 +00:00
thorpej defcaa8bcb Initlialize PMON after configuring the console, so we can see
debugging info.
2001-06-14 15:29:23 +00:00
thorpej 587d3ec2b4 Insert some debugging code, conditional on PMON_DEBUG. 2001-06-14 15:28:56 +00:00
fredette 70ba9292d4 Now use the bus_space_peek_N function to probe for
the device, and common sun68k_find_prom_map function to
find a PROM mapping for a device.
2001-06-14 15:20:46 +00:00
fredette 9c1d420baf This file has been moved to sys/dev/vme. 2001-06-14 15:15:15 +00:00
fredette 15b02e5ba0 Added a function, prom_sd_target, to translate a PROM
sd unit number into a SCSI target.  Now only set up our
g0 and g4 handlers inside prom_abort(), so we're not
normally running with them.
2001-06-14 13:21:39 +00:00
fredette edad0f956c Under _LKM, now undefine KERNBASE for declaring it.
Not sure if this is correct, but the real question
is whether 68000 LKMs are even possible.
2001-06-14 13:18:54 +00:00
fredette 54f88e2668 Corrected the value of DVMA_OBIO_SLAVE_BASE; obio
devices can see the entire CPU address space.
2001-06-14 13:17:04 +00:00
fredette 01e5507e7e Now simply include the real header under arch/sun68k. 2001-06-14 13:16:03 +00:00
fredette 000fa36842 Moved the definition of romVectorPtr here from mon.h.
Prototype prom_sd_target.
2001-06-14 13:15:21 +00:00
fredette 9e52c15c31 Now simply include the real header under arch/sun68k. 2001-06-14 13:12:50 +00:00
fredette af6051568c Removed. These files can be found under arch/sun68k now. 2001-06-14 13:10:20 +00:00
fredette c3679650d5 Added some kernel sources that can be shared between
sun2 and sun3.
2001-06-14 13:08:11 +00:00
fredette 17de8ec19e Set ARCHSUBDIR to m68k when MACHINE_ARCH is m68000.
Add sun68k to SUBDIR when MACHINE is sun2.
2001-06-14 13:01:27 +00:00
fredette c1c742b4c9 Added sources for the sun2 boot blocks and other
sun68k-ish code, all of which ought to eventually
be shared with the sun3.
2001-06-14 12:57:10 +00:00
uch ea54d618ea ANSI KNF. and change my copyright to TNF copyright. 2001-06-14 11:09:55 +00:00
sato 4cc6a0ac93 fix 'mask clock to PIU' 2001-06-14 08:43:41 +00:00
chs 766dfc9b6f be sure to allocate dirty zeroed pages to cover blocks we allocate
to resolve a write fault.  fixes PR 13201.
also, be sure to allocate blocks for write faults to holes even if
the page is already in memory.  fixes PR 13189.
2001-06-14 08:22:14 +00:00
itojun 015f17a7cb fix comment on ifi_lastchange, for 1.4 if_data 2001-06-14 06:37:34 +00:00
thorpej 3bad583046 Oops, use the correct space tag when unmapping the RTC on the
P-4032 after calibrating the clock.
2001-06-14 05:58:19 +00:00
itojun a90f815dc4 update comment on if_lastchange 2001-06-14 05:50:02 +00:00