Commit Graph

386 Commits

Author SHA1 Message Date
skrll
c1821630bd KNF 2009-11-29 10:08:10 +00:00
rmind
ce313d4fb1 Replace l_addr with uvm_lwp_getuarea() in various MD code, mostly cpu_lwp_fork(). 2009-11-29 04:15:42 +00:00
skrll
0deb77781e Flush only as much as is required. Pointed out by rmind. 2009-11-28 13:53:28 +00:00
skrll
4efbdd1e91 Fix DEBUG build. Hi rmind. 2009-11-27 20:32:10 +00:00
rmind
3f18fe8123 - Use uvm_lwp_setuarea() instead of directly setting address to lwp_t::l_addr.
- Replace most remaining uses of l_addr with uvm_lwp_getuarea() or lwp_getpcb().
- Amend assembly in ports where it accesses PCB via struct user.
- Rename L_ADDR to L_PCB in few places.  Reduce sys/user.h inclusions.
2009-11-27 03:23:03 +00:00
matt
11af2f9cfa Kill proc0paddr. Use lwp0.l_addr instead. 2009-11-26 00:19:11 +00:00
rmind
12193ee3b4 Use lwp_getpcb() on hppa and ia64, clean from struct user usage. 2009-11-21 15:36:33 +00:00
rmind
23d62c72ca Include sys/user.h for MD proc.h (hppa and m68k ports). 2009-11-21 15:13:14 +00:00
dholland
3b3360c119 Declare trap name array as extern const char *[] to match how it's defined
in trap.c. (Should really be in a header, of course.) Compile-tested.
2009-11-15 18:17:18 +00:00
skrll
dcfde2a0ef Put PMAP_NOCACHE in the MD space. 2009-11-15 12:26:02 +00:00
skrll
8e8677821f Update a couple of comments. 2009-11-14 13:31:44 +00:00
skrll
1070b74721 Use the new flags argument to pmap_kenter_pa for PMAP_NOCACHE. 2009-11-11 16:08:31 +00:00
cegger
9480c51b04 Add a flags argument to pmap_kenter_pa(9).
Patch showed on tech-kern@ http://mail-index.netbsd.org/tech-kern/2009/11/04/msg006434.html
No objections.
2009-11-07 07:27:40 +00:00
snj
32381fa0dd Follow upstream license changes for files with Michael Shalayeff's
copyright.  In most cases, this means dropping the 3rd and 4th clauses.
2009-11-03 05:07:25 +00:00
cegger
62cf489d8e kill extra whitespaces
reviewed by tsutsui@
2009-10-26 19:16:54 +00:00
rmind
40cf6f3659 Remove uarea swap-out functionality:
- Addresses the issue described in PR/38828.
- Some simplification in threading and sleepq subsystems.
- Eliminates pmap_collect() and, as a side note, allows pmap optimisations.
- Eliminates XS_CTL_DATA_ONSTACK in scsipi code.
- Avoids few scans on LWP list and thus potentially long holds of proc_lock.
- Cuts ~1.5k lines of code.  Reduces amd64 kernel size by ~4k.
- Removes __SWAP_BROKEN cases.

Tested on x86, mips, acorn32 (thanks <mpumford>) and partly tested on
acorn26 (thanks to <bjh21>).

