Commit Graph

58508 Commits

Author SHA1 Message Date
bouyer
e63d779940 Add FONT_BOLD8x16, which will help to have a 80x25 tty on sisfb
(which is limited to 640x400 pixels at this time).
2014-01-18 19:26:41 +00:00
mrg
03a295b74f convert a failure to call OF for a reboot call into a panic() instead
of a hard hang.
2014-01-17 09:09:40 +00:00
skrll
d9c0c9bcb2 Fix lasi at mainbus attachment, e.g. on a HP715/100. 2014-01-17 07:44:16 +00:00
matt
559e4587c7 Use uintptr_t & size_t instead of u_int and int for arm_sync_icache. 2014-01-16 21:48:41 +00:00
skrll
72ed813562 Add some 715 machines to cpu_model_cpuid including the 715/100 that
Ryo ONODERA has.
2014-01-16 13:19:36 +00:00
skrll
3aa51fe289 Drop CPU detection by features and panic if a CPU isn't detected via
PDC_MODEL_CPUID or cpu_model_cpuid.
2014-01-16 13:07:07 +00:00
christos
2b043c75b6 eliminate use of bsd.sys.mk from Makefiles 2014-01-16 01:15:32 +00:00
joerg
3d66511c09 Reduce amount of -no-integrated-as on x86 as .code16 is now supported by
LLVM.
2014-01-15 22:25:22 +00:00
joerg
7ef87bcc6b LLVM doesn't support data32/addr32, but is smart enough to figure the
necessary prefixes out.
2014-01-15 22:24:41 +00:00
skrll
c5fd26cf25 Fix various DEBUG option builds 2014-01-15 21:52:13 +00:00
tsutsui
50048dbc5e Revert previous. PR/48431 claims ALPHA_PHYS_TO_K0SEG() is necessary.
Actually CHIP_MEM_SYS_START(v) seems a physical address per *_mem_map()
function, but I don't think mmap() function should return K0SEG address
(it should return PA cookie IIUC) so I guess there is something wrong
in Titan's bus space functions.  I'll investigate them later.
2014-01-15 14:27:49 +00:00
matt
be2de77e3b Get rid on some useless pc addition. Use adr or ldr with pc relative
addressing.
2014-01-13 18:26:34 +00:00
tsutsui
fb53ad091b bus_space_mmap(9) function should return alpha_btop(PA), not alpha_btop(VA).
Pointed out in PR port-alpha/48431 from nullnilaki.
2014-01-13 15:48:09 +00:00
joerg
456d311f26 Try to reserve space in a way that results in the same allocation for
both LLVM and GNU as.
2014-01-12 20:31:50 +00:00
joerg
b3c9683653 Improve assembler syntax. 2014-01-12 19:37:43 +00:00
tsutsui
8c436a9898 Add empty LIBCRTI= as LIBCRT0 to build sa programs without installed DESTDIR.
XXX: probabry we should have bsd.saprog.mk or something.
2014-01-12 15:26:28 +00:00
jakllsch
9815810895 remove unused and undefined .globl 2014-01-11 19:31:47 +00:00
palle
d3ad036880 No need to make CI_MMFSA depend on SUN4V since the ci_mmfsa field is always present in the cpu_info struct now 2014-01-11 18:31:35 +00:00
matt
c3182005af Add hw.printfataltraps sysctl. Always print fatal traps for init. For all
other processes, only do so if cpu_printfataltraps is true.
2014-01-11 17:32:20 +00:00
christos
5a3fb681a6 Comment about missing stackframe member initialization (Richard Hansen)
I haven't studied the code, but I'm concerned that not initializing
sf->sf_edi could potentially leak a few bytes of information to a new
userspace process.
2014-01-11 17:14:00 +00:00
christos
09f4588963 stop ddb backtrace at Xsoftintr() (Richard Hansen)
Stop unwinding frames when db_stack_trace_print() encouters
Xsoftintr().  This avoids a recursive panic() due to an invalid
pointer dereference when a software interrupt panic()s.

Here's what happens without this change:

