Commit Graph

1394 Commits

Author SHA1 Message Date
simonb
1baeb1502a Keep bogus gcc -Wuninitialised warnings happy. 2003-10-27 03:58:17 +00:00
kleink
a3fabb9e7f Use <sys/ieee754.h> where applicable. 2003-10-26 20:55:30 +00:00
chs
cac49e5cf0 clear pcb_onfault before calling uvm_fault() and restore it afterward.
if the fault handler generates a pagefault, we'd like to panic rather
than invoking the onfault handler.
2003-10-25 16:31:39 +00:00
matt
425743428c Fix some indentation problems. Turn off PSL_EE when calling OFW. 2003-10-24 05:10:02 +00:00
matt
7e1d1cca33 s/SSR/SRR 2003-10-22 17:29:18 +00:00
matt
3f37cf2db7 Rework ddblow so that if PSL_PR == 1, it dispatches directly to the
trap handler and bypasses the ddbtrap code.
2003-10-22 17:27:58 +00:00
simonb
d4b0d4911f Remove some numeric asm labels that aren't used. 2003-10-20 05:52:55 +00:00
simonb
066683efa3 Need Data Relocate in the MSR for the dcbf in pmap_procwr().
From Matt Thomas.
2003-10-20 05:47:52 +00:00
matt
421dd6cc28 Reorganize the way powerpc port install machine specific headers.
Use <powerpc/oea/bat.h> exclusively and remove <machine/bat.h> and
<powerpc/bat.h>.  Remove unneeded <machine/cpufunc.h>.  To insure
1:1 correspondence of <powerpc/FOO.h> to <machine/FOO.h> include
"../../powerpc/include/Makefile" in "arch/FOO/include/Makefile".
Incororpate <byte_swap.h> into <bswap.h> and then byte_swap.h
2003-10-20 00:12:09 +00:00
matt
ba34947f80 Add powerpc-specific isa and isadma machdep code. (Merge common code from
prep and sandpoint and ...)
2003-10-19 03:19:32 +00:00
matt
3575370e0a Remove worthless load.
Save curcpu before doing uniprocessor dispatch.
2003-10-17 22:21:38 +00:00
matt
12ecf72b47 Don't zero curlwp/curpcb in cpu_switchto.
Use correct register in the store conditional.
Add DIAGNOSTIC check for null curpcb on cpu_switch exit.
2003-10-17 21:08:57 +00:00
matt
67ab911529 Add a KASSERT() to verify the pcb is not NULL. 2003-10-17 19:56:18 +00:00
simonb
ef41f16231 Correct a test for setting IFF_OACTIVE on the interface. 2003-10-15 02:10:00 +00:00
matt
4b22ee736b Add support for MPC74[45]7 2003-10-09 20:49:06 +00:00
matt
acf4563b13 Add code to drop into DDB if you get a DSI fault on the current stack page. 2003-10-09 07:12:24 +00:00
thorpej
901da40cf9 Add some accessor macros for the ucontext:
* _UC_MACHINE_PC() - access the program counter
* _UC_MACHINE_INTRV() - access the integer return value register
* _UC_MACHINE_SET_PC() - set the program counter (this requires
  special handling on some platforms).
2003-10-08 22:43:01 +00:00
thorpej
9ed3b44b84 Use ksi_signo and ksi_code accessor macros. 2003-10-08 00:40:54 +00:00
thorpej
68723a995b * Shuffle some data structures so, and add a flags word to ksiginfo_t.
Right now the only flag is used to indicate if a ksiginfo_t is a
  result of a trap.  Add a predicate macro to test for this flag.
* Add initialization macros for ksiginfo_t's.
* Add accssor macro for ksi_trap.  Expands to 0 if the ksiginfo_t was
  not the result of a trap.  This matches the sigcontext trapcode semantics.
* In kpsendsig(), use KSI_TRAP_P() to select the lwp that gets the signal.
  Inspired by Matthias Drochner's fix to kpsendsig(), but correctly handles
  the case of non-trap-generated signals that have a > 0 si_code.

This patch fixes a signal delivery problem with threaded programs noted by
Matthias Drochner on tech-kern.