Discussed on <tech-kern>, reviewed by <ad>.
2009-10-21 21:11:57 +00:00
matt
209a0b42e3 Include <sys/exec_aout.h> explicitly instead of relying on <sys/exec.h> to
do it for us.
2009-08-15 23:44:57 +00:00
skrll
32444302bd Fix non-DEBUG builds. 2009-08-12 10:03:30 +00:00
skrll
c352a1ce0c Remove NOP flushes. pvh_list == NULL. 2009-08-12 07:46:36 +00:00
skrll
3e1a0e3c2d Pull across a fix from OpenBSD, but use PDE_SIZE instead of ~PDE_MASK + 1.
Make sure that if a PDE isn't there, we skip to the start of the address
range covered by the next PDE and not somewhere in the middle.  The old could
have skipped over some valid PTE's causing them to stay behind in the pmap.
Since we would not flush the cache for those pages either this could also
cause memory corruption when dirty cache lines would be written back to
memory at a later stage.
2009-08-12 07:42:36 +00:00
matt
b2a95bab1e Remove all declarations of physmem from sys/arch. Add an include of
<sys/systm.h> to the one file that did not already contain it.
This now means that physmem can be changed by updating systm.h and uvm_page.c
(excluding fixing printfs)
2009-08-11 17:04:14 +00:00
skrll
c113d9a27f Do not use lwp_trampoline for cpu_setfunc, but a simplified setfunc_trampoline
that does not call lwp_startup().
2009-06-03 21:08:51 +00:00
skrll
f86cbcc8bf Enforce strong ordering (for now) on PA2.0. 2009-06-01 07:10:14 +00:00
skrll
e03976623a Add TLS relocation definitions. 2009-05-30 05:56:52 +00:00
skrll
93a4f7c66c Kill '$' in exported symbols. 2009-05-24 09:17:59 +00:00
skrll
fae01d956c G/C DTRAP 2009-05-24 09:13:37 +00:00
skrll
f06013108d u_intNN_t -> uintNN_t
"same" code before and after.
2009-05-24 06:53:34 +00:00
skrll
72c9ff9f0c Whitespace. 2009-05-19 05:50:58 +00:00
skrll
d6428aac82 Note that CR27 is used for thread local storage (TLS) 2009-05-16 12:57:05 +00:00
skrll
2b47a0c491 Whitespace. 2009-05-09 12:18:29 +00:00
skrll
785840b34d Provide ucas for hppa. 2009-05-08 10:12:55 +00:00
skrll
2418e09480 Correct some CPU ifdefs so that a HP7100_CPU only kernel should compile. 2009-04-30 20:10:31 +00:00
skrll
fdba187b53 Remove if defined(HP7100LC_CPU) || defined(HP7300LC_CPU) from around
pmap_hptsize and pdc_hwtlb (for now).
2009-04-30 19:15:18 +00:00
skrll
af6031b09f Move HPPA_SID_KERNEL into pmap.h and deal with the move. 2009-04-30 15:34:24 +00:00
skrll
8516d55745 Merge nick-hppapmap.
This is a port of the OpenBSD pmap and trap handling code to get us

        - Performance boost on some/all machines.
        - Well on the way to PA2.0 (in 32bit mode) support. Several
          machines probe hardware, but fail sometime after interrupts
          are enabled.

Other things changed / fixed on the branch are

        - update autoconf to use the OpenBSD code.
        - com @ dino is very close to being supported.
        - HPPA_REDZONE has been replaced with a working redzone which
          is enabled with DIAGNOSTIC.
        - UPAGES has been halved in size.
        - power(4) from OpenBSD to fix a few bugs.
        - updated list of modules from OpenBSD.
	- initial ports of uturn(4), astro(4) and elroy(4).
	- update some copyrights (remove advertising clause, etc.)

Thanks to mjf for some of the above, testing and listening.
2009-04-30 07:01:26 +00:00
cegger
1d89a182fb change pmap flags argument from int to u_int.
discussed with christos@ on source-changes-d@
2009-04-21 21:29:58 +00:00
skrll
77dafb503d Fixup two more syscalls with 64-bit args.
Remove reference to script that is supposed to do this automatically - I
don't have it.

Fixes PR/41185.
2009-04-11 09:49:23 +00:00
cegger
e2cb85904d bcopy -> memcpy 2009-03-18 17:06:41 +00:00
dsl
82357f6d42 ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
2009-03-14 21:04:01 +00:00
dsl
454af1c0e8 Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
2009-03-14 15:35:58 +00:00
joerg
f5b0fec0e0 Remove SHMMAXPGS from all kernel configs. Dynamically compute the
initial limit as 1/4 of the physical memory. Ensure the limit is at
least 1024 pages, the old default on most platforms.
2009-03-06 20:31:46 +00:00
skrll
fd24e60b98 From OpenBSD:
apparently my understanding of '{FLT,DBL,LDBL}_{MIN,MAX}_EXP' ahs
been wrong and thus proven by many and there change it back to
what it is meaning explained in http://www-ccs.ucsd.edu/c/float.html .
also fix spmath to use it's own consts instead of (now) off by one
float.h values thus to avoid any kind of binary changes.

Fixes regress/lib/libc/ieeefp/nan
2009-01-27 11:49:54 +00:00
christos
461a86f9bd merge christos-time_t 2009-01-11 02:45:45 +00:00
cegger
9b87d582bd kill MALLOC and FREE macros. 2008-12-17 20:51:31 +00:00
christos
9a5d3f2817 replace bitmask_snprintf(9) with snprintb(3) 2008-12-16 22:35:21 +00:00
pooka
ee352f3d33 Make kernel_pmap_ptr a const. Requested by steve_martin. 2008-12-10 11:10:17 +00:00
pooka
29d439f898 Make pmap_kernel() a MI macro for struct pmap *kernel_pmap_ptr,
which is now the "API" provided by the pmap module.  pmap_kernel()
remains as the syntactic sugar.