When db_stack_trace_print() runs during a panic() and db_nextframe()
encounters the Xsoftintr() frame, db_nextframe() does the following at
db_machdep.c:292:

  1. checks to see if there's a Xsoftintr() symbol (there is)
  2. checks to see if the frame corresponds to an interrupt (the
     symbol name begins with "Xsoft" so it does)

If both of the above are true (they are), db_nextframe() at
db_machdep.c:303 tries to get a pointer to a struct intrframe.
According to the comment at line 300, the second argument passed to
Xsoftintr() is a pointer to a struct intrframe.  However, the comment
and the corresponding code are not correct -- Xsoftintr() doesn't take
any arguments[1].  Attempting to fetch the second argument only yields
stack garbage, not a struct intrframe.  This causes db_machdep.c:307
to dereference a bad pointer, triggering the recursive panic().

[1] Xsoftintr() is called by Xspllower() which is called by splx()
    a.k.a. spllower().  Neither Xspllower() nor Xsoftintr() set up a
    standard frame when called (they don't do 'pushl %ebp; movl %esp,
    %ebp'), so Xsoftintr()'s %ebp is the same as splx()'s %ebp.  This
    makes splx()'s arguments look like Xsoftintr()'s arguments, and
    splx() does not take any arguments.

You can reproduce the recursive panic by reverting this change and
adding a call to panic() inside ipintr().  The backtrace will look
like the following (the line numbers you see might differ from these
line numbers -- this backtrace was generated from a slightly modified
version of the NetBSD 6.1 kernel):

    #0  vpanic (fmt=0xc0ba995b "trap", ap=0xdaa51730) at /usr/src/sys/kern/subr_prf.c:211
    #1  0xc0790529 in panic (fmt=0xc0ba995b "trap") at /usr/src/sys/kern/subr_prf.c:205
    #2  0xc07decbc in trap (frame=0xdaa517c0) at /usr/src/sys/arch/i386/i386/trap.c:396
    #3  0xc010cf48 in ?? () at /usr/src/sys/arch/i386/i386/vector.S:983
    #4  0xc02857f0 in db_get_value (addr=56, size=4, is_signed=false) at /usr/src/sys/ddb/db_access.c:72
    #5  0xc028a09a in db_nextframe (nextframe=0xdaa51b40, retaddr=0xdaa51b3c, arg0=0xdaa51b38, ip=0xdaa51b34, argp=0xdaa51d88, is_trap=0, pr=0xc07901b5 <printf>) at /usr/src/sys/arch/i386/i386/db_machdep.c:308
    #6  0xc028be2b in db_stack_trace_print (addr=<optimized out>, have_addr=true, count=65533, modif=0xc0bb44bf "", pr=0xc07901b5 <printf>) at /usr/src/sys/arch/x86/x86/db_trace.c:275
    #7  0xc07903cb in vpanic (fmt=0xc0b6ba76 "testing", ap=0xdaa51d4c) at /usr/src/sys/kern/subr_prf.c:296
    #8  0xc0790529 in panic (fmt=0xc0b6ba76 "testing") at /usr/src/sys/kern/subr_prf.c:205
    #9  0xc04e3d4f in ipintr () at /usr/src/sys/netinet/ip_input.c:369
    #10 0xc054ac0d in softint_execute (s=<optimized out>, si=<optimized out>, l=<optimized out>) at /usr/src/sys/kern/kern_softint.c:543
    #11 softint_dispatch (pinned=0xc4085560, s=4) at /usr/src/sys/kern/kern_softint.c:825
    #12 0xc0100fdb in ?? () at /usr/src/sys/arch/i386/i386/spl.S:390
    #13 0xc07d2e11 in tcp_usrreq (so=0xc40b0534, req=4, m=0x0, nam=0xc317ba00, control=0x0, l=0xc4085560) at /usr/src/sys/netinet/tcp_usrreq.c:615
    #14 0xc04bb300 in tcp_usrreq_wrapper (a=0xc40b0534, b=4, c=0x0, d=0xc317ba00, e=0x0, f=0xc4085560) at /usr/src/sys/netinet/in_proto.c:164
    #15 0xc0839006 in soconnect (so=0xc40b0534, nam=0xc317ba00, l=0xc4085560) at /usr/src/sys/kern/uipc_socket.c:821
    #16 0xc083c4ce in do_sys_connect (l=0xc4085560, fd=4, nam=0xc317ba00) at /usr/src/sys/kern/uipc_syscalls.c:371
    #17 0xc083dbeb in sys_connect (l=0xc4085560, uap=0xdbc27d00, retval=0xdbc27d28) at /usr/src/sys/kern/uipc_syscalls.c:350
    #18 0xc07b1b4a in sy_call (rval=0xdbc27d28, uap=0xdbc27d00, l=0xc4085560, sy=0xc0c2f018) at /usr/src/sys/sys/syscallvar.h:61
    #19 syscall (frame=0xdbc27d48) at /usr/src/sys/arch/x86/x86/syscall.c:179
    #20 0xc010056d in ?? () at /usr/src/sys/arch/i386/i386/locore.S:1160
    Backtrace stopped: previous frame inner to this frame (corrupt stack?)
2014-01-11 17:11:50 +00:00
christos
be5445b6bd Add softint case (Richard Hansen) 2014-01-11 17:10:40 +00:00
christos
bf0a60cb4a remove vestige from old call to printk()
This line was introduced with a call to printk() in CVS revision
1.22.4.3 and should have been removed when the call to printk() was
removed in CVS revision 1.22.4.6.  (Richard Hansen)
2014-01-11 17:06:15 +00:00
christos
fb4d88d5dd fix a comment (cpu_switch() -> cpu_switchto()) (Richard Hansen) 2014-01-11 17:05:17 +00:00
tsutsui
79b7a7600a Remove unused declarations. 2014-01-11 17:00:37 +00:00
tsutsui
544accc1f7 Remove tab nits. 2014-01-11 16:34:05 +00:00
tsutsui
0dfe4134ab Misc KNF and cosmetics. 2014-01-11 15:51:02 +00:00
tsutsui
b7bcae5276 ctually remove all references to obsolete stinger.h. 2014-01-11 14:35:15 +00:00
tsutsui
9cef42a9d3 Remove unused KernInter stuff. 2014-01-11 14:09:13 +00:00
nakayama
a420884c46 Uncomment ifdef/endif and tabify. 2014-01-11 12:20:07 +00:00
tsutsui
dba3cf8531 Bump version to denote support to pass boothowto and bootdev to kernel. 2014-01-11 08:20:51 +00:00
tsutsui
1b293e5d49 Add support to pass boothowto and bootdev info from bootloader to kernel.
Bootloader side changes:
- make boot command parse boothowto flags (-ads etc.)
- pass boothowto and bootdev info to the kernel via %d7 and %d6
  as the old 4.4BSD/luna68k kernel expected
- remove unused and now unnecessary "howto" (how_to_boot) command
- export and tweak make_device() in devopen.c to prepare bootdev info
- remove unused and commented out get_boot_device()
2014-01-11 08:08:23 +00:00
tsutsui
1a578d633f Add support to pass boothowto and bootdev info from bootloader to kernel.
Kernel side changes:
- use %d7 (boothowto) and %d6 (bootdev) to pass info and also use
  old macro in <sys/reboot.h> as ancient 4.4BSD did for simplicity
- add <machine/bootinfo.h> to define values as API to pass these info
- save boothowto and bootdev in registers right after zero'ing bss
- add MD device_register(9) to check booted_device per passed bootdev info
- merge old bootarg checks in rootconf() and luna68k_init() with
  tweaks for backward compatibility
  (direct boot a.out kernel from ROM monitor without bootloader still works)
2014-01-11 08:07:16 +00:00
tsutsui
f080c57575 Use the same address as LUNA to probe LANCE on LUNA-II.
It looks the device is mapped at both regions.
4.4BSD/luna68k probes it at 0xf1000000, but UniOS-Mach for LUNA-II
attaches the lance at 0xf0000000.  It is probably because
the UniOS needs to map DS1220 NVRAM (mapped at 0xf1000004 and
used to store the MAC address) to the different kernel page,
but there is no reason for us to use different addresses.
(Note our bootloader already use the same address for both machines.)

This change will make (forthcoming) booted device check easier.
2014-01-11 01:43:22 +00:00
matt
964e3f260f byte swap the insn on BE8 it's LE in memory but needs to be BE to decode. 2014-01-10 23:52:53 +00:00
matt
dd17f39af9 Make sure to start BE-8 programs with the PSR[E] set. 2014-01-10 18:03:26 +00:00
matt
5f4d36326b Flush out the PSR definitions. 2014-01-10 17:48:11 +00:00
jakllsch
f5ce59053c fix style and whitespace nits 2014-01-10 17:40:51 +00:00
pedro
3089b1af6a Fix a comment describing the check performed by copyin(); the value
checked against VM_MAXUSER_ADDRESS is derived from the source address,
not the destination address. OK rmind@.
2014-01-10 16:47:07 +00:00
christos
21d590390b make it clean after itself, use standard rules files 2014-01-10 16:41:16 +00:00
christos
c664e0f599 include bsd.own.mk 2014-01-10 16:36:29 +00:00
christos
760092e27b don't include bsd.sys.mk 2014-01-10 16:35:11 +00:00
tsutsui
25e766da30 Reorgenize boot device configuration. The idea is taken from OpenBSD/luna88k.
- remove kernel-like autoconfiguration to probe bootable devices
- initialize SCSI and Ethernet controllers statically instead
- reorganize device softc structures per autoconf removal
- probe and print all SCSI disks (but don't assign unit numbers)
- make sdopen() to recheck the device and allocate softc dynamically
- use controller number and SCSI target ID (ctlr * 10 + id) to specify
  the boot disk on the "boot" command arg
- bump version to denote changes

Now bootloader works as the following:
---
>> NetBSD/luna68k boot, Revision 1.8 (Wed Jan  8 22:13:12 JST 2014)
>> (based on Stinger ver 0.0 [Phase-31])

Machine model   = LUNA-II
Physical Memory = 0x4000000  (64 MB)

sc0 at 0xe1000000: async, parity, ID 7
 ID 3: TEAC FC-1     HGF  10 rev , 512 bytes/sect x 2879 sectors
 ID 6: IBM DPES-31080 rev S31Q, 512 bytes/sect x 2118143 sectors
sc1 at 0xe1000040: async, parity, ID 7
 ID 6: MELCO DSC-G rev 1.00, 512 bytes/sect x 62533295 sectors
le0: Am7990 LANCE Ethernet, mem at 0x71010000
le0: Ethernet address = 00:00:0a:03:42:77

Press return to boot now, any other key for boot menu
booting sd(16,0)netbsd - starting in 0 seconds.
auto-boot sd(16,0)netbsd
1911696+96040 [280480+159179]=0x255a30
 :
2014-01-10 11:12:03 +00:00
palle
f08e82f640 sun4v: Update description of the ci_mmfsa field in the cpu_info structure 2014-01-09 20:28:23 +00:00
palle
5317e12d65 Coding style fixes (whitespace) - no functional changes 2014-01-09 20:13:54 +00:00
macallan
96f3c05159 allow non-SUN4V kernels to build 2014-01-09 12:51:27 +00:00
dholland
586505dce8 Make the amd64 post-halt-press-a-key code match i386, and introduce
into both a message for the case where cngetc() doesn't work. If
there's no console attached, this won't accomplish anything; but if
there's a screen but no keyboard, or the keyboard's wedged, or
whatever, it might provide useful information.

Suggested back in 2009 by some stuff in PR 37924 and has been hanging
about in one of my trees ever since.
2014-01-09 00:57:25 +00:00
palle
6c190f50bb sun4v: trap table setup - currently populated with dummy entries which will be properly implemented later - parts from OpenBSD - OK martin@ 2014-01-07 20:11:35 +00:00
jakllsch
3f412a1c4c Make name argument to module_add_common const; use this to allow the libsa
fsmod string to soon become const.
2014-01-05 21:36:50 +00:00
jakllsch
b21d55811d sprinkle const 2014-01-05 21:10:50 +00:00