As discussed on tech-kern.  Reviewed and OK's by Christos.
2003-10-08 00:28:40 +00:00
scw
4eea84b735 Gah. Pick up the MI i2c headers from the right place.
Pointed out by Shigeyuki Fukushima on port-powerpc@.
2003-10-06 18:19:24 +00:00
shige
0af4acb526 Add Real time clock support code. 2003-10-06 18:15:08 +00:00
scw
2ba7642346 MD i2c glue for the 405GP's onboard IIC controller.
Bit-bang only for now.
2003-10-06 16:15:46 +00:00
manu
2522a3f784 Build PowerPC again with _HAS_SIGINFO. Remove the ifdef on _HAS_SIGINFO
in the header file since all platforms supported by COMPAT_DARWIN now have it.
2003-09-30 21:04:54 +00:00
simonb
953b5b465b Add a dependancy on assym.h; helps "make -j N" kernel builds. 2003-09-29 05:14:23 +00:00
matt
a8a3bf5bed ANSIfy. 2003-09-27 04:44:42 +00:00
matt
827263a8bc Use ksi_signo instead of _signo. 2003-09-27 03:51:54 +00:00
matt
60ff688f72 Define SIGTRAMP_VALID properly. 2003-09-27 00:58:32 +00:00
nathanw
4d59420344 Move __cpu_simple_lock_t and __SIMPLELOCK_{UN,}LOCKED to machine/types.h
so that they can be used in a namespace-friendly way.
2003-09-26 22:45:41 +00:00
matt
6986092cfe Add a machine-dependent SIGTRAMP_VALID macro which is used to test whether
a trampoline version is valid or not.
2003-09-26 22:14:19 +00:00
matt
fb54d529b8 Copy out the entire ksiginfo_t, not just the first word. 2003-09-26 18:00:47 +00:00
eeh
a6192488f7 Define ksi. 2003-09-26 00:00:17 +00:00
matt
2deb8b2e7b Deal with the constification of ksiginfo_t and sigset_t in signalling. 2003-09-25 22:22:36 +00:00
christos
ecfb034cb3 constify siginfo/trapsignal 2003-09-25 22:04:17 +00:00
matt
9a305fca59 Use direct entry for siginfo trampoline. Deal with missing
legacy trampolines in a cleaner manner.
2003-09-25 21:59:55 +00:00
matt
83003b0798 Fill in ksi_code. 2003-09-25 21:58:46 +00:00
matt
85a5f3065d Add siginfo support for PowerPC. 2003-09-25 18:42:18 +00:00
matt
49317aa149 Remove db_onpanic check. 2003-09-25 17:36:33 +00:00
shige
95fa35eb8e Delete this file because filename includes uppercase letters. 2003-09-24 11:51:19 +00:00
shige
0a36d23137 Copy IBM4xxGPx specific autoconf code from evbppc/walnut/autoconf.c. 2003-09-24 11:47:02 +00:00
matt
9c8a5009b3 Define va_list as __builtin_va_list for GCC 3.x. Change stdarg macros
appropriately.  (this is committed from a system run a kernel and userland
built with these changes).
2003-09-24 02:39:56 +00:00
shige
dc98452dce Copy PCI codes for IBM405GPx from evbppc/walnut/pci/{pchb.c,pci_machdep.c}. 2003-09-23 15:30:22 +00:00
shige
03467d74b5 Add devices info for IBM405GPR. 2003-09-23 15:26:46 +00:00
shige
91be153592 Add global cpu_model variable. 2003-09-23 15:25:26 +00:00
shige
e20e959b37 Copy IBM4xxGPx specific autoconf code from evbppc/walnut/autoconf.c. 2003-09-23 15:24:15 +00:00
shige
a8dd07e005 Copy IBM4XX OpenBIOS locore.S from evbppc/walnut. 2003-09-23 15:21:58 +00:00
shige
fc29eb23bf Add some PCI definitions listed in evbppc/include/walnut.h. 2003-09-23 15:19:05 +00:00
shige
2977d5a89a Add IBM40x specific machdep functions. 2003-09-23 15:14:02 +00:00
shige
87f629a7b8 Add IBM405GPr PVR. 2003-09-23 15:10:05 +00:00
shige
94959351e8 Add IBM405GPx specific kernel configuration file. 2003-09-23 15:06:40 +00:00
shige
ee990c494d Move todclock driver from evbppc/walnut/dev. 2003-09-23 15:01:50 +00:00
shige
ff6df75f63 Add on-chip IIC driver.
Add some definitions for IIC driver.
2003-09-23 14:56:08 +00:00
cl
b826d7b216 add MD part of SA/pthread pagefault handling on powerpc 2003-09-19 00:16:34 +00:00
kleink
8d633905ac Bring /* LINTSTUBs */ closer to reality. 2003-09-08 22:37:01 +00:00
kleink
a4909cd01e g/c byte-reversing bus_space_set_region_1() entries. 2003-09-07 22:12:05 +00:00
manu
d13828a7dd forgotten commit for KERN_PROCARGS sysctl in COMPAT_DARWIN 2003-09-07 07:50:31 +00:00
matt
cec9cb32df Move CLKF_BASEPRI to machine specific <intr.h> file since it depends on
the encoding of the spl for the port.
2003-09-03 21:33:31 +00:00
simonb
05c33c1c05 Need to set BUS_DMA_COHERENT to BUS_DMA_NOCACHE on IBM ppc4xx CPUs.
The "emac" interface now works properly again on my Walnut.  Much
thanks to Steve Woodford for tracking this down.
2003-09-03 13:30:05 +00:00
matt
31cc6ab700 Move SFRAMELEN to frame.h and use it in vm_machdep.c. In setfunc, setup
callframe linkages correctly.  Restore use of ldptr to locore_subr.S
[pthreads and gdb no longer crash/hang the system]
2003-08-27 20:20:07 +00:00
matt
56f115e896 Switch back to adjusting stack by addi instead of ldptr until I can locate
who's setting up the stack wrong.
2003-08-27 19:45:28 +00:00
chs
939df36e55 add support for non-executable mappings (where the hardware allows this)
and make the stack and heap non-executable by default.  the changes
fall into two basic catagories:

 - pmap and trap-handler changes.  these are all MD:
   = alpha: we already track per-page execute permission with the (software)
	PG_EXEC bit, so just have the trap handler pay attention to it.
   = i386: use a new GDT segment for %cs for processes that have no
	executable mappings above a certain threshold (currently the
	bottom of the stack).  track per-page execute permission with
	the last unused PTE bit.
   = powerpc/ibm4xx: just use the hardware exec bit.
   = powerpc/oea: we already track per-page exec bits, but the hardware only
	implements non-exec mappings at the segment level.  so track the
	number of executable mappings in each segment and turn on the no-exec
	segment bit iff the count is 0.  adjust the trap handler to deal.
   = sparc (sun4m): fix our use of the hardware protection bits.
	fix the trap handler to recognize text faults.
   = sparc64: split the existing unified TSB into data and instruction TSBs,
	and only load TTEs into the appropriate TSB(s) for the permissions.
	fix the trap handler to check for execute permission.
   = not yet implemented: amd64, hppa, sh5

 - changes in all the emulations that put a signal trampoline on the stack.
   instead, we now put the trampoline into a uvm_aobj and map that into
   the process separately.

originally from openbsd, adapted for netbsd by me.
2003-08-24 17:52:28 +00:00
chs
3cf764618d remove bogus code that terminates stack trace too early on OEA. 2003-08-24 16:33:41 +00:00
matt
121c8942a6 Not all PPC ports (e.g. macppc) equate IPL_NONE with 0. 2003-08-18 22:10:33 +00:00
chs
e02e4ecc2b lots-o-stuff:
- fix opcodes_base[10] to allow us to find "cmpli".
 - fix "cmp" definition.
 - add various missing SPRs.
 - use the right bits for the "BI" operand.
 - fix operand calculation for "rlwinm" and friends, and display
   the operands in the same order as the manuals do.
 - make the buffer bigger to avoid overflow.
2003-08-17 18:23:17 +00:00
chs
4ba6255f14 add some 745x-specific MSSCR0 bits. 2003-08-17 18:08:17 +00:00
chs
f19809f0fa remove an unused proto. 2003-08-17 18:07:11 +00:00
matt
1d1029332d Remove this. The architecture specific ones are now used. 2003-08-12 18:35:51 +00:00
matt
47483092bd Cleanup/rework cpu_switch*, switch_exit, Idle routine. Remove pcb_psl
since it was write-only.  When setting up a process, make sure the fake
callframes are properly linked together.

