Commit Graph

513 Commits

Author SHA1 Message Date
tsutsui 8ff81a2ae9 Always include <m68k/cpu.h> (i.e. outside #if defined(_KERNEL))
for crash(8) as amiga and sun3.  There are _KERNEL protections in it.

Briefly tested by "build.sh -m news68k -U build".
Further possible botch will be fixed later.
2012-02-02 16:59:42 +00:00
tsutsui b417004b5f Merge m68881_save() and m68881_restore() (using most common mvme68k ones).
All functions are checked by my eyes, and all GENERIC kernels compile.
2011-12-22 15:33:28 +00:00
dholland 7bbf82b772 WABPL is no longer considered experimental (has not been for some time)
so update its comment in config files.
2011-12-18 05:49:22 +00:00
mrg 9a4a666ff3 implement bdev_size(9) wrapper around d_psize() routine, so we can take
the device lock in relevant places.  avoid doing so while actually dumping.

tested i386 crash dumps still work, and that all touched files compile.

fixes PR#45705.
2011-12-12 19:03:07 +00:00
tsutsui 6218939425 Make sure to call pflusha before (not after) enabling MMU on
68030/68851 initialization paths.

Pointed out by isaki@ per observation of ATC status on XM6i emulator.
Tested on TT030, HP362, NWS-1750, and X68030 by me.

XXX: probably we can remove existing pflusha or TBIA calls after MMU turned
XXX: on (and before enabling cache) but I leave them as is for now to avoid
XXX: unexcpected side effects.
2011-11-26 14:05:52 +00:00
tsutsui b8ea705460 Bump (commented out) SYMTAB_SPACE. 2011-11-26 04:58:42 +00:00
tsutsui 9e163b85fb Reorganize IPL for devices. 2011-11-26 04:40:50 +00:00
tsutsui fa68b553fc Use pmap_kenter_pa(9) to map msgbuf memory which is not managed by VM. 2011-11-26 04:32:46 +00:00
tsutsui 61cb6aee7e Clear innmihand flag (for recursion check) when the NMI hander is returned
so that we can abort kernel multiple times even after continue.
2011-11-26 04:31:19 +00:00
tls 8a012bd83f The rnd pseudo-device is not really optional, because it is in the same
source file as the entropy-pool code itself.  Move it to std.  This
will be cleaned up more when I split the sources up as they should be.

This fixes build breaks on several ports.  Thanks to Havard Eidnes for
pointing them out.
2011-11-22 21:25:05 +00:00
tsutsui bebd4e17d1 Use now common fpu_probe() and print FPU type per probe result since
it turns out that server and high-end LUNA models actually have MC68882,
not MC68881 as basic and standard models:
http://www.h2.dion.ne.jp/~dogs/collect/ds/luna.html

Also put LUNA model names into cpu_model[] for sysctl(3).
(maybe we don't have to consider sysctl backward compatibility on this port ;-)
2011-11-15 13:25:44 +00:00
tsutsui e179a96fd3 Move spread getsfc() and getdfc() functions into common m68k/support.s.
Note:
- ENTRY_NOPROFILE() is okay since they are used only for debug printf
- they are declared to return int so no need to put a return value into %a0
2011-11-15 10:57:00 +00:00
tsutsui 460c94cc06 Finally complete LUNA-II support, after almost 12 years since
initial import of NetBSD/luna68k.

Note a working LUNA-II machine was found and provided by OMRON guys
after LUNA demonstration at Open Source Conference 2011 Kansai @ Kyoto:
http://mail-index.NetBSD.org/source-changes/2011/07/16/msg024675.html
and this resurrected LUNA-II which runs NetBSD/luna68k -current with Xserver
was also demonstrated on the NetBSD booth at Kansai Open Source 2011:
http://www.NetBSD.org/gallery/events.html#kansai-os-jp-2011

It's really pleasure to meet many OMRON LUNA developers and LUNA users
at the NetBSD booth.  Thank you everyone!


Changes details:

luna68k/luna68k/locore.s
 - don't use 68030 specific pflusha instruction in 68040 initialization path
 - use TBIA() to invalidate TLB instead of 68030's pflusha
   after MMU is turned on (as hp300 does)
   (these two bugs are fatal at early bootstrap)
 - pull loadustp() fixes from hp300/locore.s rev 1.82
   (more flush ops are required in it otherwise causes random coredumps)
 - specify correct %tt1 mask value
   (the mask value means actually bit mask, not transparent range)

luna68k/luna68k/machdep.c
 - use proper delay_divisor for 68040 25MHz LUNA-II

luna68k/luna68k/mainbus.c
 - prepare and use per-model mainbus device lists for mainbus_attach_args

luna68k/conf/GENERIC
luna68k/conf/INSTALL
 - enable options M68040 and FPSP
 - enable secondary spc(4) on LUNA-II

luna68k/conf/Makefile.luna68k
 - include arch/m68k/fpsp/Makefile.inc for FPSP

luna68k/dev/lcd.c
 - promote LUNA-II model on LCD

XXX: old and slow SCSI-1 drives like Hitachi DK312 seems to have
XXX: some problem with spc(4) driver, even on the original LUNA
2011-11-12 13:44:26 +00:00
tsutsui f83e509ccc Replace two magic numbers with macro via assym.h. 2011-11-05 15:37:17 +00:00
tsutsui 1a3e926e97 Sync _delay() with hp300:
- unsigned -> u_int
 - use ENTRY_NOPROFILE()
 - align main delay loop with 8 byte cacheline boundary
2011-11-05 15:33:18 +00:00
tsutsui 5c25f3ba41 Remove unused getsp(). 2011-11-05 15:27:51 +00:00
tsutsui f4d5dbc7a9 More tweaks. 2011-11-05 15:23:38 +00:00
tsutsui 479b5c966c Tweak indent and misc comments to reduce diffs from hp300. 2011-11-05 15:08:36 +00:00
tsutsui fcb490be25 Print LUNA model name (not only CPU/MMU/FPU) on boot as 4.4BSD Lite2 does. 2011-10-17 14:19:28 +00:00
tsutsui 5fadf539dd LUNA has 68030+68881, not 68882.
XXX: we should have a common fpu_probe() function among all m68k ports.
2011-10-17 13:52:11 +00:00
bouyer a47e2eb758 Add getlabelusesmbr(), as proposed in
http://mail-index.netbsd.org/tech-userlevel/2011/08/25/msg005404.html
This is used by disk tools such as disklabel(8) to dynamically decide is
the undelyling platform uses a disklabel-in-mbr-partition or not
(instead of using a compile-time list of ports).
getlabelusesmbr() reads the sysctl kern.labelusesmbr, takes its value from the
machdep #define LABELUSESMBR.
For evbmips, make LABELUSESMBR 1 if the platform uses pmon
as bootloader, and 0 (the previous value) otherwise.
2011-08-30 12:39:49 +00:00
tsutsui 6a6959f98c Explicitly print uPD7201A name, which is a Z80 SIO like serial chip
with 8086 I/O interfaces.
2011-07-28 10:01:44 +00:00
tsutsui bf42741306 Use volatile uint8_t to access 8255 PPI ports. 2011-07-28 09:59:13 +00:00
tsutsui 54b5e30119 KNF, use ANSI decls, remove an obsolete hack, misc cosmetics etc. 2011-07-28 09:56:34 +00:00
tsutsui e571eaa8db KNF, use uintNN_t, tab/space cosmetics etc. 2011-07-27 14:17:54 +00:00
tsutsui 406ab3f078 - split device_t/softc and use device_t and cfdata_t etc.
- use aprint_normal(9)
- include "ioconf.h" for struct cfdriver decls
No crash on LUNA.
2011-07-27 11:54:40 +00:00
tsutsui 6f57be1369 Add and return WSKBD_TYPE_LUNA and WSDISPLAY_TYPE_LUNA on WS*_GTYPE ioctls.
XXX: should we still sync <sys/dev/wsconsio.h> and src/sbin/wsconsctl/util.c?
2011-07-21 10:33:17 +00:00
tsutsui 248af3bb25 Changes put for luna68k X.Org mono server demo at OSC 2011 Kansai @ Kyoto:
- sprinkle volatile around register access
 - initialize pallete for WHITE on BLACK text
 - add WSDISPLAYIO_LINEBYTES ioctl(2)
 - fix index count in omsetcmap()
 - make omfbmmap() return cookie for OMFB_FB_RADDR to make
   X.Org wsfb driver work on 1bpp framebuffer memory
    (XXX: should revisit later)
 - make WSDISPLAYIO_GINFO always return 1bpp to avoid pallete mangled
   by X.Org server initialization
    (XXX: should revisit later)
2011-07-21 10:06:59 +00:00
tsutsui 3984c9c934 Fix thinko. src/sys/conf/mkldscript.sh requires $OBJDUMP, not $ELF2AOUT.
(note generated faked a.out kernels can still be loaded and work fine)
2011-07-20 12:00:04 +00:00
joerg 3eb244d801 Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
2011-07-17 20:54:30 +00:00
tsutsui bf2202e183 Revive NetBSD/luna68k.
Even after almost a lost decade since NetBSD/luna68k was
switched to using ELF format by default back in 2001,
actually only one fix (bus.h) is required for a GENERIC kernel itself
to get multiuser login: prompt on a real hardware.  Hurrahhh!!!

Demonstrated with a working Xorg mono server on the NetBSD booth
at Open Source Conference 2011 Kansai @ Kyoto:
 http://www.ospn.jp/osc2011-kyoto/

"Very impressed," commented by Tomoko YOSHIDA,
Program Committee Chair of the Conference,
and some other OMRON guys.

Special Thanks to Tadashi Okamura, for providing
a working SX-9100/DT "LUNA" for this mission.


Changes details:

sys/arch/luna68k/include/bus.h
 - handle stride properly even on multi and region ops for MI spc(4)
 - also fix stride handling of (currently unused) 2 and 4 byte ops

sys/arch/luna68k/conf/Makefile.luna68k
sys/arch/luna68k/conf/kern.ldscript.head
sys/arch/luna68k/conf/kern.ldscript.tail
 - build a faked a.out kernel using elf2aout(8) tool
   and a linker script derived from cats and shark
   for the LUNA firmware that loads a.out binary directly
   via network or from a UNIOS partition on a local disk

sys/arch/luna68k/dev/omrasops.c
sys/arch/luna68k/dev/omron_rfont.h
 - use the original OMRON font derived from 4.4BSD-Lite/luna68k
   rather than gallant19 which is used on Sun workstations
   (XXX omrasops.c should be rewritten to use generic wsfont(4))

distrib/luna68k/*
distrib/utils/sysinst/arch/luna68k/*
etc/etc.luna68k/MAKEDEV.conf
etc/etc.luna68k/Makefile.inc
sys/arch/luna68k/conf/INSTALL
 - build a ramdisk based INSTALL kernel with sysinst(8) for luna68k
 - also build an installation iso image for luna68k

sys/arch/luna68k/conf/GENERIC
 - enable SYSVSHM (and other SYSV*) options for Xorg server

More Xorg changes (which need some more cleanup) and
isiboot.c fixes will come soon.
2011-07-16 15:52:20 +00:00
wiz 4cbd24b23f dependant -> dependent 2011-06-30 20:09:15 +00:00
rmind e225b7bd09 Welcome to 5.99.53! Merge rmind-uvmplock branch:
- Reorganize locking in UVM and provide extra serialisation for pmap(9).
  New lock order: [vmpage-owner-lock] -> pmap-lock.

- Simplify locking in some pmap(9) modules by removing P->V locking.

- Use lock object on vmobjlock (and thus vnode_t::v_interlock) to share
  the locks amongst UVM objects where necessary (tmpfs, layerfs, unionfs).

- Rewrite and optimise x86 TLB shootdown code, make it simpler and cleaner.
  Add TLBSTATS option for x86 to collect statistics about TLB shootdowns.

- Unify /dev/mem et al in MI code and provide required locking (removes
  kernel-lock on some ports).  Also, avoid cache-aliasing issues.

Thanks to Andrew Doran and Joerg Sonnenberger, as their initial patches
formed the core changes of this branch.
2011-06-12 03:35:36 +00:00
matt 612b7ee57a struct device * -> device_t, struct cfdata * -> cfdata_t
CFATTACH_DECL(*, sizeof(struct device), -> CFATTACH_DECL_NEW(&, 0
2011-06-05 17:03:16 +00:00
tsutsui 34637b8687 - merge and move pasted m68k MD setreg() functions into m68k/m68k_machdep.c
- move m68881_save() and m68881_restore() declarations into <m68k/m68k.h>

Briefly tested and no obvious breakage on atari, sun3, and x68k.
2011-05-16 13:22:51 +00:00
rmind 2626d57668 Rename ttymalloc() to tty_alloc(), and ttyfree() to tty_free() for
consistency.  Remove some unnecessary malloc.h inclusions as well.
2011-04-24 16:26:51 +00:00
mrg 07a98cd33f obsolete DB_AOUT_SYMBOLS. however, we need to leave most of the code
in db_sym.[ch] as it is used by the elf version of crash(8).

i will be cleaning up the db_sym.c code in a follow up commit to avoid
having dead code compiled.
2011-04-11 04:22:30 +00:00
bouyer 063f96f3c2 merge the bouyer-quota2 branch. This adds a new on-disk format
to store disk quota usage and limits, integrated with ffs
metadata. Usage is checked by fsck_ffs (no more quotacheck)
and is covered by the WAPBL journal. Enabled with kernel
option QUOTA2 (added where QUOTA was enabled in kernel config files),
turned on with tunefs(8) on a per-filesystem
basis. mount_mfs(8) can also turn quotas on.

See http://mail-index.netbsd.org/tech-kern/2011/02/19/msg010025.html
for details.
2011-03-06 17:08:10 +00:00
joerg 48717cfc00 Refactor ps_strings access. Based on PK_32, write either the normal
version or the 32bit compat layout in execve1. Introduce a new function
copyin_psstrings for reading it back from userland and converting it to
the native layout. Refactor procfs to share most of the code with the
kern.proc_args sysctl handler.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.
2011-03-04 22:25:24 +00:00
rmind 9b6bd2d968 Remove clause 3 (UCB advertising clause) from the University of Utah
copyright.  Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
2011-02-08 20:20:06 +00:00
joerg 19b23810a0 Switch remaining platforms to modern CPP for assembler. 2011-01-21 15:59:04 +00:00
tsutsui 247eefa18e Explicitly include <machine/pcb.h> for struct pcb. 2011-01-17 14:53:42 +00:00
rmind 7146b2f61d Retire struct user, remove sys/user.h inclusions. Note sys/user.h header
as obsolete.  Remove USER_TO_UAREA/UAREA_TO_USER macros.

Various #include fixes and review by matt@.
2011-01-14 02:06:22 +00:00
tsutsui 6542895ee1 Tidy up common comments. (Yes, too many dup code...) 2011-01-02 18:48:04 +00:00
tsutsui ba49f620d3 Pull code that maps the kernel segment table cache invalidated for 040/060,
to reduce diffs from other m68k ports.

Compile test only. (any working machine for these port?)
2011-01-02 18:39:11 +00:00
tsutsui 3beadbf115 Misc cosmetics to reduce diff among hp300 derived m68k ports.
XXX: too many quirks to merge...
2011-01-02 08:40:54 +00:00
tsutsui 180ea1e5f3 Fix one more fatal typo. Umm. 2011-01-02 07:51:02 +00:00
matt c831bbca8c Collect cpu_info and friends and move to m68k/include/cpu.h
Add a define __HAVE_CPU_DATA_FIRST which means that cpu_data is the first
member in struct cpu_info.
2010-12-22 02:42:27 +00:00
matt 6a66466f0c Move counting of faults, traps, intrs, soft[intr]s, syscalls, and nswtch
from uvmexp to per-cpu cpu_data and move them to 64bits.  Remove unneeded
includes of <uvm/uvm_extern.h> and/or <uvm/uvm.h>.
2010-12-20 00:25:23 +00:00
hannken afdfce8e3b Remove unused count from pseudo-device md. 2010-11-23 11:13:52 +00:00