Commit Graph

4414 Commits

Author SHA1 Message Date
nakayama 1c54a66d99 System utilities, boot programs and kernel modules are machine
(port) specific not CPU, so use MACHINE not MACHINE_ARCH.
2009-12-13 05:01:32 +00:00
tsutsui 471e528b58 Remove `volatile' qualifier from argument types of
struct timeval passed to todr_gettime(9) and todr_settime(9).
We no longer have an ancient and volatile struct timeval `time'
global since we have switched to MI timercounter(9) on all port.

XXX1: some of these RTC drivers still assume 32bit time_t
XXX2: some of these should be rewritten to use todr_[gs]ettime_ymdhms()
XXX3: todr(9) man page doesn't mention todr_[gs]ettime_ymdhms()
2009-12-12 14:44:08 +00:00
matt 0a8b38422e Add PRIx{P,V}{ADDR,SIZE}, PRIu{P,V}SIZE, and PRIxREGISTER{,32,64} for all
(except where they will be added via merge).  These should be used to print
{p,v}{addr,size}_t and register*_t as appropriate.
2009-12-11 05:52:03 +00:00
matt 6a9e4e8eeb Change u_long to vaddr_t/vsize_t in exec code where appropriate (mostly
involves setregs and vmcmds).  Should result in no code differences.
2009-12-10 14:13:48 +00:00
rmind e9f7af26e6 Rename L_ADDR to L_PCB and amend some comments accordingly. 2009-12-10 05:10:00 +00:00
pooka 70d4493c77 Remove the portalfs kernel file system driver. Replace mount_portal(8)
with a version based on puffs.  User functionality remains the same.
2009-12-05 20:11:01 +00:00
tsutsui b3c8be00bb Add src/common/include to -Ipath for proplib(3) so that build works
even without installed DESTDIR.
2009-11-27 11:11:22 +00:00
tsutsui efb2579c78 Move some devices where they should belong to. 2009-11-27 11:05:45 +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
martin 361db6b221 Remove double include that prevented the right machdep LDBL_* constants
to be used.

Noticed by Masao Uebayashi.
2009-11-25 08:43:15 +00:00
rmind a626cff9ae Use lwp_getpcb() on sparc{64} and sun2/3 MD code, clean from struct user usage. 2009-11-21 04:16:51 +00:00
rmind 368037b555 Include sys/proc.h for sparc/sparc64, which is required for now. 2009-11-21 04:04:07 +00:00
he f128f0ca99 Pass a 0 as flag value to pmap_kenter_pa(). 2009-11-11 14:20:01 +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
he 5c62e90d6f Avoid unused variable warnings on Sun4c-only kernels.
Fix applied from PR#42249 -- thanks!
2009-10-30 15:05:54 +00:00
cegger 62cf489d8e kill extra whitespaces
reviewed by tsutsui@
2009-10-26 19:16:54 +00:00
snj febb7cce65 Drop 3rd and 4th clauses. Approved by gwr@ (copyright holder). 2009-10-21 23:12:09 +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
snj 4968c04d96 Move Eduardo Horvath's license to 2 clause. OK eeh@. 2009-10-19 18:12:37 +00:00
tsutsui 1bc6608553 Don't try to read disklabel to check FS_RAID on floppy boot since
reopening floppy could cause Data Access Exception later.
Fixes PR port-sparc/42186, ok'ed by mrg@.
2009-10-18 06:24:21 +00:00
pooka 5e8ba6d465 protect against multi-inclusion 2009-10-13 22:41:57 +00:00
tsutsui be5da0aabb Remove commented out and nonexistent cgthree at obio stuff.
SPARCclassic has onboard CG3 but it's internally connected via SBus,
and there is no info about sun4m machines which actually require
cgthree at obio attachment. Info from jdc@.
2009-09-27 13:27:44 +00:00
tsutsui 102f04400c - use device_t and cfdriver_t
- use device_private() and device_xname()
- use proper types or variables for device_t/softc
2009-09-20 16:18:21 +00:00
tsutsui a616b75df3 Split device_t/softc.
Tested on TME emulating SS2.

XXX: bwtwo at obmem on TME emulating sun2 didn't match and cannot test
2009-09-19 04:52:44 +00:00
tsutsui 12ad76b18c Remove struct sbusdev and related functions sbus_establish() and sbusreset().
They are derived from 4.4BSD/sparc and have been there since initial import
of NetBSD/sparc in 1993, but the struct sbusdev is almost unused for years,
nothing calls sbusreset(), and all (*sd->sd_reset)() functions look bogus.