Only lower SPL when in Idle loop.  Raise spl to previous level (which would
be IPL_SCHED) when exiting Idle loop.  Never lower SPL anyplace else.
2003-08-12 18:34:47 +00:00
matt
b986a8c215 D'oh! The PCB can't be accessed with the MMU off. So get the pmap pointer
*before* disabling the MMU.
2003-08-12 15:40:02 +00:00
matt
a3a18840be Remove SPILLSTK leftovers. 2003-08-12 05:15:41 +00:00
matt
c0d6cb285d Nuke ci_curpm and curpm. Nuke pcb_pmreal. Those were use for spill stacks
and those no longer exist.  for few uses that need CURPM, use CURPCB/PCB_PM
2003-08-12 05:06:53 +00:00
matt
3527dc3950 When getting the lwp to switch to, test to see if the scheduling queue is
empty, and if so panic.  Change references to "proc/process" to lwp.
2003-08-11 15:39:24 +00:00
chs
b90614b54e catch up with changes elsewhere. 2003-08-11 05:13:20 +00:00
matt
341742a7e9 Add PTEGCOUNT defparam for opt_pmap.h 2003-08-11 01:33:30 +00:00
matt
3d5b7190ad Nuke ci_spillstk/CI_SPILLSTK. No longer needed. 2003-08-08 07:14:26 +00:00
matt
add426be7e Add a type for trapstart so ddb will use it. 2003-08-08 06:11:48 +00:00
matt
938aca290c Don't try to spill entries from the kernel's pmap. As of now, they can no
longer be evicted, only user-mappings can be evicted.
2003-08-08 06:10:43 +00:00
matt
330dc2e202 Allow only user-mappings to be evicted (spillage). This prevents the
dreaded eviction of a kernel stack page.
2003-08-08 06:06:48 +00:00
agc
aad01611e7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22364, verified by myself.
2003-08-07 16:26:28 +00:00
matt
c60f393ec5 Don't overwrite the value of DAR in r30. Use r31 instead. 2003-08-06 07:18:56 +00:00
simonb
20a37f9627 Note that the used interrupt bits are 405GP specific.
Fix a tyop.
2003-08-05 02:10:31 +00:00
matt
9254350d6a Change bc x,y,z to their simplified mnemonics. During a kernel DSI fault,
if the exception address is < 1 page away from the KSP, switch to the that
CPU's spill stack to handle the trap.  Otherwise you can get in a infinite
DSI fault loop.
2003-08-04 22:29:59 +00:00
matt
0e50e47bb9 Make that OEA based kernels can properly deal with kernel ISI faults. Now
that LKMs are supported, it is possible for a LKM page to be "outspilled"
resulting in a possible ISI fault.  Try to spill the page back in.
2003-08-04 22:26:59 +00:00
matt
9b7d071bab Eliminate stmw/lmw substituting the individual load/store instructions.
Use more symbolic constants.  These are now safe for use on PPC64.
2003-08-04 00:32:49 +00:00
matt
a4a468e215 Add SFRAME_USER_SR (even though the 4XX doesn't have one). 2003-08-04 00:30:51 +00:00
eeh
f77f1feee5 Use %r<n> for register names. 2003-08-03 23:26:55 +00:00
matt
777589be9a Add each register in trapframe, switchframe, and faultbuf. 2003-08-03 21:40:13 +00:00
matt
e3e80aa5d7 Add PPC_OEA64 and netbsd32_sigcode.S 2003-08-03 21:38:08 +00:00
matt
618c78b771 Don't use stmw. Do each store individually. 2003-08-03 21:27:49 +00:00
matt
42382e46c4 Add CPUSAVE_* and each register in the saveframe and faultbuf. 2003-08-03 21:26:27 +00:00
matt
dd1c661661 Nuke stmreg/ldmreg. PPC64 doesn't have a lmd/stmd so make sure lmw/stmw
don't invoke valid instructions on PPC64.
2003-08-02 19:40:39 +00:00
matt
c9d56ac39d Add symbolic offsets for what's in cpu save locations.
Add a PPC64 variant of mftb
2003-08-02 19:35:26 +00:00
matt
d89b685a6e Switch to regiser prefixes. Also change numeric constants to symbolic ones. 2003-07-31 15:30:41 +00:00
matt
f9c46681fd Change switchframe to use register_t (anything that uses stmX/lmX needs
to be defined as register_t).
2003-07-31 15:29:29 +00:00
matt
18a1f8d4c7 Switch to m[tf]sprg[0-3] 2003-07-31 14:02:22 +00:00
matt
52bfbfda86 Use register prefixes and load/store pseudo-instructions. 2003-07-31 13:59:54 +00:00
matt
478364a5c5 Convert to the load/store pseudo-instructions. 2003-07-31 08:04:21 +00:00
matt
e51e13713a Use symbolic register names (%rN and %crN) throughout. Change a few more
numeric constants to their symbolic counterparts.
2003-07-31 07:51:16 +00:00
matt
82ebd07f24 Convert most numeric constants to their symbolic equivalents. (step 2 of
cleaning up this file).
2003-07-31 06:49:32 +00:00
matt
f5444cea2f Define SZREG {4,8} appropriately. Add pseudo-instructions (via #define)
to load/store int, long, pointer, register, multiple registers.  This is so
assembly files can be support IPL32 and LP64 PowerPC implementations.
2003-07-31 06:23:55 +00:00
matt
0039d6a257 Replace 'm[tf]sprg x,y' with the appropriate 'm[tf]sprg[0-3] r' (this makes the
SPRG used unambiguous).  This causes no change in the generated object.
2003-07-31 06:21:09 +00:00
matt
18eb53cd22 add PSL_TGPR (for MPC603) 2003-07-31 01:25:38 +00:00
simonb
14fc7f3334 Whitespace alignment nits. 2003-07-27 23:45:44 +00:00
scw
f0f724e255 Fix the default bus dma tag. 2003-07-25 10:50:13 +00:00
scw
728102e66c Switch ibm4xx over to using the more flexible powerpc bus_space/bus_dma code. 2003-07-25 10:12:42 +00:00
hannken
879ba21504 Typo: __HAVE_BITENDIAN_BITOPS -> __HAVE_BIGENDIAN_BITOPS 2003-07-21 16:10:50 +00:00
simonb
9853da3d35 Remove an unused variable. 2003-07-19 08:20:22 +00:00
matt
6783111f9f Elimindate MD setrunqueue/remrunqueue (which were out-of-date compared to
the canonical versions in kern_synch.c).  Define __HAVE_BITENDIAN_BITOPS
so the canonical versions will be used but will store priorities in the
desired (MSB) order for PowerPC (which allows the use of the cntlzw (count
leading zeroes, word) instruction in locore_subr.S to find the proper
priority).
2003-07-18 01:08:11 +00:00
matt
5819fb160d Elimindate MD setrunqueue/remrunqueue (which were out-of-date compared to
the canonical versions in kern_synch.c).  Define __HAVE_BIGENDIAN_BITOPS
so the canonical versions will be used but will store priorities in the
desired (MSB) order for PowerPC (which allows the use of the cntlzw (count
leading zeroes, word) instruction in locore_subr.S to find the proper
priority).
2003-07-18 01:08:10 +00:00
simonb
d854b5c002 SZ_BOARD_CFG_DATA is not used anywhere, remove it. 2003-07-16 03:52:31 +00:00
lukem
ed51729135 __KERNEL_RCSID() 2003-07-15 02:54:31 +00:00
simonb
649e4ff2d5 Check return value of prop_get() correctly; serial ports now attach on
a walnut, but don't seem to accept input(?!).
2003-07-14 05:21:25 +00:00
matt
2a6c2aa546 Back out rev 1.19. It's wrong. Add comments so it doesn't happen again. 2003-07-10 04:18:01 +00:00
matt
18a43bbe99 Don't do vtophys on instruction addresses. This would cause problems for
user addresses (think trap from user mode) or lkms).
2003-07-10 02:06:11 +00:00
matt
554b4aa05f Enhance db_trace to understand syscalls and print the syscall number
that the user requested.  For example:

0xd5c56f40: SC trap #240 by 0x15668c60: srr1=0xd032
            r1=0xffffe470 cr=0x44000045 xer=0 ctr=0xeff27ab8
2003-07-09 22:51:50 +00:00
thorpej
d00b22d0e7 Consult the "mac-addr" property associated with the emac device in
the dev_propdb rather than referencing board_data.
2003-07-04 02:34:47 +00:00
thorpej
5b7c5eadea Consult the "frequency" property associated with the device in the
dev_propdb, rather than using "board_info".
2003-07-04 02:21:02 +00:00
scw
b8b2b1d895 Fix resident page accounting for the kernel pmap. 2003-07-03 13:18:42 +00:00
fvdl
d5aece61d6 Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
2003-06-29 22:28:00 +00:00
darrenr
257443876f 'struct proc *' -> 'struct lwp *' as required to get GENERIC for macppc built 2003-06-29 11:02:21 +00:00
simonb
ccbfec4208 Sprinkle some KNF. 2003-06-28 14:32:02 +00:00
darrenr
960df3c8d1 Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
2003-06-28 14:20:43 +00:00
martin
d505b18964 Make sure to include opt_foo.h if a defflag option FOO is used. 2003-06-23 11:00:59 +00:00
thorpej
452a8fdae2 Rename IPL_IMP -> IPL_VM. 2003-06-16 20:00:56 +00:00
fvdl
7dd7f8baa2 Handle 64bit DMA addresses on PCI for platforms that can (currently only
enabled on amd64). Add a dmat64 field to various PCI attach structures,
and pass it down where needed. Implement a simple new function called
pci_dma64_available(pa) to test if 64bit DMA addresses may be used.
This returns 1 iff _PCI_HAVE_DMA64 is defined in <machine/pci_machdep.h>,
and there is more than 4G of memory.
2003-06-15 23:08:53 +00:00
simonb
67417f64a8 Sprinkle some TABs to line up the columns in the cputab models array. 2003-06-13 04:29:39 +00:00
msaitoh
6f197c635e Add support IBM 405GPr 2003-06-13 04:05:26 +00:00
scw
e05ce46e3e Oops, delete an accidentally committed local change. 2003-06-12 08:47:21 +00:00
scw
0328210bcc Allow <machine/bus.h> to override the definition of BUS_DMA_COHERENT.
For example, machine-dependent code can make it equivalent to
BUS_DMA_NOCACHE if the hardware cannot reliably snoop the bus.
2003-06-12 08:43:07 +00:00
scw
b4e18ad59c Back out the last change after consultation with Matt Thomas. It hurts
platforms with fully functional bus snooping.
2003-06-12 08:30:41 +00:00
scw
afe2393675 In _bus_dmamem_map(), make BUS_DMA_COHERENT behave the same way as
BUS_DMA_NOCACHE.
2003-06-12 07:32:28 +00:00
scw
cd2d76d833 Fix an obvious pasto. 2003-05-19 08:10:03 +00:00
he
d963c8ed8a In disasm_fields(), add a buffer length argument and keep track of
the remaining length of the buffer to use with the modified
db_symstr() interface.  Also, convert to using snprintf() via some
local macros appending to the result buffer.
2003-05-17 19:17:43 +00:00
scw
d0f3a5b671 Add parentheses around macro arguments. 2003-05-16 21:40:41 +00:00
scw
1f1e54196d Make this compile with DEBUG defined. 2003-05-16 21:38:50 +00:00
kleink
776138ea69 Rename <sys/float_ieee.h> to <sys/float_ieee754.h>, following libc's
convention for these.
2003-05-12 15:22:53 +00:00
thorpej
36da248c07 Back out the following chagne:
http://mail-index.netbsd.org/source-changes/2003/05/08/0068.html

There were some side-effects that I didn't anticipate, and fixing them
is proving to be more difficult than I thought, do just eject for now.
Maybe one day we can look at this again.

Fixes PR kern/21517.
2003-05-10 21:10:23 +00:00
thorpej
b77900c3c2 Simplify the way the bounds of the managed kernel virtual address
space is advertised to UVM by making virtual_avail and virtual_end
first-class exported variables by UVM.  Machine-dependent code is
responsible for initializing them before main() is called.  Anything
that steals KVA must adjust these variables accordingly.

This reduces the number of instances of this info from 3 to 1, and
simplifies the pmap(9) interface by removing the pmap_virtual_space()
function call, and removing two arguments from pmap_steal_memory().

This also eliminates some kludges such as having to burn kernel_map
entries on space used by the kernel and stolen KVA.

This also eliminates use of VM_{MIN,MAX}_KERNEL_ADDRESS from MI code,
this giving MD code greater flexibility over the bounds of the managed
kernel virtual address space if a given port's specific platforms can
vary in this regard (this is especially true of the evb* ports).
2003-05-08 18:13:12 +00:00
christos
6ec2f52f71 rename Locore.c -> locore_c.c so that we can compile on case insensitive
filesystems. (from John Gordon)
2003-05-08 12:37:36 +00:00
scw
9ca9578760 Add bit definitions for some registers. 2003-05-01 09:05:56 +00:00
scw
dd0d5640b9 Add support for bus_space_{read,write}_region_[124]() 2003-04-30 19:14:44 +00:00
scw
8c5c893bf7 Add a BKPT_ADDR() macro which gives MD code a chance to munge a
breakpoint address before it's used. Currently a no-op on all but sh5.

This is useful on sh5, for example, to mask off the instruction
type encoding in the bottom two address bits, and makes it possible
to do "db> break $rXX" instead of manually munging the address.
2003-04-29 17:06:03 +00:00
scw
c916242d13 Put an isync at the end of the RESTORE_SRS() macro. This is the
recommended workaround for a mtsr/mtsrin errata with PPC750 cpus.
2003-04-29 15:16:14 +00:00
scw
c48c683d1f Fix use of an uninitialised variable. This was harmless, other than
spuriously incrementing an interrupt counter.
2003-04-29 15:11:45 +00:00
bjh21
4be7a2dcf3 Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
  can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
  various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
  !defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them.  In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.
2003-04-28 23:16:11 +00:00
wiz
c42e1fac66 Management, not managment. Mostly from jmc@openbsd. 2003-04-26 22:07:12 +00:00
christos
a2dfb1b570 PR/3012: Greg A. Woods: Write all float.h files [except the vax of course]
in terms of float_ieee.h
2003-04-19 23:05:28 +00:00
scw
c6c94cfec3 Make sure _bus_dmamap_load_mbuf() converts cpu-relative addresses
to bus-relative addresses.

Spotted by John Gordon, on port-powerpc@.
2003-04-18 09:16:05 +00:00
dsl
b1986a13d0 change 'data' arg of fp_ioctl to 'void *' to match file.h 2003-04-16 08:58:18 +00:00
scw
201693cb1b Re-read L2CR after enabling the L2 cache to avoid returning without
printing the cache details.
2003-04-10 16:07:15 +00:00
matt
dd1424e7ac Add POOL_VTOPHYS. Change vtophys to return -1 if pmap_extract fails.
(callers of vtophys should always supply a valid VA so that
pmap_extract should never fail).
2003-04-09 22:37:32 +00:00
matt
c72503e1bd Add some debug printf's. 2003-04-09 22:35:21 +00:00
matt
b4c7fb17b2 Cleanup dmamap_sync a bit and add a few more comments. Add support for
cached physaddr's in mbufs.
2003-04-09 22:28:56 +00:00
matt
4daebcbff5 Make the imask_t typedef a struct rather than a naked array. The attribute
on the array typedef was contaminating other u_int32_t naked arrays and
affecting their alignment.
2003-04-09 15:44:26 +00:00
matt
021b37ca56 Add a KASSERT to pmap_extract so that vtophys is never attempted on a
mapped user address.
2003-04-07 21:42:14 +00:00
matt
2f9404413f If extracting an address from the kernel pmap, see if the address is outside
the mapped address range.  If so, try to look it up via the BAT table.  If
successful, translate and return the BAT'ed pa.
2003-04-04 22:38:05 +00:00
matt
eb8a295e82 Rework l2cr/l3cr enabling/printing code. Make printing table driven. 2003-04-04 04:04:49 +00:00
matt
ea6acde206 MMCRx register definitions should not be prefixed by SPR_ 2003-04-04 04:03:18 +00:00
matt
5bf8112ed1 Add two missing L2CLK speeds. 2003-04-04 04:00:16 +00:00
thorpej
cc2c493bc4 Use PAGE_SIZE rather than NBPG. 2003-04-02 07:35:54 +00:00
thorpej
c9228c8ddd Use PAGE_SIZE rather than NBPG. 2003-04-02 04:17:50 +00:00
thorpej
86f35f803c Use PAGE_SIZE rather than NBPG. 2003-04-02 02:45:36 +00:00
thorpej
7c0edb9d0e Make PAGE_SIZE, PAGE_SHIFT, and PAGE_MASK compile-time constants for
PowerPC processors.
2003-04-01 23:52:35 +00:00
matt
6a15c68f5d Make sure to turn on the speed knobs in HID0 on the 745x. 2003-03-29 18:18:54 +00:00
matt
2c37db6aec Allow oea_batinit to be called with either the MMU on or off.
(don't reset the BATs if the MMU is off).
2003-03-29 18:09:59 +00:00
matt
b3715c2f6a Add 7450 LRSTK and FOLD bits. 2003-03-29 18:08:42 +00:00
matt
8a5a3a480a Switch/adapt to new bus space infrastructure. 2003-03-18 16:40:18 +00:00
matt
bff46769b9 fix typo in comment. 2003-03-17 23:15:33 +00:00
matt
582f976e54 Add __HAVE_GENERIC_SOFT_INTERRUPT support. 2003-03-17 16:54:16 +00:00
matt
c7b0df67b4 Add CLOCKBASE to opt_ppcparam.h. 2003-03-17 16:53:52 +00:00
matt
5504cc0c26 Use "b" constraint so r0 won't be used. 2003-03-16 06:57:31 +00:00
matt
1d04c635f2 Make the result an early clobber so gcc won't get clever. 2003-03-16 06:56:47 +00:00
matt
8524a72241 Honor PMAP_NC for pmap_kenter_pa. Fix goof in pmap_pte_to_va. 2003-03-16 06:54:46 +00:00
matt
ea542f761a addi is not the same as add. :) 2003-03-16 06:52:39 +00:00
matt
8a37a3ec5d Fix bus_dmamap_sync (add offset to ds->ds_addr when needed).
Add a set of parenthesis to PMAP_NC so it evaluates properly.
2003-03-16 05:37:37 +00:00
matt
640bee3010 Reduce visible globals. (gt_handle is now gt_memh and is only known to
machdep.c, gt_mainbus.c, and extintr.c)
2003-03-15 19:51:48 +00:00
matt
101a152db1 This contains no marvell specific code now. It now completely hides the
underlying PCI MD implementation.  XXX want to move this to
powerpc/include/ someday.
2003-03-15 19:50:31 +00:00
matt
a0b2076415 New generic powerpc bus_space framework. 2003-03-15 08:03:19 +00:00
matt
0f1794e44a Make lint happy and use __asm && __volatile.
manipulate netisr via lwarx/stwcx. to get atomicity.
2003-03-15 07:50:28 +00:00
matt
7ad3fe6e03 When mapping a page with BUS_SPACE_NOCACHE, make sure to flush the
physical page from the data cache.
2003-03-15 07:25:20 +00:00
matt
35962f72c9 s;backside;; and report L2CR_L2DO & L2CR_L2IO 2003-03-15 07:22:46 +00:00
matt
2b8417e488 Add LINTSTUBs and make oea_init() agree with them. 2003-03-15 07:21:02 +00:00
matt
df24bda908 Make lint happy. 2003-03-15 07:19:20 +00:00
matt
d03db36449 Use aprint_normal. Print 2MB L2 sizes with 7410. 2003-03-14 06:27:40 +00:00
matt
e0242aaebc Remove Debugger call. 2003-03-14 06:25:58 +00:00
matt
d50c91e021 Make lint happy by not assigning to casted lvalue. 2003-03-14 06:23:48 +00:00
matt
12dca1407b Condition ({ ... }) by __GNUC__. Remove redundant SPR_IBAT0U definiton. 2003-03-14 06:22:51 +00:00
matt
d7fc76efe1 Add _LOCORE protection. 2003-03-14 06:21:19 +00:00
matt
61920c743e Make ALI trap print DSISR. 2003-03-14 05:38:53 +00:00
matt
a7b613e469 Use __asm and __volatile to make lint happy. 2003-03-14 05:37:51 +00:00
matt
ce05df7bc7 Quiet lint warning. 2003-03-14 05:37:14 +00:00
matt
8ceb32c0af make LINTSTUB work with this. 2003-03-14 05:36:39 +00:00
matt
c894ddaec1 Print more useful messages on kernel ALI or PGM traps. 2003-03-14 05:32:27 +00:00
matt
0c29e154e3 Use __asm & __volatile to make lint(1) happy. 2003-03-13 17:30:38 +00:00
matt
cd26de2684 Same code exists in both halves in #ifdef/#else/#endif. move it outside. 2003-03-12 06:00:36 +00:00
hannken
44b1e07ec9 Add support for the IBM 403GCX cpu. Enabled with "options PPC_IBM403".
- different set of device control registers.
  - non-standard access to the time base.
  - 16 byte cache lines.

Approved by: Eduardo Horvath <eeh@netbsd.org>
2003-03-11 10:40:15 +00:00
matt
210f48e582 Remove unneeded conditional code. 2003-03-06 07:15:46 +00:00
matt
0b8a5fd80f Adapt to powerpc/bus.h changes. 2003-03-06 00:20:39 +00:00
matt
ff2281b498 Add preliminary support Marvell (Galileo) Discovery System Controllers.
This code was contributed by Allegro Networks.
2003-03-05 22:08:18 +00:00
matt
6d251b3be3 Make AltiVec registers available via ptrace/procfs. Simplify AltiVec
processing.  Add a "common" procfs_machdep.c for PowerPC platforms.
Even though it is supposed to be port specific, most (if not all)
PowerPC ports can just use the common one.
2003-03-05 05:27:24 +00:00
matt
fb2cebb577 Pass the address of the intrframe to the ext_intr routine. 2003-03-04 08:34:12 +00:00
matt
107803a3a3 Re-arrange things in evbppc & powerpc to support OEA-based eval boards
in evbppc.  OEA-based board(s) to be added later.
2003-03-04 07:50:57 +00:00
matt
9875f9218d Add some missing volatiles. 2003-03-04 07:48:09 +00:00
tshiozak
31e2cbf0b5 add some ISO C 1995 I18N functions and types:
btowc, wctrans, towctrans, wcscoll, wcsxfrm, wctype_t and wctrans_t.
2003-03-02 22:18:11 +00:00
matt
5401f85320 Restore MQ to trapframe from mcontext since it's in both. 2003-03-02 01:07:55 +00:00
jklos
b9f3bdb8fb Added L3CR_CONFIG to the parameter list for 745x L3 cache configuration. 2003-02-26 21:14:32 +00:00
jklos
0c5117e1f9 Added configuration entries for L3CR_CONFIG for L3 caches on 745x
accelerators. Thanks to Monroe Williams.
2003-02-26 21:10:51 +00:00
jklos
7109206620 Added L3CR_CONFIG for support of 745x G4 L3 cache configuration. 2003-02-26 21:05:23 +00:00
matt
869bbf806d Add some RAS support. Don't print out a message when we encounter
trap instructions.
2003-02-25 23:32:03 +00:00
matt
8609ed56b8 Only define KERN_AS= object if IDENT has -DLKM. 2003-02-24 07:15:40 +00:00
atatat
860ed88533 #include opt_uvm.h in machine/vmparam.h (for those ports offering the
topdown option) so that including it directly before including
uvm/uvm_param.h (or uvm/uvm_extern.h which includes uvm/uvm_param.h)
and attempting to use topdown won't result in a compiler error.