Bonus cosmetics round: move all the pmap_t pointer typedefs into
uvm_pmap.h.

Thanks to Greg Oster for providing cpu muscle for doing test builds.
2008-12-09 20:45:44 +00:00
skrll
5e046fc3d9 Print the trapframe pointer in the trace output. 2008-11-27 14:28:23 +00:00
he
4b10ac9fb3 Rename sendsig() to sendsig_siginfo(), so that we don't conflict
with the newly added sendsig() in kern_sig.c.
2008-11-21 01:57:33 +00:00
ad
92ce8c6a3d Make the emulations, exec formats, coredump, NFS, and the NFS server
into modules. By and large this commit:

- shuffles header files and ifdefs
- splits code out where necessary to be modular
- adds module glue for each of the components
- adds/replaces hooks for things that can be installed at runtime
2008-11-19 18:35:57 +00:00
ad
d1b01a3709 Provide a small inline wrapper for sysent::sy_call() and use it to store
the active syscall description in struct lwp. To be used at some future
point to prevent unloading of modules that provide syscalls, while the
syscalls are in use.
2008-10-21 12:16:58 +00:00
skrll
86bba1afff Typo in previous. 2008-10-17 12:35:12 +00:00
skrll
cf9f4754f3 p_smutex was replaced by p_lock. 2008-10-16 17:49:23 +00:00
skrll
79c7887582 Bring back cpu_setfunc.
cpu_lwp_fork should use cpu_setfunc, but not right now.
2008-10-16 17:42:26 +00:00
wrstuden
fc7511b00e Merge wrstuden-revivesa into HEAD. 2008-10-15 06:51:17 +00:00
skrll
0a3b051fc6 Fix (U)LLONG_(MAX|MIN) defines.
From Jonathan Kollasch. Thanks.
2008-09-13 07:33:26 +00:00
skrll
1a95ecfedf Swap max/min in comments to match symbols. 2008-09-13 07:30:59 +00:00
skrll
632763e1fc Multiple inclusion protection. 2008-09-13 07:30:22 +00:00
skrll
2958809c8c Whitespace. 2008-08-28 08:45:26 +00:00
skrll
b71a0dd1dc Update a comment. 2008-08-22 19:32:57 +00:00
skrll
7203885b6f Typo in comment. 2008-08-22 06:49:26 +00:00
skrll
ad5c6971b7 Define _ASM_LS_CHAR as '!' on hppa. 2008-08-11 21:52:10 +00:00
skrll
1bd9dc93c6 Fix copy{in,out}str on hppa by
1) not attempting to copy anything if size is initially 0.
	2) returning ENAMETOOLONG if we ran out of space.
2008-08-11 10:36:41 +00:00
matt
91d4704c12 Update <machine/ieeefp.h> to use the C99 FE_* definitions instead of the
NetBSD defined ones.  Redefine the NetBSD ones in terms of the C99 ones.
Step 1 to having <fenv.h>
2008-08-05 16:47:41 +00:00
rmind
160268aca6 Remove proc_representative_lwp(), use a simple LIST_FIRST() instead.
OK by <ad>.
2008-07-02 19:49:58 +00:00
martin
ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
skrll
768818c328 Whitespace. 2008-04-25 12:41:50 +00:00
ad
284c2b9aef Merge proc::p_mutex and proc::p_smutex into a single adaptive mutex, since
we no longer need to guard against access from hardware interrupt handlers.

Additionally, if cloning a process with CLONE_SIGHAND, arrange to have the
child process share the parent's lock so that signal state may be kept in
sync. Partially addresses PR kern/37437.
2008-04-24 18:39:20 +00:00
skrll
0cef8c99e4 Split the DDB trace stuff into its own file. 2008-04-24 07:28:30 +00:00
skrll
9fcc1f5407 de-__P 2008-04-06 08:03:36 +00:00
skrll
5886a5273b Need to pull in kobj_machdep.c for options MODULAR 2008-03-29 15:34:19 +00:00
simonb
a1ba91e196 Remove unused _BSD_OFF_T_. 2008-03-22 22:06:35 +00:00
skrll
4834c1b95c Arrgh.
Must try to develop and commit from the same machine.
2008-03-01 12:54:19 +00:00
skrll
90c2422ec8 Oops, fix compilation errors.
I have tested this - it's enough to load sys/modules/example.o.