Suggested by mrg@ and martin@, and tested on SS1+ and SS20.
2009-09-17 16:28:12 +00:00
tsutsui 41559777ac Use device_t, cfdriver_t, device_private(), device_xname(),
and appropriate types and variables for device_t/softc.
2009-09-17 12:38:11 +00:00
tsutsui d519f74ad6 Make sure to initialize cpus[0] which will also be used as cpuinfo
for sun4 and sun4c, not only for sun4m. Okay'ed by mrg@.
2009-09-10 14:12:02 +00:00
macallan a11c6c1d62 use vcons_replay_msgbuf() 2009-08-27 20:52:18 +00:00
he f0886937ab We need an explicit include of <sys/exec_aout.h> here as well. 2009-08-23 08:51:56 +00:00
uwe 0c3bb10a56 options COMPAT_50 2009-08-16 19:12:55 +00:00
skrll 719e2eddb4 s/int/u_int/ for flags in pmap_enter and deal with this in rump.
Hi cegger.
2009-08-16 14:06:36 +00:00
macallan f2c548ef3a add the missing wscons bits so this kernel builds again
needs testing on actual hardware which I don't have.
2009-08-16 00:24:59 +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
macallan 54334fe790 enable the tcx driver 2009-08-06 18:28:41 +00:00
apb 36bad35673 Enclose the argument to #error in quotes, to protect an embedded single
quote.  Part of PR 41255 from Kurt Lidl.
2009-07-14 20:57:22 +00:00
tsutsui 7b14dcf78f Enable ddb(4) for sparc GENERIC-like kernels.
Discussed on port-sparc@.
2009-06-22 14:57:52 +00:00
tsutsui 2d503ac381 Call cache_flush_all() in getcpuinfo().
Not sure if it's actually necessary, but it fixes panic
"makememarr: cannot find "memory" node" on RT626 HyperSPARC.
Ok'ed by martin@.
2009-06-11 14:42:47 +00:00
he 5cd328a195 Add -lprop to the ramdisk build, so that it builds again, due to
recent changes in newfs.  Bump the ramdisk size from 1536 to 1800
blocks as a consequence.
2009-06-09 11:06:09 +00:00
mrg 8d43cfc54d convert sparc "intrcnt" counters to evcnt(9) style. XXX some of the names
could be better, but i just copied them from the old intrnames in locore.

i benchmarked this with a simple test of ircii ./configure && make, to see
if the additional load/store & arith would cause any noticeable degradation
as the change also converts 32 bit counters to 64 bits.  amusingly, the
only trend i saw in this was that for both portions, i see a consistent
(across at least 8 runs) benefit of about 0.8% improvement.  ie, the newer
larger code size / counter size code actually runs faster for some reason..
maybe there's a cacheline effect in the size of the code?


XXX the current implementation depends on a couple of things:
XXX   - ev_count member of evcnt{} is first and has offset 0
XXX   - that sizeof(struct evcnt) equals 32
XXX if these are not true, locore.s has #error's to catch it
2009-06-05 01:36:07 +00:00
mrg 54e81f636d make sure to initialise the cpuinfo sz in all cases. noted by martin. 2009-05-31 20:28:51 +00:00
mrg 5dbfb3ccb3 - bump the size of cpus[] by one, so we have a NULL pointer at the end,
from tsutsui
- for MP kernels, copy the loop to find the bootcpu in mainbus_attach()
  into getcacheinfo_obp() so we can get cache properties on the bootcpu
  before calling main()
- in getcpuinfo(), move the call of getmid() before the call to
  getcacheinfo() so that the above change to getcacheinfo_obp() can work
- move the struct cpu_info setup to the end of the initial kernel page
  setup and don't access this space until after we have switched to the
  kernel pagetables
- revive most of the old CPUINFO_VA alignment/congruency code from the
  old alloc_cpuinfo_global_va() function, and ensure that all cpuinfo
  structures are sanely aligned.  this makes hypersparc work again
- introduce a new way to free the wasted pages back to UVM, as we can't
  simply uvm_unmap() them this early in bootstrap


i believe that the first used cpuinfo_data page is still being wasted,
but i haven't checked.
2009-05-31 20:09:44 +00:00
martin 900e24968a Properly initialize child attach args to zero - we could end up with
various devices having different ideas about being console otherwise.
2009-05-31 17:09:03 +00:00
skrll e03976623a Add TLS relocation definitions. 2009-05-30 05:56:52 +00:00
mrg 2cbddcfe99 print the curpcb in "mach cpu" output as well. 2009-05-30 01:19:29 +00:00
mrg 05c64062d1 fix up cpu_setfunc() as noted by uwe:
- don't call lwp_startup for cpu_setfunc() users
- introduce lwp_setfunc_trampoline instead
- no need to set the "new" lwp for setfunc
2009-05-29 22:06:55 +00:00
mrg ff16242b4b sync this a little with sparc64: use cpu_setfunc() at the end of cpu_lwp_fork() 2009-05-27 04:08:06 +00:00
mrg 95ae92bfd1 - use _MAXNCPU instead of 4
- convert xpmsg_lock from a simplelock to a kmutex
- don't wait for sparc_noop IPI calls
- remove xmpsg_func's "retval" parameter and usage
- remove the IPI at high IPL message
- rework cpu_attach() a bunch, refactoring calls to getcpuinfo() and setting
  of cpi, and split most of the non-boot CPU handling into a new function
- make CPU_INFO_FOREACH() work whether modular or not
- move the MP cpu_info pages earlier
- move a few things in cpu.c around to colsolidate the MP code together
- remove useless if (cpus == NULL) tests -- cpus is an array now


with these changes, and an additional change to crazyintr() to not printf(),
i can get to single user shell on my SS20 again.  i can run a fwe commands
but some of them cause hangs.  "ps auxw" works, but "top -b" does not.


tested in UP LOCKDEBUG/DEBUG/DIAGNOSTIC kernel as well.
MP kernel with only cpu0 configured panics starting /sbin/init.
have not yet tested on a real UP machine.
2009-05-27 02:19:49 +00:00
mrg f106da4978 avoid a local variable in a do {} while (0) macro. 2009-05-27 01:35:28 +00:00
macallan d3ed51a859 use BUS_SPACE_MAP_LARGE to map the framebuffer 2009-05-26 03:31:12 +00:00