Problem noted in private email.
2003-02-23 19:13:43 +00:00
matt
b03aef6efc witch from xor r,r,r to li r,0 to set a register to 0. It's clearer (and
better for G4 processors).
2003-02-21 15:14:08 +00:00
matt
c1234c6385 Add TOPDOWN VM support. 2003-02-21 03:41:52 +00:00
matt
b42cde14b7 Set KERN_AS=obj now that LKMs work. (otherwise when you loaded LKMs they
wouldn't have all the library routines available).
2003-02-19 23:55:48 +00:00
matt
5bcfb63de7 Add PSL_PM 2003-02-14 04:45:32 +00:00
matt
8268fcff94 Use register 8, not 0, when construct OF_buffer address. 2003-02-13 15:02:49 +00:00
manu
06def0e4fb Build again 2003-02-10 21:46:49 +00:00
matt
f6201cca8d Only include kernel headers if _KERNEL is defined. 2003-02-10 04:01:37 +00:00
matt
47afa5aa99 Don't try to reserve DEAD zone unless the kernel address space encompasses it. 2003-02-08 20:42:07 +00:00
matt
4fefe75ac1 Add comments to describe PowerPC64 ABI register usage. 2003-02-08 20:03:22 +00:00
thorpej
6068b273f4 Fix some printf formats. 2003-02-07 04:39:09 +00:00
matt
48e8876d50 Add a _bus_dmamap_sync which supports cache-incoherent implementations.
Support BUS_DMA_NOCACHE.
2003-02-06 23:03:54 +00:00
matt
5d223c9c9c Add oea_iobat_remove(paddr_t). 2003-02-06 23:02:33 +00:00
matt
42b98bbd45 Allow KERNEL_SR/KERNEL2_SR to be overriden (I run a kernel with
the mapped space at 0x8000000-0x9fffffff).
2003-02-06 23:01:32 +00:00
matt
c766d3b064 Include vmparam.h to get USER_SR. 2003-02-06 23:00:15 +00:00
nakayama
e3e4805068 Replace machine/rnd.h with more appropriate name to share it
with cycle counter based microtime in kern/kern_microtime.c.
2003-02-05 13:57:50 +00:00
matt
cc7308ce0b Make _LP64 friendly. 2003-02-05 07:35:31 +00:00
matt
a835619dbe Needed for compat_netbsd32. 2003-02-05 07:16:49 +00:00
matt
6522fb435a Make LP64 friendly. 2003-02-05 07:16:27 +00:00
matt
3cdbb8ccfe Make things a bit more LP64 friendly. 2003-02-05 07:05:19 +00:00
matt
37f4a39d7e Don't define pmap_t if _LOCORE is defined. 2003-02-05 01:27:34 +00:00
matt
52263a8c80 LKM's need a pmap_t typedef but there's no PPC_xxx to defined which pmap.h
to include.  So just declare the pmap_t and don't do anything else.
2003-02-04 01:31:49 +00:00
matt
b4450c6d3c Move ibm4xx vmparam.h to powerpc/include/ibm4xx directory. Add a stub
vmparam.h to choose the right vmparam.  This is needed so evbppc can host
both ibm4xx and oea based eval boards.
2003-02-03 23:09:29 +00:00
matt
a25898cf6e Don't use trapframe in sigcontext. Instead define a new structure
utrapframe that fixed in size (and the same size as the trapframe
in NetBSD 1.5).  This preserves binary compatibility for those programs
that dealt looked at sigcontexts.
2003-02-03 21:48:01 +00:00
matt
2b0e97a561 Rename PPC_MPC6XX to PPC_OEA (and any mpc6xx reference to oea). 2003-02-03 17:09:53 +00:00
matt
3e793a03a1 More cleanup for OLDPMAP. 2003-02-03 05:15:51 +00:00
matt
193a5761aa Remove OLDPMAP support. 2003-02-02 21:22:11 +00:00
matt
f38c95025b This file is no longer needed. 2003-02-02 20:47:38 +00:00
matt
7c1e50a21a Perform a rototill of the powerpc code. Mandate use of SPRG0 to store
a pointer to current cpu's cpu_info structure.  Use cpu_info for
intstk,intr_depth,still_stk,idle_pcb,curpcb,curlwp,etal even on
non-MULTIPROCESSOR machines.  Add common macros GET_CPUINFO and
INIT_CPUINFO to get and initialize the cpu_info struct on startup.  Make
ibm4xx use the standard <powerpc/frame.h>.  Use IFRAME_xx in ibm4xx
trap_subr.S instead of explicit magic offsets.  Move INTSTK and SPILLSTK
to std.<platform>.  Change faultbuf to a struct instead of an array.

On MPC6XX cpus, stop using the vector page for temporary space and use
reserved space in cpu_info.
2003-02-02 20:43:17 +00:00
kent
cd7d9faeaf Introduce BUS_DMA_NOCACHE, and bus_dmamem_map() of i386 supports it. 2003-01-28 01:07:51 +00:00
manu
55215e5266 Remove right duplication on thread creation, which became useless now we
are using lwp.
Enable kill -9 to kill parent thread waiting for its child.
Use upcallret instead of child_return for the newly created lwp.
Add debug messages for thread creation.

Thread creation are still broken...
2003-01-26 12:39:32 +00:00
manu
cb771e3c64 Make the beast build again (but it is still probably broken) 2003-01-24 21:37:01 +00:00
kleink
87f0398e29 Fix inverted test in previous. (D'oh!) 2003-01-24 21:26:08 +00:00
kleink
15027ca61b Correct inverted logic in comment. 2003-01-23 15:59:38 +00:00
kleink
2332bdc2f1 Sync MPC601 support bits with UP version. 2003-01-22 22:20:23 +00:00
kleink
6bc656a38f Whitespace nit in previous. 2003-01-22 22:15:06 +00:00
kleink
8065f1dfa1 MPC601 support bits:
* install 601-specific DSI and RUNMODETRC trap handlers
* save/restore MQ in trapframe, add MQ hooks to DDB
* extend battable to 512 entries to hold the 601's 8M translations
* instead of adding I/O to BAT starvation, set up segment registers
  for Memory-Forced I/O Controller Interface Access
* sync after tlbie
2003-01-22 21:44:54 +00:00
kleink
892f5b1680 Add mfrtcl() and mfrtc(), similar to mftbl() and mftb(). 2003-01-22 21:05:50 +00:00
kleink
7553f82ab0 Recognize %mq, and adjust disasm_fields() slightly to print it. 2003-01-22 21:03:37 +00:00
matt
b03d17694a Do a preliminary switchover of the mach code to lwp's. It compiles now
but probably doesn't work.   That's for someone who understand this code
better.
2003-01-21 04:06:06 +00:00
matt
82fd269f15 __greg_t should be an long, not int. (LP64 friendliness) 2003-01-20 06:58:10 +00:00
matt
2f3596224d Kill all references to struct __gregs and use the _REG_xx names. 2003-01-20 05:26:46 +00:00
matt
fb891b41f5 Add _REG_foo to ppc mcontext and use them instead of constants. 2003-01-20 00:53:55 +00:00
matt
5fac7ff5ae Make this reflect reality. 2003-01-19 09:23:39 +00:00
matt
a0356cae2a Add CALLFRAMELEN and use it. 2003-01-19 02:47:36 +00:00
matt
ef4a3f75d9 LP64'ify. 2003-01-19 02:46:08 +00:00
matt
f35338749b Cast to register_t instead of int to be nicer for LP64.
Simplify copyin/copyout/copyinstr/copyoutstr.  Fix bug
where the user virtual address was not updated so that
if the user's buffer crossed a segment boundary, the
wrong data could be copied.  Localize USER_SR to the
ILP32 version of setusr/unsetusr.
2003-01-19 02:43:11 +00:00
matt
d8f30693f8 Use CALLFRAMELEN instead of 16. 2003-01-19 02:39:47 +00:00
matt
bf7778a6da Add trapframe32 (for compat_netbsd32).
Add CALLFRAMELEN.  (so we can remove many of the hard coded "16" or "15"
in the powerpc code).
2003-01-19 00:42:24 +00:00
matt
328674047a ALIGN should use u_long, not u_int 2003-01-19 00:25:22 +00:00
matt
92609b9678 Cast to register_t, not int, to be more LP64 friendly. 2003-01-19 00:01:09 +00:00
matt
b3d36290af Improve sigcode.S template so linux_sigcode.S can use it as well. Add a
netbsd32_sigcode.S.
2003-01-19 00:00:11 +00:00
matt
d192a5d694 Cast to register_t, not int, to be more _LP64 friendly. 2003-01-18 23:58:19 +00:00
matt
e20e04fa05 Allow other compat use this as a template. 2003-01-18 23:46:32 +00:00
matt
4adb810fe1 In cpu_upcall, cast to register_t, not int. (int is not LP64 friendly) 2003-01-18 23:43:24 +00:00
matt
b7af0cbc04 Add LP64 support. 2003-01-18 21:38:03 +00:00
matt
024c9c135c Add a temporary bridge to use %foo regnames in kernel / standalone code. 2003-01-18 21:36:44 +00:00
matt
3d62e5c159 Fix LP64 botch. 2003-01-18 21:32:58 +00:00
matt
d610b65d22 Make register_t. Change the printfs in trap.c to match. 2003-01-18 21:28:10 +00:00
thorpej
f91b0bb3f2 Merge the nathanw_sa branch. 2003-01-18 06:23:28 +00:00
matt
0ccdd339c8 A small LP64 fix. 2003-01-16 09:17:01 +00:00
augustss
cb7fde57d3 Make it compile on MPC6xx. I'm not sure about MPC40x. 2003-01-13 20:29:34 +00:00
simonb
61593bd957 Fix a tyop and some grammar. 2003-01-08 00:41:41 +00:00
wiz
1035faff1d writable, not writeable. 2003-01-06 20:30:28 +00:00
thorpej
1106d42424 On the IBM 4xx, don't enter DDB on user mode traps. Fixes
port-powerpc/19662.

Some minor cleanup while here.
2003-01-04 23:46:11 +00:00
thorpej
62a4b10f83 Make this compile without DDB. 2003-01-04 18:04:43 +00:00
augustss
a89cd41b68 Add NEED_SYMTAB to run dbsym. 2003-01-01 16:14:36 +00:00
thorpej
95fa2e148a Use aprint_normal() for cfprint routines. 2003-01-01 01:57:51 +00:00
manu
f464631d66 Several things:
1) rights should be shared by the threads within a process. While it would
be easier to handle this with the struct proc/struct lwp split, we attempt to
do this now by sharing the right lists. Because each right holds a reference
to struct proc, this might cause some problems later.
2) in pthread_exit, really exit the thread. Also reintialize the righ tlist to
make sure we will not destroy the parent's right list
3) rights can hold multiple permissions on a port (ie: send and receive). Fix th
is.
4) first attempt on right carried by messages. We still have to do rights carrie
d in the message body (complex messages).
2002-12-27 09:59:24 +00:00
manu
4a06119a9d Pass the system call table to trace_enter() and ktrsys() so that it is
possible to use alternate system call tables. This is usefull for
displaying correctly the arguments in Mach binaries traces.