Honest!
2008-03-01 12:44:53 +00:00
skrll
7bd976725f hppa bits for the kernel linker. 2008-03-01 12:40:08 +00:00
ad
372461e58e Add aliases for atomic_cas_foo_ni(). 2008-02-10 13:32:14 +00:00
dsl
c2a8c787c3 Remove the 'args' parameter to 'trace_exit()' it is no longer used.
Instead of passing the (un)real system call code and syscall table pointer,
just pass the number of arguments - which is what ktrace really wants.
Ride forthcoming 4.99.53
2008-02-06 22:12:39 +00:00
skrll
f867ae875e Rely on implicit PAGE_SIZE alignment and don't confuse uvm_glue.c. 2008-02-05 10:10:21 +00:00
skrll
f7a8a22745 Catch up with "Refactor in_cksum/in4_cksum/in6_cksum implementations".
Hi Joerg.
2008-01-29 19:29:37 +00:00
skrll
dbf783eccf bcopy -> memcpy 2008-01-29 18:46:18 +00:00
joerg
6e869e402d Refactor in_cksum/in4_cksum/in6_cksum implementations:
- All three functions are included in the kernel by default.
  They call a backend function cpu_in_cksum after possibly
  computing the checksum of the pseudo header.
- cpu_in_cksum is the core to implement the one-complement sum.
  The default implementation is moderate fast on most platforms
  and provides a 32bit accumulator with 16bit addends for L32 platforms
  and a 64bit accumulator with 32bit addends for L64 platforms.
  It handles edge cases like very large mbuf chains (could happen with
  native IPv6 in the future) and provides a good base for new native
  implementations.
- Modify i386 and amd64 assembly to use the new interface.

This disables the MD implementations on !x86 until the conversion is
done. For Alpha, the portable version is faster.
2008-01-25 21:12:10 +00:00
skrll
886189b384 Adjust comments to fit <80 columns. 2008-01-18 10:03:27 +00:00
skrll
f447c6a89d KNF 2008-01-18 10:00:48 +00:00
skrll
fb13dda50a Correct a comment. 2008-01-18 09:56:41 +00:00
skrll
954a1f6c2c Add W and O PSW bit defines.
From OpenBSD.
2008-01-18 09:42:12 +00:00
skrll
ae654e4721 Various improvements to the hppa kernel for gdb.
- add the useful space and control registers to struct reg
	- update process_{read,write}_regs accordingly
	- use MID_HPPA in core dumps.
	- dump the fp regs into cores.
	- add single stepping support from OpenBSD.
2008-01-10 21:08:40 +00:00
dsl
b6e6554ace include sys/simplelock.h 2008-01-06 13:25:22 +00:00
dsl
b8bcdbe9e6 Don't pass 'curlwp' into trace_enter() and trace_exit(). 2008-01-05 12:53:52 +00:00
ad
0c8143169b Fix includes 2008-01-05 00:22:34 +00:00
he
1b2f5d4f55 Remove the #endif corresponding to the #ifdef _KERNEL removed in previous. 2008-01-02 21:00:34 +00:00
ad
9f6b8c4d04 Remove COMPAT_HPUX. 2007-12-31 13:38:47 +00:00
skrll
6698b79073 Minor change to comment. 2007-12-22 14:14:31 +00:00
skrll
c54df2db09 Add some more trap types and HPPA_BREAK_SS. From OpenBSD. 2007-12-22 14:11:10 +00:00
skrll
4fef0969e0 Align the stack when delivering signals and don't waste a HPPA_FRAME_SIZE. 2007-12-22 14:09:03 +00:00
skrll
0361d1fef2 Cast the argument to HPPA_FRAME_ROUND to uintptr_t 2007-12-22 14:06:47 +00:00
skrll
2b4f402919 Improve ddb backtraces by:
- Starting with the right set of fp, pc, and rp in all cases.
	- Dropping the argument printing stuff as it could never work.
	- Backtrace through traps and decode syscalls properly by
	  making sure the trapframe is at a known offset from the stack
	  pointer in both cases. Also, ensure that the frame pointer
	  is zero so that we can detect traps.
2007-12-21 13:05:26 +00:00
skrll
f4ce2b2831 Fix typo that broke bt /a with curlwp 2007-12-20 20:24:47 +00:00
skrll
f63ceafc74 typo in comment. 2007-12-20 08:11:31 +00:00
perry
9b2b412c19 __FUNCTION__ -> __func__ 2007-12-15 00:39:14 +00:00
skrll
ed0dc19ecc g/c __HPPA_SIGNAL_PRIVATE 2007-12-13 21:34:18 +00:00