id stringlengths 22 129 | text stringlengths 60 19.5k | arch stringclasses 9
values | syntax stringclasses 5
values | kind stringclasses 4
values | repo stringclasses 32
values | path stringlengths 7 108 | license stringclasses 10
values | commit stringlengths 40 40 | source_host stringclasses 1
value | category stringclasses 15
values | source_url stringlengths 85 192 | line_start int64 1 5.48k | line_end int64 4 5.5k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:13 | * that is potentially on another physical CPU even if we
* observe only one virtual CPU as the guest.
*
* I don't see an obvious ordering-only instruction in the m68k
* instruction set, but qemu implements CAS with
* store-before-load ordering, so this should work for virtio.
*/
clrl %d0
casl %d0,%d0,%sp@... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | d7b3090516af177c5278a3cb2afae3e973c80bbe | github | kernel | https://github.com/NetBSD/src/blob/d7b3090516af177c5278a3cb2afae3e973c80bbe/sys/arch/virt68k/virt68k/locore.s | 481 | 505 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:7 | ENTRY_NOPROFILE(fpunsupp)
#if defined(M68040)
cmpl #FPU_68040,_C_LABEL(fputype) | 68040 FPU?
jne Lfp_unsupp | No, skip FPSP
#ifdef FPSP
jmp _ASM_LABEL(fpsp_unsupp) | yes, go handle it
#else
clrl %sp@- | stack adjust count
moveml #0xFFFF,%sp@- | save registers
moveq #T_FPEMULD,%d0 | denote as FP emulation tra... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 4c465e6270cbb133d0b73973b89f8d3ed0d19c25 | github | kernel | https://github.com/NetBSD/src/blob/4c465e6270cbb133d0b73973b89f8d3ed0d19c25/sys/arch/virt68k/virt68k/locore.s | 241 | 300 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:8 | bset #3,%a0@(0,%d0:w) | set exc_pend bit of BIU
Lfptnull:
fmovem %fpsr,%sp@- | push fpsr as code argument
frestore %a0@ | restore state
movl #T_FPERR,%sp@- | push type arg
jra _ASM_LABEL(faultstkadj) | call trap and deal with stack cleanup
/*
* Other exceptions only cause four and six word stack frame and requi... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 4c465e6270cbb133d0b73973b89f8d3ed0d19c25 | github | kernel | https://github.com/NetBSD/src/blob/4c465e6270cbb133d0b73973b89f8d3ed0d19c25/sys/arch/virt68k/virt68k/locore.s | 281 | 340 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:9 | jbsr _C_LABEL(cachectl1) | do it
lea %sp@(16),%sp | pop args
jra _ASM_LABEL(rei) | all done
/*
* Trace (single-step) trap. Kernel-mode is special.
* User mode traps are simply passed on to trap().
*/
ENTRY_NOPROFILE(trace)
clrl %sp@- | stack adjust count
moveml #0xFFFF,%sp@-
moveq #T_TRACE,%d0
| Check P... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 4c465e6270cbb133d0b73973b89f8d3ed0d19c25 | github | kernel | https://github.com/NetBSD/src/blob/4c465e6270cbb133d0b73973b89f8d3ed0d19c25/sys/arch/virt68k/virt68k/locore.s | 321 | 380 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:11 | #endif
#ifdef DDB
| Let DDB handle it
movl %a2,%sp@- | push frame ptr
movl %d2,%sp@- | push trap type
jbsr _C_LABEL(kdb_trap) | handle the trap
addql #8,%sp | pop args
#endif
/* Sun 3 drops into PROM here. */
Lbrkpt3:
| The stack pointer may have been modified, or
| data below it modified (by kgdb push call... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 4c465e6270cbb133d0b73973b89f8d3ed0d19c25 | github | kernel | https://github.com/NetBSD/src/blob/4c465e6270cbb133d0b73973b89f8d3ed0d19c25/sys/arch/virt68k/virt68k/locore.s | 401 | 460 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:12 | jra _ASM_LABEL(rei) | all done
/*
* Primitives
*/
/*
* Use common m68k process/lwp switch and context save subroutines.
*/
#define FPCOPROC /* XXX: Temp. Reqd. */
#include <m68k/m68k/switch_subr.s>
#if defined(M68040) || defined(M68060)
ENTRY(suline)
movl %sp@(4),%a0 | address to write
movl _C_LABEL(curpcb),... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 4c465e6270cbb133d0b73973b89f8d3ed0d19c25 | github | kernel | https://github.com/NetBSD/src/blob/4c465e6270cbb133d0b73973b89f8d3ed0d19c25/sys/arch/virt68k/virt68k/locore.s | 441 | 500 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:13 | ENTRY(ecacheon)
rts
ENTRY(ecacheoff)
rts
ENTRY(paravirt_membar_sync)
/*
* Store-before-load ordering with respect to matching logic
* on the hypervisor side.
*
* This is the same as membar_sync, but guaranteed never to be
* conditionalized or hotpatched away even on uniprocessor
* builds and boots -- b... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 4c465e6270cbb133d0b73973b89f8d3ed0d19c25 | github | kernel | https://github.com/NetBSD/src/blob/4c465e6270cbb133d0b73973b89f8d3ed0d19c25/sys/arch/virt68k/virt68k/locore.s | 481 | 521 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:7 | ENTRY_NOPROFILE(fpunsupp)
#if defined(M68040)
cmpl #FPU_68040,_C_LABEL(fputype) | 68040 FPU?
jne Lfp_unsupp | No, skip FPSP
#ifdef FPSP
jmp _ASM_LABEL(fpsp_unsupp) | yes, go handle it
#else
clrl %sp@- | stack adjust count
moveml #0xFFFF,%sp@- | save registers
moveq #T_FPEMULD,%d0 | denote as FP emulation tra... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | fd89440ac6bfc9214810e1056f80b69c2878b7ba | github | kernel | https://github.com/NetBSD/src/blob/fd89440ac6bfc9214810e1056f80b69c2878b7ba/sys/arch/virt68k/virt68k/locore.s | 241 | 300 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:8 | bset #3,%a0@(0,%d0:w) | set exc_pend bit of BIU
Lfptnull:
fmovem %fpsr,%sp@- | push fpsr as code argument
frestore %a0@ | restore state
movl #T_FPERR,%sp@- | push type arg
jra _ASM_LABEL(faultstkadj) | call trap and deal with stack cleanup
/*
* Other exceptions only cause four and six word stack frame and requi... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | fd89440ac6bfc9214810e1056f80b69c2878b7ba | github | kernel | https://github.com/NetBSD/src/blob/fd89440ac6bfc9214810e1056f80b69c2878b7ba/sys/arch/virt68k/virt68k/locore.s | 281 | 340 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:9 | * Trap 12 is the entry point for the cachectl "syscall" (both HPUX & BSD)
* cachectl(command, addr, length)
* command in d0, addr in a1, length in d1
*/
ENTRY_NOPROFILE(trap12)
movl _C_LABEL(curlwp),%a0
movl %a0@(L_PROC),%sp@- | push current proc pointer
movl %d1,%sp@- | push length
movl %a1,%sp@- | push addr
... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | fd89440ac6bfc9214810e1056f80b69c2878b7ba | github | kernel | https://github.com/NetBSD/src/blob/fd89440ac6bfc9214810e1056f80b69c2878b7ba/sys/arch/virt68k/virt68k/locore.s | 321 | 380 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:10 | * User mode traps are simply passed to trap().
*/
ENTRY_NOPROFILE(trap15)
clrl %sp@- | stack adjust count
moveml #0xFFFF,%sp@-
moveq #T_TRAP15,%d0
movw %sp@(FR_HW),%d1 | get PSW
andw #PSL_S,%d1 | from system mode?
jne Lkbrkpt | yes, kernel breakpoint
jra _ASM_LABEL(fault) | no, user-mode fault
Lkbrkpt: |... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | fd89440ac6bfc9214810e1056f80b69c2878b7ba | github | kernel | https://github.com/NetBSD/src/blob/fd89440ac6bfc9214810e1056f80b69c2878b7ba/sys/arch/virt68k/virt68k/locore.s | 361 | 420 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:11 | movl %d0,%d2 | trap type
movl %sp,%a2 | frame ptr
#ifdef KGDB
| Let KGDB handle it (if connected)
movl %a2,%sp@- | push frame ptr
movl %d2,%sp@- | push trap type
jbsr _C_LABEL(kgdb_trap) | handle the trap
addql #8,%sp | pop args
cmpl #0,%d0 | did kgdb handle it?
jne Lbrkpt3 | yes, done
#endif
#ifdef... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | fd89440ac6bfc9214810e1056f80b69c2878b7ba | github | kernel | https://github.com/NetBSD/src/blob/fd89440ac6bfc9214810e1056f80b69c2878b7ba/sys/arch/virt68k/virt68k/locore.s | 401 | 460 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:12 | * intrhand_autovec is the entry point for auto-vectored
* interrupts.
*/
ENTRY_NOPROFILE(intrhand_autovec)
addql #1,_C_LABEL(intr_depth)
INTERRUPT_SAVEREG
jbsr _C_LABEL(intr_dispatch) | call dispatcher
INTERRUPT_RESTOREREG
subql #1,_C_LABEL(intr_depth)
jra _ASM_LABEL(rei) | all done
/*
* Primitives
*/
/*
... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | fd89440ac6bfc9214810e1056f80b69c2878b7ba | github | kernel | https://github.com/NetBSD/src/blob/fd89440ac6bfc9214810e1056f80b69c2878b7ba/sys/arch/virt68k/virt68k/locore.s | 441 | 500 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:13 | moveq #0,%d0 | indicate no fault
jra Lsldone
Lslerr:
moveq #-1,%d0
Lsldone:
movl _C_LABEL(curpcb),%a1 | current pcb
clrl %a1@(PCB_ONFAULT) | clear fault address
rts
#endif
ENTRY(ecacheon)
rts
ENTRY(ecacheoff)
rts
ENTRY(paravirt_membar_sync)
/*
* Store-before-load ordering with respect to matching logic
... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | fd89440ac6bfc9214810e1056f80b69c2878b7ba | github | kernel | https://github.com/NetBSD/src/blob/fd89440ac6bfc9214810e1056f80b69c2878b7ba/sys/arch/virt68k/virt68k/locore.s | 481 | 531 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:14 | */
.data
GLOBAL(mmutype)
.long MMU_68040 | default to MMU_68040
GLOBAL(cputype)
.long CPU_68040 | default to CPU_68040
GLOBAL(fputype)
.long FPU_68040 | default to FPU_68040 | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | fd89440ac6bfc9214810e1056f80b69c2878b7ba | github | kernel | https://github.com/NetBSD/src/blob/fd89440ac6bfc9214810e1056f80b69c2878b7ba/sys/arch/virt68k/virt68k/locore.s | 521 | 531 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:8 | bset #3,%a0@(0,%d0:w) | set exc_pend bit of BIU
Lfptnull:
fmovem %fpsr,%sp@- | push fpsr as code argument
frestore %a0@ | restore state
movl #T_FPERR,%sp@- | push type arg
jra _ASM_LABEL(faultstkadj) | call trap and deal with stack cleanup
/*
* Other exceptions only cause four and six word stack frame and requi... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 9a0dbd044da39c7df3a3ef7bf2d3ebc8cfae0f6c | github | kernel | https://github.com/NetBSD/src/blob/9a0dbd044da39c7df3a3ef7bf2d3ebc8cfae0f6c/sys/arch/virt68k/virt68k/locore.s | 281 | 340 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:11 | movl %d0,%d2 | trap type
movl %sp,%a2 | frame ptr
#ifdef KGDB
| Let KGDB handle it (if connected)
movl %a2,%sp@- | push frame ptr
movl %d2,%sp@- | push trap type
jbsr _C_LABEL(kgdb_trap) | handle the trap
addql #8,%sp | pop args
cmpl #0,%d0 | did kgdb handle it?
jne Lbrkpt3 | yes, done
#endif
#ifdef... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 9a0dbd044da39c7df3a3ef7bf2d3ebc8cfae0f6c | github | kernel | https://github.com/NetBSD/src/blob/9a0dbd044da39c7df3a3ef7bf2d3ebc8cfae0f6c/sys/arch/virt68k/virt68k/locore.s | 401 | 460 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:12 | * intrhand_autovec is the entry point for auto-vectored
* interrupts.
*/
ENTRY_NOPROFILE(intrhand_autovec)
addql #1,_C_LABEL(intr_depth)
INTERRUPT_SAVEREG
jbsr _C_LABEL(intr_dispatch) | call dispatcher
INTERRUPT_RESTOREREG
subql #1,_C_LABEL(intr_depth)
/* FALLTHROUGH to rei */
/*
* Emulation of VAX REI inst... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 9a0dbd044da39c7df3a3ef7bf2d3ebc8cfae0f6c | github | kernel | https://github.com/NetBSD/src/blob/9a0dbd044da39c7df3a3ef7bf2d3ebc8cfae0f6c/sys/arch/virt68k/virt68k/locore.s | 441 | 500 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:13 | movl %sp@(FR_SP),%a0 | restore user SP
movl %a0,%usp | from save area
movw %sp@(FR_ADJ),%d0 | need to adjust stack?
jne Laststkadj | yes, go to it
moveml %sp@+,#0x7FFF | no, restore most user regs
addql #8,%sp | toss SP and stack adjust
Ldorte: rte | and do real RTE
Laststkadj:
lea %sp@(FR_HW),%a1 | ... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 9a0dbd044da39c7df3a3ef7bf2d3ebc8cfae0f6c | github | kernel | https://github.com/NetBSD/src/blob/9a0dbd044da39c7df3a3ef7bf2d3ebc8cfae0f6c/sys/arch/virt68k/virt68k/locore.s | 481 | 540 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:14 | movsl %d0,%a0@+ | put lword
nop | sync
movl %a1@+,%d0 | get lword
movsl %d0,%a0@+ | put lword
nop | sync
movl %a1@+,%d0 | get lword
movsl %d0,%a0@+ | put lword
nop | sync
moveq #0,%d0 | indicate no fault
jra Lsldone
Lslerr:
moveq #-1,%d0
Lsldone:
movl _C_LABEL(curpcb),%a1 | current pcb
clrl ... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 9a0dbd044da39c7df3a3ef7bf2d3ebc8cfae0f6c | github | kernel | https://github.com/NetBSD/src/blob/9a0dbd044da39c7df3a3ef7bf2d3ebc8cfae0f6c/sys/arch/virt68k/virt68k/locore.s | 521 | 579 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:15 | */
clrl %d0
casl %d0,%d0,%sp@
rts
END(paravirt_membar_sync)
/*
* Misc. global variables.
*/
.data
GLOBAL(mmutype)
.long MMU_68040 | default to MMU_68040
GLOBAL(cputype)
.long CPU_68040 | default to CPU_68040
GLOBAL(fputype)
.long FPU_68040 | default to FPU_68040 | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 9a0dbd044da39c7df3a3ef7bf2d3ebc8cfae0f6c | github | kernel | https://github.com/NetBSD/src/blob/9a0dbd044da39c7df3a3ef7bf2d3ebc8cfae0f6c/sys/arch/virt68k/virt68k/locore.s | 561 | 579 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:6 | /* final setup for C code */
movl %d7,%sp@- | push nextpa saved above
jbsr _C_LABEL(machine_init) | additional pre-main initialization
addql #4,%sp
/*
* Create a fake exception frame so that cpu_lwp_fork() can copy it.
* main() nevers returns; we exit to user mode from a forked process
* later on.
*/
clrw %sp@... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 7a50df7f13f44282c494a158ccac105d4d8e3c64 | github | kernel | https://github.com/NetBSD/src/blob/7a50df7f13f44282c494a158ccac105d4d8e3c64/sys/arch/virt68k/virt68k/locore.s | 201 | 260 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:7 | #endif
Lfp_unimp:
#endif /* M68040 */
jra _C_LABEL(illinst)
ENTRY_NOPROFILE(fpunsupp)
#if defined(M68040)
cmpl #FPU_68040,_C_LABEL(fputype) | 68040 FPU?
jne Lfp_unsupp | No, skip FPSP
#ifdef FPSP
jmp _ASM_LABEL(fpsp_unsupp) | yes, go handle it
#else
clrl %sp@- | stack adjust count
moveml #0xFFFF,%sp@- | save... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 7a50df7f13f44282c494a158ccac105d4d8e3c64 | github | kernel | https://github.com/NetBSD/src/blob/7a50df7f13f44282c494a158ccac105d4d8e3c64/sys/arch/virt68k/virt68k/locore.s | 241 | 300 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:8 | #endif
tstb %a0@ | null state frame?
jeq Lfptnull | yes, safe
clrw %d0 | no, need to tweak BIU
movb %a0@(1),%d0 | get frame size
bset #3,%a0@(0,%d0:w) | set exc_pend bit of BIU
Lfptnull:
fmovem %fpsr,%sp@- | push fpsr as code argument
frestore %a0@ | restore state
movl #T_FPERR,%sp@- | push type arg
jra _AS... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 7a50df7f13f44282c494a158ccac105d4d8e3c64 | github | kernel | https://github.com/NetBSD/src/blob/7a50df7f13f44282c494a158ccac105d4d8e3c64/sys/arch/virt68k/virt68k/locore.s | 281 | 340 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:9 | moveml %sp@+,#0x7FFF | restore most registers
addql #8,%sp | pop SP and stack adjust
rte
/*
* Trap 12 is the entry point for the cachectl "syscall" (both HPUX & BSD)
* cachectl(command, addr, length)
* command in d0, addr in a1, length in d1
*/
ENTRY_NOPROFILE(trap12)
movl _C_LABEL(curlwp),%a0
movl %a0@(L_P... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 7a50df7f13f44282c494a158ccac105d4d8e3c64 | github | kernel | https://github.com/NetBSD/src/blob/7a50df7f13f44282c494a158ccac105d4d8e3c64/sys/arch/virt68k/virt68k/locore.s | 321 | 380 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:11 | | set breakpoints in trap() if we want. We know
| the trap type is either T_TRACE or T_BREAKPOINT.
| If we have both DDB and KGDB, let KGDB see it first,
| because KGDB will just return 0 if not connected.
| Save args in d2, a2
movl %d0,%d2 | trap type
movl %sp,%a2 | frame ptr
#ifdef KGDB
| Let KGDB handle ... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 7a50df7f13f44282c494a158ccac105d4d8e3c64 | github | kernel | https://github.com/NetBSD/src/blob/7a50df7f13f44282c494a158ccac105d4d8e3c64/sys/arch/virt68k/virt68k/locore.s | 401 | 460 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:12 | * Interrupt handlers.
*
* For auto-vectored interrupts, the CPU provides the
* vector 0x18+level.
*
* intrhand_autovec is the entry point for auto-vectored
* interrupts.
*/
ENTRY_NOPROFILE(intrhand_autovec)
addql #1,_C_LABEL(intr_depth)
INTERRUPT_SAVEREG
jbsr _C_LABEL(intr_dispatch) | call dispatcher
INTERR... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 7a50df7f13f44282c494a158ccac105d4d8e3c64 | github | kernel | https://github.com/NetBSD/src/blob/7a50df7f13f44282c494a158ccac105d4d8e3c64/sys/arch/virt68k/virt68k/locore.s | 441 | 500 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:13 | clrl %sp@- | code == none
movl #T_ASTFLT,%sp@- | type == async system trap
pea %sp@(12) | fp == address of trap frame
jbsr _C_LABEL(trap) | go handle it
lea %sp@(16),%sp | pop value args
movl %sp@(FR_SP),%a0 | restore user SP
movl %a0,%usp | from save area
movw %sp@(FR_ADJ),%d0 | need to adjust stack?
... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 7a50df7f13f44282c494a158ccac105d4d8e3c64 | github | kernel | https://github.com/NetBSD/src/blob/7a50df7f13f44282c494a158ccac105d4d8e3c64/sys/arch/virt68k/virt68k/locore.s | 481 | 540 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:14 | movl %sp@(8),%a1 | address of line
movl %a1@+,%d0 | get lword
movsl %d0,%a0@+ | put lword
nop | sync
movl %a1@+,%d0 | get lword
movsl %d0,%a0@+ | put lword
nop | sync
movl %a1@+,%d0 | get lword
movsl %d0,%a0@+ | put lword
nop | sync
movl %a1@+,%d0 | get lword
movsl %d0,%a0@+ | put lword
no... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 7a50df7f13f44282c494a158ccac105d4d8e3c64 | github | kernel | https://github.com/NetBSD/src/blob/7a50df7f13f44282c494a158ccac105d4d8e3c64/sys/arch/virt68k/virt68k/locore.s | 521 | 580 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:15 | * observe only one virtual CPU as the guest.
*
* I don't see an obvious ordering-only instruction in the m68k
* instruction set, but qemu implements CAS with
* store-before-load ordering, so this should work for virtio.
*/
clrl %d0
casl %d0,%d0,%sp@
rts
END(paravirt_membar_sync)
/*
* Misc. global variabl... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 7a50df7f13f44282c494a158ccac105d4d8e3c64 | github | kernel | https://github.com/NetBSD/src/blob/7a50df7f13f44282c494a158ccac105d4d8e3c64/sys/arch/virt68k/virt68k/locore.s | 561 | 584 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:6 | /* final setup for C code */
movl %d7,%sp@- | push nextpa saved above
jbsr _C_LABEL(machine_init) | additional pre-main initialization
addql #4,%sp
/*
* Create a fake exception frame so that cpu_lwp_fork() can copy it.
* main() nevers returns; we exit to user mode from a forked process
* later on.
*/
clrw %sp@... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | dc1e3eb1c1c7fb04d9c5183287d8db4946327bcf | github | kernel | https://github.com/NetBSD/src/blob/dc1e3eb1c1c7fb04d9c5183287d8db4946327bcf/sys/arch/virt68k/virt68k/locore.s | 201 | 260 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:7 | #else
clrl %sp@- | stack adjust count
moveml #0xFFFF,%sp@- | save registers
moveq #T_FPEMULD,%d0 | denote as FP emulation trap
jra _ASM_LABEL(fault) | do it
#endif
Lfp_unimp:
#endif /* M68040 */
jra _C_LABEL(illinst)
ENTRY_NOPROFILE(fpunsupp)
#if defined(M68040)
cmpl #FPU_68040,_C_LABEL(fputype) | 68040 FPU?... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | dc1e3eb1c1c7fb04d9c5183287d8db4946327bcf | github | kernel | https://github.com/NetBSD/src/blob/dc1e3eb1c1c7fb04d9c5183287d8db4946327bcf/sys/arch/virt68k/virt68k/locore.s | 241 | 300 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:8 | fsave %a0@ | save state
#if defined(M68040) || defined(M68060)
/* always null state frame on 68040, 68060 */
cmpl #FPU_68040,_C_LABEL(fputype)
jge Lfptnull
#endif
tstb %a0@ | null state frame?
jeq Lfptnull | yes, safe
clrw %d0 | no, need to tweak BIU
movb %a0@(1),%d0 | get frame size
bset #3,%a0@(0,%d0:w) | ... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | dc1e3eb1c1c7fb04d9c5183287d8db4946327bcf | github | kernel | https://github.com/NetBSD/src/blob/dc1e3eb1c1c7fb04d9c5183287d8db4946327bcf/sys/arch/virt68k/virt68k/locore.s | 281 | 340 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:9 | addql #4,%sp | pop syscall arg
tstl _C_LABEL(astpending) | AST pending?
jne Lrei1 | Yup, go deal with it.
movl %sp@(FR_SP),%a0 | grab and restore
movl %a0,%usp | user SP
moveml %sp@+,#0x7FFF | restore most registers
addql #8,%sp | pop SP and stack adjust
rte
/*
* Trap 12 is the entry point for the c... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | dc1e3eb1c1c7fb04d9c5183287d8db4946327bcf | github | kernel | https://github.com/NetBSD/src/blob/dc1e3eb1c1c7fb04d9c5183287d8db4946327bcf/sys/arch/virt68k/virt68k/locore.s | 321 | 380 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:10 | notw %d1 | XXX no support for T0 on 680[234]0
andw #PSL_TS,%d1 | from system mode (T=1, S=1)?
jeq Lkbrkpt | yes, kernel breakpoint
jra _ASM_LABEL(fault) | no, user-mode fault
/*
* Trap 15 is used for:
* - GDB breakpoints (in user programs)
* - KGDB breakpoints (in the kernel)
* - trace traps for SUN binari... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | dc1e3eb1c1c7fb04d9c5183287d8db4946327bcf | github | kernel | https://github.com/NetBSD/src/blob/dc1e3eb1c1c7fb04d9c5183287d8db4946327bcf/sys/arch/virt68k/virt68k/locore.s | 361 | 420 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:11 | jbgt Lbrkpt1
Lbrkpt2:
| Call the trap handler for the kernel debugger.
| Do not call trap() to do it, so that we can
| set breakpoints in trap() if we want. We know
| the trap type is either T_TRACE or T_BREAKPOINT.
| If we have both DDB and KGDB, let KGDB see it first,
| because KGDB will just return 0 if not ... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | dc1e3eb1c1c7fb04d9c5183287d8db4946327bcf | github | kernel | https://github.com/NetBSD/src/blob/dc1e3eb1c1c7fb04d9c5183287d8db4946327bcf/sys/arch/virt68k/virt68k/locore.s | 401 | 460 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:12 | moveml %sp@+,#0x7FFF | restore all but sp
movl %sp@,%sp | ... and sp
rte | all done
/*
* Interrupt handlers.
*
* For auto-vectored interrupts, the CPU provides the
* vector 0x18+level.
*
* intrhand_autovec is the entry point for auto-vectored
* interrupts.
*/
ENTRY_NOPROFILE(intrhand_autovec)
addql #1... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | dc1e3eb1c1c7fb04d9c5183287d8db4946327bcf | github | kernel | https://github.com/NetBSD/src/blob/dc1e3eb1c1c7fb04d9c5183287d8db4946327bcf/sys/arch/virt68k/virt68k/locore.s | 441 | 500 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:13 | clrl %sp@- | stack adjust
moveml #0xFFFF,%sp@- | save all registers
movl %usp,%a1 | including
movl %a1,%sp@(FR_SP) | the users SP
Lrei1: clrl %sp@- | VA == none
clrl %sp@- | code == none
movl #T_ASTFLT,%sp@- | type == async system trap
pea %sp@(12) | fp == address of trap frame
jbsr _C_LABEL(trap) ... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | dc1e3eb1c1c7fb04d9c5183287d8db4946327bcf | github | kernel | https://github.com/NetBSD/src/blob/dc1e3eb1c1c7fb04d9c5183287d8db4946327bcf/sys/arch/virt68k/virt68k/locore.s | 481 | 540 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:14 | #if defined(M68040) || defined(M68060)
ENTRY(suline)
movl %sp@(4),%a0 | address to write
movl _C_LABEL(curpcb),%a1 | current pcb
movl #Lslerr,%a1@(PCB_ONFAULT) | where to return to on a fault
movl %sp@(8),%a1 | address of line
movl %a1@+,%d0 | get lword
movsl %d0,%a0@+ | put lword
nop | sync
movl %a1@+,%... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | dc1e3eb1c1c7fb04d9c5183287d8db4946327bcf | github | kernel | https://github.com/NetBSD/src/blob/dc1e3eb1c1c7fb04d9c5183287d8db4946327bcf/sys/arch/virt68k/virt68k/locore.s | 521 | 580 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:15 | * This is the same as membar_sync, but guaranteed never to be
* conditionalized or hotpatched away even on uniprocessor
* builds and boots -- because under virtualization, we still
* have to coordinate with a `device' backed by a hypervisor
* that is potentially on another physical CPU even if we
* observe on... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | dc1e3eb1c1c7fb04d9c5183287d8db4946327bcf | github | kernel | https://github.com/NetBSD/src/blob/dc1e3eb1c1c7fb04d9c5183287d8db4946327bcf/sys/arch/virt68k/virt68k/locore.s | 561 | 589 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:5 | movl %d0, %d7
/* NOTE: %d7 is now off-limits!! */
/*
* Enable the MMU.
* Since the kernel is mapped logical == physical, there is no prep
* work to do.
*/
#include <m68k/m68k/mmu_enable.s>
/*
* Should be running mapped from this point on
*/
Lmmuenabled:
lea _ASM_LABEL(tmpstk),%sp | re-load the temporary stac... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 15fd8fdd4e70d034d98ba229393c0ee8b0aafc38 | github | kernel | https://github.com/NetBSD/src/blob/15fd8fdd4e70d034d98ba229393c0ee8b0aafc38/sys/arch/virt68k/virt68k/locore.s | 161 | 220 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:6 | /* final setup for C code */
movl %d7,%sp@- | push nextpa saved above
jbsr _C_LABEL(virt68k_init) | additional pre-main initialization
addql #4,%sp
/*
* Create a fake exception frame so that cpu_lwp_fork() can copy it.
* main() nevers returns; we exit to user mode from a forked process
* later on.
*/
clrw %sp@... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 15fd8fdd4e70d034d98ba229393c0ee8b0aafc38 | github | kernel | https://github.com/NetBSD/src/blob/15fd8fdd4e70d034d98ba229393c0ee8b0aafc38/sys/arch/virt68k/virt68k/locore.s | 201 | 260 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:4 | ASRELOC(tmpstk, %a0)
movl %a0,%sp | give ourselves a temporary stack
RELOC(edata,%a0) | clear out BSS
movl #_C_LABEL(end) - 4, %d0 | (must be <= 256 kB)
subl #_C_LABEL(edata), %d0
lsrl #2,%d0
1: clrl %a0@+
dbra %d0,1b
/*
* Qemu does not pass us the symbols, so leave esym alone.
* The bootinfo immediatel... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | eb732e65431c188e89032d66dcf4ee2c91c2953a | github | kernel | https://github.com/NetBSD/src/blob/eb732e65431c188e89032d66dcf4ee2c91c2953a/sys/arch/virt68k/virt68k/locore.s | 121 | 180 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:5 | movl %d0, %d7
/* NOTE: %d7 is now off-limits!! */
/*
* Enable the MMU.
* Since the kernel is mapped logical == physical, we just turn it on.
*/
RELOC(Sysseg_pa, %a0) | system segment table addr
movl %a0@,%d1 | read value (a PA)
#if defined(M68040) || defined(M68060)
RELOC(mmutype, %a0)
cmpl #MMU_68040,%a0@ ... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | eb732e65431c188e89032d66dcf4ee2c91c2953a | github | kernel | https://github.com/NetBSD/src/blob/eb732e65431c188e89032d66dcf4ee2c91c2953a/sys/arch/virt68k/virt68k/locore.s | 161 | 220 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:6 | 2:
#endif /* M68040 || M68060 */
#if defined(M68020) || defined(M68030)
RELOC(protorp, %a0)
movl %d1,%a0@(4) | segtable address
pmove %a0@,%srp | load the supervisor root pointer
#ifdef M68030
RELOC(mmutype, %a0)
cmpl #MMU_68030,%a0@ | 68030?
jne 1f | no, skip
RELOC(mmu_tt30, %a0) | pointer to TT reg valu... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | eb732e65431c188e89032d66dcf4ee2c91c2953a | github | kernel | https://github.com/NetBSD/src/blob/eb732e65431c188e89032d66dcf4ee2c91c2953a/sys/arch/virt68k/virt68k/locore.s | 201 | 260 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:7 | pea %a0@(PCB_FPCTX)
jbsr _C_LABEL(m68881_restore) | restore it (does not kill %a0)
addql #4,%sp
1:
cmpl #MMU_68040,_C_LABEL(mmutype) | 68040?
jeq 1f | yes, cache already on
pflusha
movl #CACHE_ON,%d0
movc %d0,%cacr | clear cache(s)
jra 2f
1:
.word 0xf518 | pflusha
2:
/* final setup for C code */
movl %d7... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | eb732e65431c188e89032d66dcf4ee2c91c2953a | github | kernel | https://github.com/NetBSD/src/blob/eb732e65431c188e89032d66dcf4ee2c91c2953a/sys/arch/virt68k/virt68k/locore.s | 241 | 300 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:8 | #include <m68k/m68k/busaddrerr.s>
/*
* FP exceptions.
*/
ENTRY_NOPROFILE(fpfline)
#if defined(M68040)
cmpl #FPU_68040,_C_LABEL(fputype) | 68040 FPU?
jne Lfp_unimp | no, skip FPSP
cmpw #0x202c,%sp@(6) | format type 2?
jne _C_LABEL(illinst) | no, not an FP emulation
#ifdef FPSP
jmp _ASM_LABEL(fpsp_unimp) | yes,... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | eb732e65431c188e89032d66dcf4ee2c91c2953a | github | kernel | https://github.com/NetBSD/src/blob/eb732e65431c188e89032d66dcf4ee2c91c2953a/sys/arch/virt68k/virt68k/locore.s | 281 | 340 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:9 | * Handles all other FP coprocessor exceptions.
* Note that since some FP exceptions generate mid-instruction frames
* and may cause signal delivery, we need to test for stack adjustment
* after the trap call.
*/
ENTRY_NOPROFILE(fpfault)
clrl %sp@- | stack adjust count
moveml #0xFFFF,%sp@- | save user registers
... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | eb732e65431c188e89032d66dcf4ee2c91c2953a | github | kernel | https://github.com/NetBSD/src/blob/eb732e65431c188e89032d66dcf4ee2c91c2953a/sys/arch/virt68k/virt68k/locore.s | 321 | 380 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:10 | movl %sp@(22),%sp@- | and PC
jbsr _C_LABEL(straytrap) | report
addql #8,%sp | pop args
moveml %sp@+,#0x0303 | restore regs
jra _ASM_LABEL(rei) | all done
ENTRY_NOPROFILE(trap0)
clrl %sp@- | stack adjust count
moveml #0xFFFF,%sp@- | save user registers
movl %usp,%a0 | save the user SP
movl %a0,%sp@(FR_... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | eb732e65431c188e89032d66dcf4ee2c91c2953a | github | kernel | https://github.com/NetBSD/src/blob/eb732e65431c188e89032d66dcf4ee2c91c2953a/sys/arch/virt68k/virt68k/locore.s | 361 | 420 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:11 | */
ENTRY_NOPROFILE(trace)
clrl %sp@- | stack adjust count
moveml #0xFFFF,%sp@-
moveq #T_TRACE,%d0
| Check PSW and see what happen.
| T=0 S=0 (should not happen)
| T=1 S=0 trace trap from user mode
| T=0 S=1 trace trap on a trap instruction
| T=1 S=1 trace trap from system mode (kernel breakpoint)
m... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | eb732e65431c188e89032d66dcf4ee2c91c2953a | github | kernel | https://github.com/NetBSD/src/blob/eb732e65431c188e89032d66dcf4ee2c91c2953a/sys/arch/virt68k/virt68k/locore.s | 401 | 460 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:12 | | If were are not on tmpstk switch to it.
| (so debugger can change the stack pointer)
movl %a6,%d1
cmpl #_ASM_LABEL(tmpstk),%d1
jls Lbrkpt2 | already on tmpstk
| Copy frame to the temporary stack
movl %sp,%a0 | a0=src
lea _ASM_LABEL(tmpstk)-96,%a1 | a1=dst
movl %a1,%sp | sp=new frame
movql #FR_SIZE,%d1
... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | eb732e65431c188e89032d66dcf4ee2c91c2953a | github | kernel | https://github.com/NetBSD/src/blob/eb732e65431c188e89032d66dcf4ee2c91c2953a/sys/arch/virt68k/virt68k/locore.s | 441 | 500 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:13 | #endif
/* Sun 3 drops into PROM here. */
Lbrkpt3:
| The stack pointer may have been modified, or
| data below it modified (by kgdb push call),
| so push the hardware frame at the current sp
| before restoring registers and returning.
movl %sp@(FR_SP),%a0 | modified sp
lea %sp@(FR_SIZE),%a1 | end of our frame
... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | eb732e65431c188e89032d66dcf4ee2c91c2953a | github | kernel | https://github.com/NetBSD/src/blob/eb732e65431c188e89032d66dcf4ee2c91c2953a/sys/arch/virt68k/virt68k/locore.s | 481 | 540 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:14 | * (profiling, scheduling).
* After identifying that we need an AST we drop the IPL to allow device
* interrupts.
*
* This code is complicated by the fact that sendsig may have been called
* necessitating a stack cleanup.
*/
ASENTRY_NOPROFILE(rei)
tstl _C_LABEL(astpending) | AST pending?
jeq Ldorte | Nope. Jus... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | eb732e65431c188e89032d66dcf4ee2c91c2953a | github | kernel | https://github.com/NetBSD/src/blob/eb732e65431c188e89032d66dcf4ee2c91c2953a/sys/arch/virt68k/virt68k/locore.s | 521 | 580 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:15 | movl %sp@,%sp | and our SP
rte | and do real RTE
/*
* Primitives
*/
/*
* Use common m68k process/lwp switch and context save subroutines.
*/
#define FPCOPROC /* XXX: Temp. Reqd. */
#include <m68k/m68k/switch_subr.s>
#if defined(M68040) || defined(M68060)
ENTRY(suline)
movl %sp@(4),%a0 | address to write
... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | eb732e65431c188e89032d66dcf4ee2c91c2953a | github | kernel | https://github.com/NetBSD/src/blob/eb732e65431c188e89032d66dcf4ee2c91c2953a/sys/arch/virt68k/virt68k/locore.s | 561 | 620 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:4 | ASRELOC(tmpstk, %a0)
movl %a0,%sp | give ourselves a temporary stack
RELOC(edata,%a0) | clear out BSS
movl #_C_LABEL(end) - 4, %d0 | (must be <= 256 kB)
subl #_C_LABEL(edata), %d0
lsrl #2,%d0
1: clrl %a0@+
dbra %d0,1b
/*
* Qemu does not pass us the symbols, so leave esym alone.
* The bootinfo immediatel... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | dafc74396473c1c470d833732a82f1be6346ef3d | github | kernel | https://github.com/NetBSD/src/blob/dafc74396473c1c470d833732a82f1be6346ef3d/sys/arch/virt68k/virt68k/locore.s | 121 | 180 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:5 | movl %d0, %d7
/* NOTE: %d7 is now off-limits!! */
/*
* Enable the MMU.
* Since the kernel is mapped logical == physical, we just turn it on.
*/
RELOC(Sysseg_pa, %a0) | system segment table addr
movl %a0@,%d1 | read value (a PA)
#if defined(M68040) || defined(M68060)
RELOC(mmutype, %a0)
cmpl #MMU_68040,%a0@ ... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | dafc74396473c1c470d833732a82f1be6346ef3d | github | kernel | https://github.com/NetBSD/src/blob/dafc74396473c1c470d833732a82f1be6346ef3d/sys/arch/virt68k/virt68k/locore.s | 161 | 220 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:6 | 2:
#endif /* M68040 || M68060 */
#if defined(M68020) || defined(M68030)
RELOC(protorp, %a0)
movl %d1,%a0@(4) | segtable address
pmove %a0@,%srp | load the supervisor root pointer
#ifdef M68030
RELOC(mmutype, %a0)
cmpl #MMU_68030,%a0@ | 68030?
jne 1f | no, skip
RELOC(mmu_tt30, %a0) | pointer to TT reg valu... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | dafc74396473c1c470d833732a82f1be6346ef3d | github | kernel | https://github.com/NetBSD/src/blob/dafc74396473c1c470d833732a82f1be6346ef3d/sys/arch/virt68k/virt68k/locore.s | 201 | 260 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:7 | jbsr _C_LABEL(m68881_restore) | restore it (does not kill %a0)
addql #4,%sp
1:
cmpl #MMU_68040,_C_LABEL(mmutype) | 68040?
jeq 1f | yes, cache already on
pflusha
movl #CACHE_ON,%d0
movc %d0,%cacr | clear cache(s)
jra 2f
1:
.word 0xf518 | pflusha
2:
/* final setup for C code */
movl %d7,%sp@- | push nextpa... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | dafc74396473c1c470d833732a82f1be6346ef3d | github | kernel | https://github.com/NetBSD/src/blob/dafc74396473c1c470d833732a82f1be6346ef3d/sys/arch/virt68k/virt68k/locore.s | 241 | 300 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:8 | /*
* FP exceptions.
*/
ENTRY_NOPROFILE(fpfline)
#if defined(M68040)
cmpl #FPU_68040,_C_LABEL(fputype) | 68040 FPU?
jne Lfp_unimp | no, skip FPSP
cmpw #0x202c,%sp@(6) | format type 2?
jne _C_LABEL(illinst) | no, not an FP emulation
#ifdef FPSP
jmp _ASM_LABEL(fpsp_unimp) | yes, go handle it
#else
clrl %sp@- |... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | dafc74396473c1c470d833732a82f1be6346ef3d | github | kernel | https://github.com/NetBSD/src/blob/dafc74396473c1c470d833732a82f1be6346ef3d/sys/arch/virt68k/virt68k/locore.s | 281 | 340 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:9 | * Note that since some FP exceptions generate mid-instruction frames
* and may cause signal delivery, we need to test for stack adjustment
* after the trap call.
*/
ENTRY_NOPROFILE(fpfault)
clrl %sp@- | stack adjust count
moveml #0xFFFF,%sp@- | save user registers
movl %usp,%a0 | and save
movl %a0,%sp@(FR_SP) |... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | dafc74396473c1c470d833732a82f1be6346ef3d | github | kernel | https://github.com/NetBSD/src/blob/dafc74396473c1c470d833732a82f1be6346ef3d/sys/arch/virt68k/virt68k/locore.s | 321 | 380 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:10 | jbsr _C_LABEL(straytrap) | report
addql #8,%sp | pop args
moveml %sp@+,#0x0303 | restore regs
jra _ASM_LABEL(rei) | all done
ENTRY_NOPROFILE(trap0)
clrl %sp@- | stack adjust count
moveml #0xFFFF,%sp@- | save user registers
movl %usp,%a0 | save the user SP
movl %a0,%sp@(FR_SP) | in the savearea
movl ... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | dafc74396473c1c470d833732a82f1be6346ef3d | github | kernel | https://github.com/NetBSD/src/blob/dafc74396473c1c470d833732a82f1be6346ef3d/sys/arch/virt68k/virt68k/locore.s | 361 | 420 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:12 | | (so debugger can change the stack pointer)
movl %a6,%d1
cmpl #_ASM_LABEL(tmpstk),%d1
jls Lbrkpt2 | already on tmpstk
| Copy frame to the temporary stack
movl %sp,%a0 | a0=src
lea _ASM_LABEL(tmpstk)-96,%a1 | a1=dst
movl %a1,%sp | sp=new frame
movql #FR_SIZE,%d1
Lbrkpt1:
movl %a0@+,%a1@+
subql #4,%d1
j... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | dafc74396473c1c470d833732a82f1be6346ef3d | github | kernel | https://github.com/NetBSD/src/blob/dafc74396473c1c470d833732a82f1be6346ef3d/sys/arch/virt68k/virt68k/locore.s | 441 | 500 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:13 | /* Sun 3 drops into PROM here. */
Lbrkpt3:
| The stack pointer may have been modified, or
| data below it modified (by kgdb push call),
| so push the hardware frame at the current sp
| before restoring registers and returning.
movl %sp@(FR_SP),%a0 | modified sp
lea %sp@(FR_SIZE),%a1 | end of our frame
movl %a1... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | dafc74396473c1c470d833732a82f1be6346ef3d | github | kernel | https://github.com/NetBSD/src/blob/dafc74396473c1c470d833732a82f1be6346ef3d/sys/arch/virt68k/virt68k/locore.s | 481 | 540 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:14 | * After identifying that we need an AST we drop the IPL to allow device
* interrupts.
*
* This code is complicated by the fact that sendsig may have been called
* necessitating a stack cleanup.
*/
ASENTRY_NOPROFILE(rei)
tstl _C_LABEL(astpending) | AST pending?
jeq Ldorte | Nope. Just return.
btst #5,%sp@ | ... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | dafc74396473c1c470d833732a82f1be6346ef3d | github | kernel | https://github.com/NetBSD/src/blob/dafc74396473c1c470d833732a82f1be6346ef3d/sys/arch/virt68k/virt68k/locore.s | 521 | 580 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:15 | rte | and do real RTE
/*
* Primitives
*/
/*
* Use common m68k process/lwp switch and context save subroutines.
*/
#define FPCOPROC /* XXX: Temp. Reqd. */
#include <m68k/m68k/switch_subr.s>
#if defined(M68040) || defined(M68060)
ENTRY(suline)
movl %sp@(4),%a0 | address to write
movl _C_LABEL(curpcb),%a1 | c... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | dafc74396473c1c470d833732a82f1be6346ef3d | github | kernel | https://github.com/NetBSD/src/blob/dafc74396473c1c470d833732a82f1be6346ef3d/sys/arch/virt68k/virt68k/locore.s | 561 | 620 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:3 | addl %a5,ar
#define RELOC(var, ar) _RELOC(_C_LABEL(var), ar)
#define ASRELOC(var, ar) _RELOC(_ASM_LABEL(var), ar)
BSS(esym,4)
.globl _C_LABEL(edata)
.globl _C_LABEL(etext),_C_LABEL(end)
/*
* This is for kvm_mkdb, and should be the address of the beginning
* of the kernel text segment (not necessarily the same ... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | ab5a968c9363a9f91a0b33e6164748e9b17903c1 | github | kernel | https://github.com/NetBSD/src/blob/ab5a968c9363a9f91a0b33e6164748e9b17903c1/sys/arch/virt68k/virt68k/locore.s | 81 | 140 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:4 | RELOC(edata,%a0) | clear out BSS
movl #_C_LABEL(end) - 4, %d0 | (must be <= 256 kB)
subl #_C_LABEL(edata), %d0
lsrl #2,%d0
1: clrl %a0@+
dbra %d0,1b
/* XXX XXX XXX */
movl #CACHE_OFF,%d0
movc %d0,%cacr | clear and disable on-chip cache(s)
/* XXX XXX XXX */
/*
* Qemu does not pass us the symbols, so leave... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | ab5a968c9363a9f91a0b33e6164748e9b17903c1 | github | kernel | https://github.com/NetBSD/src/blob/ab5a968c9363a9f91a0b33e6164748e9b17903c1/sys/arch/virt68k/virt68k/locore.s | 121 | 180 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:5 | * after the MMU is enabled.
*/
movl %d0, %d7
/* NOTE: %d7 is now off-limits!! */
/*
* Enable the MMU.
* Since the kernel is mapped logical == physical, we just turn it on.
*/
RELOC(Sysseg_pa, %a0) | system segment table addr
movl %a0@,%d1 | read value (a PA)
#if defined(M68040) || defined(M68060)
RELOC(mm... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | ab5a968c9363a9f91a0b33e6164748e9b17903c1 | github | kernel | https://github.com/NetBSD/src/blob/ab5a968c9363a9f91a0b33e6164748e9b17903c1/sys/arch/virt68k/virt68k/locore.s | 161 | 220 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:6 | movc %d0,%cacr | turn on both caches
jmp Lmmuenabled
Lnot040mmu:
#endif /* M68040 || M68060 */
#if defined(M68020) || defined(M68030)
RELOC(protorp, %a0)
movl %d1,%a0@(4) | segtable address
pmove %a0@,%srp | load the supervisor root pointer
#ifdef M68030
RELOC(mmutype, %a0)
cmpl #MMU_68030,%a0@ | 68030?
jne... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | ab5a968c9363a9f91a0b33e6164748e9b17903c1 | github | kernel | https://github.com/NetBSD/src/blob/ab5a968c9363a9f91a0b33e6164748e9b17903c1/sys/arch/virt68k/virt68k/locore.s | 201 | 260 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:7 | clrl %a0@(PCB_FPCTX) | ensure null FP context
pea %a0@(PCB_FPCTX)
jbsr _C_LABEL(m68881_restore) | restore it (does not kill %a0)
addql #4,%sp
Lenab2:
cmpl #MMU_68040,_C_LABEL(mmutype) | 68040?
jeq Ltbia040 | yes, cache already on
pflusha
movl #CACHE_ON,%d0
movc %d0,%cacr | clear cache(s)
jra Lenab3
Ltbia040... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | ab5a968c9363a9f91a0b33e6164748e9b17903c1 | github | kernel | https://github.com/NetBSD/src/blob/ab5a968c9363a9f91a0b33e6164748e9b17903c1/sys/arch/virt68k/virt68k/locore.s | 241 | 300 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:8 | */
#include <m68k/m68k/busaddrerr.s>
/*
* FP exceptions.
*/
ENTRY_NOPROFILE(fpfline)
#if defined(M68040)
cmpl #FPU_68040,_C_LABEL(fputype) | 68040 FPU?
jne Lfp_unimp | no, skip FPSP
cmpw #0x202c,%sp@(6) | format type 2?
jne _C_LABEL(illinst) | no, not an FP emulation
#ifdef FPSP
jmp _ASM_LABEL(fpsp_unimp) | y... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | ab5a968c9363a9f91a0b33e6164748e9b17903c1 | github | kernel | https://github.com/NetBSD/src/blob/ab5a968c9363a9f91a0b33e6164748e9b17903c1/sys/arch/virt68k/virt68k/locore.s | 281 | 340 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:9 | /*
* Handles all other FP coprocessor exceptions.
* Note that since some FP exceptions generate mid-instruction frames
* and may cause signal delivery, we need to test for stack adjustment
* after the trap call.
*/
ENTRY_NOPROFILE(fpfault)
clrl %sp@- | stack adjust count
moveml #0xFFFF,%sp@- | save user registe... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | ab5a968c9363a9f91a0b33e6164748e9b17903c1 | github | kernel | https://github.com/NetBSD/src/blob/ab5a968c9363a9f91a0b33e6164748e9b17903c1/sys/arch/virt68k/virt68k/locore.s | 321 | 380 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:10 | clrw %sp@-
movl %sp@(22),%sp@- | and PC
jbsr _C_LABEL(straytrap) | report
addql #8,%sp | pop args
moveml %sp@+,#0x0303 | restore regs
jra _ASM_LABEL(rei) | all done
ENTRY_NOPROFILE(trap0)
clrl %sp@- | stack adjust count
moveml #0xFFFF,%sp@- | save user registers
movl %usp,%a0 | save the user SP
movl ... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | ab5a968c9363a9f91a0b33e6164748e9b17903c1 | github | kernel | https://github.com/NetBSD/src/blob/ab5a968c9363a9f91a0b33e6164748e9b17903c1/sys/arch/virt68k/virt68k/locore.s | 361 | 420 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:11 | * User mode traps are simply passed on to trap().
*/
ENTRY_NOPROFILE(trace)
clrl %sp@- | stack adjust count
moveml #0xFFFF,%sp@-
moveq #T_TRACE,%d0
| Check PSW and see what happen.
| T=0 S=0 (should not happen)
| T=1 S=0 trace trap from user mode
| T=0 S=1 trace trap on a trap instruction
| T=1 S=1 ... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | ab5a968c9363a9f91a0b33e6164748e9b17903c1 | github | kernel | https://github.com/NetBSD/src/blob/ab5a968c9363a9f91a0b33e6164748e9b17903c1/sys/arch/virt68k/virt68k/locore.s | 401 | 460 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:12 | | If were are not on tmpstk switch to it.
| (so debugger can change the stack pointer)
movl %a6,%d1
cmpl #_ASM_LABEL(tmpstk),%d1
jls Lbrkpt2 | already on tmpstk
| Copy frame to the temporary stack
movl %sp,%a0 | a0=src
lea _ASM_LABEL(tmpstk)-96,%a1 | a1=dst
movl %a1,%sp | sp=new frame
movql #FR_SIZE,%d1
... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | ab5a968c9363a9f91a0b33e6164748e9b17903c1 | github | kernel | https://github.com/NetBSD/src/blob/ab5a968c9363a9f91a0b33e6164748e9b17903c1/sys/arch/virt68k/virt68k/locore.s | 441 | 500 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:13 | addql #8,%sp | pop args
#endif
/* Sun 3 drops into PROM here. */
Lbrkpt3:
| The stack pointer may have been modified, or
| data below it modified (by kgdb push call),
| so push the hardware frame at the current sp
| before restoring registers and returning.
movl %sp@(FR_SP),%a0 | modified sp
lea %sp@(FR_SIZE... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | ab5a968c9363a9f91a0b33e6164748e9b17903c1 | github | kernel | https://github.com/NetBSD/src/blob/ab5a968c9363a9f91a0b33e6164748e9b17903c1/sys/arch/virt68k/virt68k/locore.s | 481 | 540 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:14 | * This code deals with checking for and servicing ASTs
* (profiling, scheduling).
* After identifying that we need an AST we drop the IPL to allow device
* interrupts.
*
* This code is complicated by the fact that sendsig may have been called
* necessitating a stack cleanup.
*/
ASENTRY_NOPROFILE(rei)
tstl _C_LA... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | ab5a968c9363a9f91a0b33e6164748e9b17903c1 | github | kernel | https://github.com/NetBSD/src/blob/ab5a968c9363a9f91a0b33e6164748e9b17903c1/sys/arch/virt68k/virt68k/locore.s | 521 | 580 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:15 | moveml %sp@+,#0x7FFF | restore user registers
movl %sp@,%sp | and our SP
rte | and do real RTE
/*
* Primitives
*/
/*
* Use common m68k process/lwp switch and context save subroutines.
*/
#define FPCOPROC /* XXX: Temp. Reqd. */
#include <m68k/m68k/switch_subr.s>
#if defined(M68040) || defined(M68060)
ENTRY... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | ab5a968c9363a9f91a0b33e6164748e9b17903c1 | github | kernel | https://github.com/NetBSD/src/blob/ab5a968c9363a9f91a0b33e6164748e9b17903c1/sys/arch/virt68k/virt68k/locore.s | 561 | 620 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:16 | #endif
ENTRY(ecacheon)
rts
ENTRY(ecacheoff)
rts
ENTRY(paravirt_membar_sync)
/*
* Store-before-load ordering with respect to matching logic
* on the hypervisor side.
*
* This is the same as membar_sync, but guaranteed never to be
* conditionalized or hotpatched away even on uniprocessor
* builds and b... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | ab5a968c9363a9f91a0b33e6164748e9b17903c1 | github | kernel | https://github.com/NetBSD/src/blob/ab5a968c9363a9f91a0b33e6164748e9b17903c1/sys/arch/virt68k/virt68k/locore.s | 601 | 643 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:4 | RELOC(edata,%a0) | clear out BSS
movl #_C_LABEL(end) - 4, %d0 | (must be <= 256 kB)
subl #_C_LABEL(edata), %d0
lsrl #2,%d0
1: clrl %a0@+
dbra %d0,1b
/* XXX XXX XXX */
movl #CACHE_OFF,%d0
movc %d0,%cacr | clear and disable on-chip cache(s)
/* XXX XXX XXX */
/*
* Qemu does not pass us the symbols, so leave... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 35a723947b61a9ad3992b2bb21e7a65ca8aa5046 | github | kernel | https://github.com/NetBSD/src/blob/35a723947b61a9ad3992b2bb21e7a65ca8aa5046/sys/arch/virt68k/virt68k/locore.s | 121 | 180 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:5 | * after the MMU is enabled.
*/
movl %d0, %d7
/* NOTE: %d7 is now off-limits!! */
/* initialize source/destination control registers for movs */
moveq #FC_USERD,%d0 | user space
movc %d0,%sfc | as source
movc %d0,%dfc | and destination of transfers
/*
* Enable the MMU.
* Since the kernel is mapped log... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 35a723947b61a9ad3992b2bb21e7a65ca8aa5046 | github | kernel | https://github.com/NetBSD/src/blob/35a723947b61a9ad3992b2bb21e7a65ca8aa5046/sys/arch/virt68k/virt68k/locore.s | 161 | 220 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:6 | movc %d0,%cacr | enable store buffer, both caches
jmp Lmmuenabled
Lnot060cache:
#endif
movl #0x80008000,%d0
movc %d0,%cacr | turn on both caches
jmp Lmmuenabled
Lnot040mmu:
#endif /* M68040 || M68060 */
#if defined(M68020) || defined(M68030)
RELOC(protorp, %a0)
movl %d1,%a0@(4) | segtable address
pmove %a0@,... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 35a723947b61a9ad3992b2bb21e7a65ca8aa5046 | github | kernel | https://github.com/NetBSD/src/blob/35a723947b61a9ad3992b2bb21e7a65ca8aa5046/sys/arch/virt68k/virt68k/locore.s | 201 | 260 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:7 | movl #USRSTACK-4,%a2
movl %a2,%usp | init user SP
tstl _C_LABEL(fputype) | Have an FPU?
jeq Lenab2 | No, skip.
clrl %a0@(PCB_FPCTX) | ensure null FP context
pea %a0@(PCB_FPCTX)
jbsr _C_LABEL(m68881_restore) | restore it (does not kill %a0)
addql #4,%sp
Lenab2:
cmpl #MMU_68040,_C_LABEL(mmutype) | 68040?
je... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 35a723947b61a9ad3992b2bb21e7a65ca8aa5046 | github | kernel | https://github.com/NetBSD/src/blob/35a723947b61a9ad3992b2bb21e7a65ca8aa5046/sys/arch/virt68k/virt68k/locore.s | 241 | 300 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:8 | */
#include <m68k/m68k/trap_subr.s>
/*
* Use common m68k bus error and address error handlers.
*/
#include <m68k/m68k/busaddrerr.s>
/*
* FP exceptions.
*/
ENTRY_NOPROFILE(fpfline)
#if defined(M68040)
cmpl #FPU_68040,_C_LABEL(fputype) | 68040 FPU?
jne Lfp_unimp | no, skip FPSP
cmpw #0x202c,%sp@(6) | format ty... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 35a723947b61a9ad3992b2bb21e7a65ca8aa5046 | github | kernel | https://github.com/NetBSD/src/blob/35a723947b61a9ad3992b2bb21e7a65ca8aa5046/sys/arch/virt68k/virt68k/locore.s | 281 | 340 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:9 | #endif
Lfp_unsupp:
#endif /* M68040 */
jra _C_LABEL(illinst)
/*
* Handles all other FP coprocessor exceptions.
* Note that since some FP exceptions generate mid-instruction frames
* and may cause signal delivery, we need to test for stack adjustment
* after the trap call.
*/
ENTRY_NOPROFILE(fpfault)
clrl %sp@- ... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 35a723947b61a9ad3992b2bb21e7a65ca8aa5046 | github | kernel | https://github.com/NetBSD/src/blob/35a723947b61a9ad3992b2bb21e7a65ca8aa5046/sys/arch/virt68k/virt68k/locore.s | 321 | 380 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:10 | */
ENTRY_NOPROFILE(badtrap)
moveml #0xC0C0,%sp@- | save scratch regs
movw %sp@(22),%sp@- | push exception vector info
clrw %sp@-
movl %sp@(22),%sp@- | and PC
jbsr _C_LABEL(straytrap) | report
addql #8,%sp | pop args
moveml %sp@+,#0x0303 | restore regs
jra _ASM_LABEL(rei) | all done
ENTRY_NOPROFILE(trap... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 35a723947b61a9ad3992b2bb21e7a65ca8aa5046 | github | kernel | https://github.com/NetBSD/src/blob/35a723947b61a9ad3992b2bb21e7a65ca8aa5046/sys/arch/virt68k/virt68k/locore.s | 361 | 420 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:11 | lea %sp@(16),%sp | pop args
jra _ASM_LABEL(rei) | all done
/*
* Trace (single-step) trap. Kernel-mode is special.
* User mode traps are simply passed on to trap().
*/
ENTRY_NOPROFILE(trace)
clrl %sp@- | stack adjust count
moveml #0xFFFF,%sp@-
moveq #T_TRACE,%d0
| Check PSW and see what happen.
| T=0 S... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 35a723947b61a9ad3992b2bb21e7a65ca8aa5046 | github | kernel | https://github.com/NetBSD/src/blob/35a723947b61a9ad3992b2bb21e7a65ca8aa5046/sys/arch/virt68k/virt68k/locore.s | 401 | 460 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:12 | Lkbrkpt: | Kernel-mode breakpoint or trace trap. (d0=trap_type)
| Save the system sp rather than the user sp.
movw #PSL_HIGHIPL,%sr | lock out interrupts
lea %sp@(FR_SIZE),%a6 | Save stack pointer
movl %a6,%sp@(FR_SP) | from before trap
| If were are not on tmpstk switch to it.
| (so debugger can change the st... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 35a723947b61a9ad3992b2bb21e7a65ca8aa5046 | github | kernel | https://github.com/NetBSD/src/blob/35a723947b61a9ad3992b2bb21e7a65ca8aa5046/sys/arch/virt68k/virt68k/locore.s | 441 | 500 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:13 | #ifdef DDB
| Let DDB handle it
movl %a2,%sp@- | push frame ptr
movl %d2,%sp@- | push trap type
jbsr _C_LABEL(kdb_trap) | handle the trap
addql #8,%sp | pop args
#endif
/* Sun 3 drops into PROM here. */
Lbrkpt3:
| The stack pointer may have been modified, or
| data below it modified (by kgdb push call),
| s... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 35a723947b61a9ad3992b2bb21e7a65ca8aa5046 | github | kernel | https://github.com/NetBSD/src/blob/35a723947b61a9ad3992b2bb21e7a65ca8aa5046/sys/arch/virt68k/virt68k/locore.s | 481 | 540 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:14 | /* FALLTHROUGH to rei */
/*
* Emulation of VAX REI instruction.
*
* This code deals with checking for and servicing ASTs
* (profiling, scheduling).
* After identifying that we need an AST we drop the IPL to allow device
* interrupts.
*
* This code is complicated by the fact that sendsig may have been called
*... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 35a723947b61a9ad3992b2bb21e7a65ca8aa5046 | github | kernel | https://github.com/NetBSD/src/blob/35a723947b61a9ad3992b2bb21e7a65ca8aa5046/sys/arch/virt68k/virt68k/locore.s | 521 | 580 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:15 | movl %a1,%a0 | source
addw %d0,%a0 | + hole size = dest pointer
movl %a1@-,%a0@- | copy
movl %a1@-,%a0@- | 8 bytes
movl %a0,%sp@(FR_SP) | new SSP
moveml %sp@+,#0x7FFF | restore user registers
movl %sp@,%sp | and our SP
rte | and do real RTE
/*
* Primitives
*/
/*
* Use common m68k process/lwp s... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 35a723947b61a9ad3992b2bb21e7a65ca8aa5046 | github | kernel | https://github.com/NetBSD/src/blob/35a723947b61a9ad3992b2bb21e7a65ca8aa5046/sys/arch/virt68k/virt68k/locore.s | 561 | 620 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:16 | moveq #-1,%d0
Lsldone:
movl _C_LABEL(curpcb),%a1 | current pcb
clrl %a1@(PCB_ONFAULT) | clear fault address
rts
#endif
ENTRY(ecacheon)
rts
ENTRY(ecacheoff)
rts
ENTRY(paravirt_membar_sync)
/*
* Store-before-load ordering with respect to matching logic
* on the hypervisor side.
*
* This is the same as m... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 35a723947b61a9ad3992b2bb21e7a65ca8aa5046 | github | kernel | https://github.com/NetBSD/src/blob/35a723947b61a9ad3992b2bb21e7a65ca8aa5046/sys/arch/virt68k/virt68k/locore.s | 601 | 648 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:6 | movc %d0,%cacr | enable store buffer, both caches
jmp Lmmuenabled
Lnot060cache:
#endif
movl #0x80008000,%d0
movc %d0,%cacr | turn on both caches
jmp Lmmuenabled
Lnot040mmu:
#endif /* M68040 || M68060 */
#if defined(M68020) || defined(M68030)
RELOC(protorp, %a0)
movl %d1,%a0@(4) | segtable address
pmove %a0@,... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 12f7cdbe981c42e2e00de6e44cdba36045b2e9aa | github | kernel | https://github.com/NetBSD/src/blob/12f7cdbe981c42e2e00de6e44cdba36045b2e9aa/sys/arch/virt68k/virt68k/locore.s | 201 | 260 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:7 | /* phase 2 of pmap setup, returns pointer to lwp0 uarea in %a0 */
jbsr _C_LABEL(pmap_bootstrap2)
/* set kernel stack, user SP */
lea %a0@(USPACE-4),%sp | set kernel stack to end of area
movl #USRSTACK-4,%a2
movl %a2,%usp | init user SP
tstl _C_LABEL(fputype) | Have an FPU?
jeq Lenab2 | No, skip.
clrl %a0@(PCB... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 12f7cdbe981c42e2e00de6e44cdba36045b2e9aa | github | kernel | https://github.com/NetBSD/src/blob/12f7cdbe981c42e2e00de6e44cdba36045b2e9aa/sys/arch/virt68k/virt68k/locore.s | 241 | 300 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:8 | clrl %sp@- | stack adjust count and padding
lea %sp@(-64),%sp | construct space for D0-D7/A0-A7
lea _C_LABEL(lwp0),%a0 | save pointer to frame
movl %sp,%a0@(L_MD_REGS) | in lwp0.l_md.md_regs
jra _C_LABEL(main) | main()
/*
* Trap/interrupt vector routines
*/
#include <m68k/m68k/trap_subr.s>
/*
* Use comm... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 12f7cdbe981c42e2e00de6e44cdba36045b2e9aa | github | kernel | https://github.com/NetBSD/src/blob/12f7cdbe981c42e2e00de6e44cdba36045b2e9aa/sys/arch/virt68k/virt68k/locore.s | 281 | 340 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:9 | cmpl #FPU_68040,_C_LABEL(fputype) | 68040 FPU?
jne Lfp_unsupp | No, skip FPSP
#ifdef FPSP
jmp _ASM_LABEL(fpsp_unsupp) | yes, go handle it
#else
clrl %sp@- | stack adjust count
moveml #0xFFFF,%sp@- | save registers
moveq #T_FPEMULD,%d0 | denote as FP emulation trap
jra _ASM_LABEL(fault) | do it
#endif
Lfp_uns... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 12f7cdbe981c42e2e00de6e44cdba36045b2e9aa | github | kernel | https://github.com/NetBSD/src/blob/12f7cdbe981c42e2e00de6e44cdba36045b2e9aa/sys/arch/virt68k/virt68k/locore.s | 321 | 380 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:10 | fmovem %fpsr,%sp@- | push fpsr as code argument
frestore %a0@ | restore state
movl #T_FPERR,%sp@- | push type arg
jra _ASM_LABEL(faultstkadj) | call trap and deal with stack cleanup
/*
* Other exceptions only cause four and six word stack frame and require
* no post-trap stack adjustment.
*/
ENTRY_NOPROFILE(b... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 12f7cdbe981c42e2e00de6e44cdba36045b2e9aa | github | kernel | https://github.com/NetBSD/src/blob/12f7cdbe981c42e2e00de6e44cdba36045b2e9aa/sys/arch/virt68k/virt68k/locore.s | 361 | 420 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:11 | * command in d0, addr in a1, length in d1
*/
ENTRY_NOPROFILE(trap12)
movl _C_LABEL(curlwp),%a0
movl %a0@(L_PROC),%sp@- | push current proc pointer
movl %d1,%sp@- | push length
movl %a1,%sp@- | push addr
movl %d0,%sp@- | push command
jbsr _C_LABEL(cachectl1) | do it
lea %sp@(16),%sp | pop args
jra _ASM_LABE... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 12f7cdbe981c42e2e00de6e44cdba36045b2e9aa | github | kernel | https://github.com/NetBSD/src/blob/12f7cdbe981c42e2e00de6e44cdba36045b2e9aa/sys/arch/virt68k/virt68k/locore.s | 401 | 460 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:12 | ENTRY_NOPROFILE(trap15)
clrl %sp@- | stack adjust count
moveml #0xFFFF,%sp@-
moveq #T_TRAP15,%d0
movw %sp@(FR_HW),%d1 | get PSW
andw #PSL_S,%d1 | from system mode?
jne Lkbrkpt | yes, kernel breakpoint
jra _ASM_LABEL(fault) | no, user-mode fault
Lkbrkpt: | Kernel-mode breakpoint or trace trap. (d0=trap_typ... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 12f7cdbe981c42e2e00de6e44cdba36045b2e9aa | github | kernel | https://github.com/NetBSD/src/blob/12f7cdbe981c42e2e00de6e44cdba36045b2e9aa/sys/arch/virt68k/virt68k/locore.s | 441 | 500 |
NetBSD/src:sys/arch/virt68k/virt68k/locore.s:13 | #ifdef KGDB
| Let KGDB handle it (if connected)
movl %a2,%sp@- | push frame ptr
movl %d2,%sp@- | push trap type
jbsr _C_LABEL(kgdb_trap) | handle the trap
addql #8,%sp | pop args
cmpl #0,%d0 | did kgdb handle it?
jne Lbrkpt3 | yes, done
#endif
#ifdef DDB
| Let DDB handle it
movl %a2,%sp@- | push frame... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/virt68k/virt68k/locore.s | BSD-2-Clause | 12f7cdbe981c42e2e00de6e44cdba36045b2e9aa | github | kernel | https://github.com/NetBSD/src/blob/12f7cdbe981c42e2e00de6e44cdba36045b2e9aa/sys/arch/virt68k/virt68k/locore.s | 481 | 540 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.