If NULL is given, then the regular systam call table for the process is used.
2002-12-21 16:23:56 +00:00
scw
4e87eae834 Use Software Single Stepping for now when PPC_IBM4xx is defined. The
existing hardware assisted method doesn't work on this cpu.

Also correct the "I_B" constant in db_machine.h.
2002-12-20 15:23:12 +00:00
thorpej
2a39e8388d Merge the IBM 4xx into the common powerpc/locore_subr.S, and
eliminate all the duplicated context switch related code in
the IBM 4xx port.
2002-12-19 19:37:25 +00:00
thorpej
a6dc36fa4e Build LKMs with -msoft-float. 2002-12-19 19:36:26 +00:00
scw
c10c20ac28 Add a range check for the DCR address in db_ppc4xx_dcr(). 2002-12-19 13:45:03 +00:00
scw
de98ba0a49 Add a "machine dcr" command, for the IBM4XX case, which permits
reading/writing of the cpu's DCR registers.
2002-12-19 13:29:53 +00:00
manu
98bc8767ae Bug fixes:
- In case of ailure in the child, kill the child and wakeup the parent
- Do call child_return
- The src and dst args were mixed up when copying regs 0-31 to the trapframe

This makes pthread_create(3) fully working (test program works).
2002-12-12 08:23:27 +00:00
manu
66a29c52af Added a few Mach traps: mach_boostrap_register, mach_port_set_attributes,
mach_port_move_member, mach_port_set_attributes, mach_task_set_special_port,
(none do anything)
Added mach_thread_create_running, which creates a new Mach thread. It
provides the register context of the new thread. We use it in a child
function provided to fork1(). The child function is machine dependent and
is not yet implemented for i386.

The new thread crashes quickly, but at least it starts.
2002-12-12 00:29:23 +00:00
thorpej
e8cc3884de Rename __LDPGSZ to AOUT_LDPGSZ, to accurately reflect what it is. 2002-12-10 17:14:02 +00:00
thorpej
78ea2dd367 Use __LDPGSZ (which must be == USRTEXT) as the text address for a.out
executables, and eliminate the USRTEXT constant, which was only used
by the a.out exec code.
2002-12-10 05:14:24 +00:00
scw
67d6f49379 Changes/additions to support evbppc. 2002-12-09 12:28:12 +00:00
manu
9f6565f2bd A working fork/vfork implementation. Darwin fork differs from our fork by
two ways:
- the child gets its pid as retval[0] (userland stub will turn it into a 0),
retval[1] is 1 and it is 0 in the parent.
- in the child, the fork syscall is successful, hence we must skip the next
instruction.
2002-12-08 21:53:10 +00:00
manu
3b0f6d78ed Introduce BSD system calls with alternate patch checking (in /emul) in
compat/common, so that they can be shared by several emulations, and use
them for Darwin.

This removes the ugly dependance on FreeBSD freebsd_file.c for COMPAT_DARWIN
2002-12-08 00:50:23 +00:00
thorpej
a13469e728 Revert my previous GCC 3.3-related changes; GCC 3.3 has been fixed
to handle our stdarg/varargs ABI for PowerPC.
2002-12-04 17:42:51 +00:00
manu
a9a3da8aca The recent mach trap support caused indirect system calls (a la syscall(2))
to be incorectly recorded as 'syscall'. Fix this.
2002-11-29 11:56:36 +00:00
manu
508a5615a6 Build the beast again after siginfo changes 2002-11-29 00:04:03 +00:00
manu
dfa96ff4b3 Add signal delivery for the PowerPC. Everything is implemented except siginfo.
The stack layout is observed from stack dumps on Darwin, so it should be
very accurate.
2002-11-26 23:54:09 +00:00
manu
edff1c8d0a There is too much debugging, it's getting annoying. Let's remove some. 2002-11-26 23:48:44 +00:00
lukem
0635de35a3 Remove KDIR=, since SYS_INCLUDE=symlinks and KDIR are not supported any more. 2002-11-26 23:30:07 +00:00
manu
53356d6169 Added an empty shell for signal delivery. Now we just have to fill the
machine dependant bits.
2002-11-25 22:25:12 +00:00
thorpej
b65c7c5437 Avoid strict-alias warnings. 2002-11-25 05:37:00 +00:00
thorpej
2e9c89031c Statements after labels. 2002-11-25 05:11:32 +00:00
thorpej
35a57313da Use tlbrelo and tlbrehi. 2002-11-25 05:10:39 +00:00
thorpej
54dbc0eab3 Avoid strict-alias warnings. 2002-11-25 02:46:10 +00:00
thorpej
113c35cbf2 Remove an unnecessary token-paste, as pointed out by GCC 3.3. 2002-11-25 02:45:46 +00:00
thorpej
3151023170 Remove redundant (and incorrect) extern decl. 2002-11-25 02:07:37 +00:00
thorpej
796aa6a84a Statements after labels. 2002-11-25 02:06:16 +00:00
thorpej
3911a545e1 No newlines in string constants. 2002-11-25 01:36:35 +00:00
thorpej
6fd88f0e65 Avoid a trigraph. 2002-11-25 01:33:51 +00:00
thorpej
11707809eb No newlines in string constants. 2002-11-25 01:31:12 +00:00
thorpej
0eb35ef834 Instrument FP emulation traps. 2002-11-24 17:34:06 +00:00
thorpej
baf5c58201 Use EVCNT_TYPE_TRAP. 2002-11-24 17:05:45 +00:00
thorpej
02c69e5261 Put interface attributes on the device, not another attribute with
the same name as the device.
2002-11-23 19:42:41 +00:00
manu
c6cc98345b Correctly report the CPU type in Mach host_info(BASIC_INFO) 2002-11-17 01:24:03 +00:00
manu
93df539f73 As we use one FreeBSD file for COMPAT_DARWIN, we must include file.freebsd 2002-11-17 00:59:13 +00:00
manu
a26a564e59 Implment map_fd mach trap
Fix host_info(BASIC_INFO) which was broken wrt to the number of field
returned.
2002-11-16 20:00:29 +00:00
manu
e7cfdc3995 Darwin skips the next instruction after a successful system call. Strange
world.
2002-11-15 23:19:22 +00:00
manu
3fc8f36b8d Make it build again 2002-11-15 21:48:06 +00:00
manu
d584ed9598 Add a realcode argument to trace_enter and ktrsyscall. realcode is the
original system call number, which can be negative for a Mach trap.
We cannot just replace code by realcode, because ktrsyscall uses it as
an index in the system call table, thus crashing the kernel when the
value is negative.
2002-11-15 20:06:00 +00:00
christos
1a546a91c0 get the cpu basic info. 2002-11-14 19:44:36 +00:00
matt
da584e2f99 If MULTIPROCESSOR, just accept the penalties of doing BAT flipping when
syncing the icache.
2002-11-13 21:08:50 +00:00
matt
3a5d673363 Change syscall to bound code so that systrace and ktrace won't fall off
the end of a table.   XXX this is wrong since code does not indicate the
sysent table for which code was used as an index.
2002-11-13 09:36:10 +00:00
matt
9cf475322b Do kernel non-USER_SR pte spilling regardless of interrupt count. Only do
kernel USER_SR spillage if interrupt depth is 0.
2002-11-13 09:33:20 +00:00
manu
530968e795 The kernel now builds with COMPAT_DARWIN. 2002-11-12 23:40:19 +00:00
jdolecek
2ba45545df back previous off; don't install macho_machdep.h 2002-11-04 15:27:15 +00:00
matt
85529376d3 Get rid of nsysent. Use EMULNAMEU to use the appropriate constant.
Revamp the mach_syscall_dispatch function to be much simplier (pass in
a syscall code and return a const struct sysent * pointer).
2002-11-04 00:01:02 +00:00
manu
873ed6f9ee Added support for Darwin's PowerPC-only system calls:
ppccalls, with system call numbers starting at 0x6000
fasttraps, with system call numbers starting at 0x7FF0

Because the Mach system call dispatching code has grown a bit
too much, introduce an inline function to handle it (mach_syscall_dispatch).

While we are there, remove the Mach and Linux includes from
arch/powerpc/powerpc/syscall.c and push them into
arch/powerpc/powerpc/{mach|linux}_syscall.c
2002-11-03 23:17:18 +00:00
matt
6d54e503b3 LP64 changes (copied from mips and changed CHAR_MIN/MAX to 0/0xffU). 2002-11-03 22:55:24 +00:00
matt
c89494d09b Change _MACHINE_foo_H_ to _POWERPC_foo_H_ 2002-11-03 22:36:22 +00:00
matt
6dc0eb390f Add LP64 bits (copied from MIPS). 2002-11-03 22:35:33 +00:00
matt
0d380378cf Add LP64 limits. 2002-11-03 22:23:59 +00:00
jdolecek
80f0f798bc back previous revision 1.9 off - compat code was changed to set
struct emul e_nsysent to *SYS_NSYSENT now, and the mask is more efficient
2002-11-02 07:37:33 +00:00
matt
71416f6690 In struct emul, e_nsysent is *not* initialized to *SYS_NSYSENT but
*SYS_MAXSYSCALL.  Adjust to this and simply compare 'code' to it instead
of doing the p-o-2 dance.
2002-11-01 00:02:40 +00:00
matt
1cec255a41 Move child_return back to syscall.c
Fix syscall to use emulations SYS_syscall/SYS___syscall definitions.
Use the emulation NSYSENT to limit code.
Don't define *syscall_fancy if it will never be used.
2002-10-30 18:34:15 +00:00
manu
6224b0c0ce Fixed mistakes 2002-10-30 07:39:40 +00:00
manu
fddf44c0bf Add COMPAT_MACH and EXEC_MACHO support on the PowerPC 2002-10-30 06:41:45 +00:00
manu
a3da524774 Prepare syscall.c for COMPAT_MACH support. linux_syscall_intern is
moved to a Linux specific file, child_return is moved to trap.c,
and we introduce a EMULNAME macro co that syscall.c can be included to
define the system call handler for another emulation.
2002-10-30 06:37:37 +00:00
manu
fe4e91080d Moved binary compatibility options from arch directory to cpu directory 2002-10-30 06:26:42 +00:00
manu
f9cac3b168 Changed the ifndef guard of this header file from _MACH_EXEC_H_ to
_POWERPC_AOUT_EXEC_H_. The former was conflicting with
<compat/mach/mach_exec.h>.
2002-10-28 18:00:40 +00:00
thorpej
4b68c83f09 Make these work with GCC 3.x. 2002-10-25 20:46:44 +00:00
jdolecek
e0cc03a09b merge kqueue branch into -current
kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
2002-10-23 09:10:23 +00:00
chs
4017fd1809 fix two bugs in the previous PTE-spill handling changes:
- in pmap_pte_spill(), the victim PTE could be using the secondary hash,
   in which case its pvo entry is actually in the other bucket.  use the
   correct bucket for the victim pvo when moving it to the front of its list.
 - similarly, in pmap_pvo_remove(), if the pteidx is pre-computed for us,
   it might actually point to the other bucket if the entry is using the
   secondary hash.  adjust ptegidx if this is the case.

these should fix PRs 18645 and 18736.
while I'm here, wrap line lines and do some other misc cleanup.
2002-10-22 04:34:13 +00:00
nathanw
c1cc872908 Catch up some code inside #ifdef DEBUG to recent pvo_entry changes. 2002-10-18 20:02:23 +00:00
matt
69f28d5e54 Remove pmap_pte_spill calls. 2002-10-10 22:44:21 +00:00
matt
8c472e414b Move pte_spill calls from trap_subr to trap(). Count the number of
"evictions" and avoide calling pmap_pte_spill if there are no evictions
for the current pmap.  Make the ISI execption use the default exception
code.  Remove lots of dead stuff from trap_subr.

Make olink use TAILQ instead of LIST and be sorted with evicted entries
first and resident entries last.  Make use of this knowledge to make
pmap_pte_spill do a fast exit.
2002-10-10 22:37:50 +00:00
jdolecek
3aa30dca1a fix typo - driver name is 'opb', not 'obp' 2002-10-10 13:45:14 +00:00
thorpej
89bf5a8f8e Add trailing ; to CFATTACH_DECL. 2002-10-02 15:52:22 +00:00
thorpej
b96bc0d7bc Use CFATTACH_DECL(). 2002-10-02 04:06:36 +00:00
thorpej
d652bdcafe Use CFATTACH_DECL(). 2002-10-01 02:49:56 +00:00
thorpej
f818766afe Declare all cfattach structures const. 2002-09-27 20:31:45 +00:00
provos
0f09ed48a5 remove trailing \n in panic(). approved perry. 2002-09-27 15:35:29 +00:00
thorpej
6c88de3b53 Introduce a new routine, config_match(), which invokes the
cfattach->ca_match function in behalf of the caller.  Use it
rather than invoking cfattach->ca_match directly.
2002-09-27 03:17:40 +00:00