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/sh3/sh3/locore_subr.S:17 | /*
* LINTSTUB: Func: int copyinstr(const void *usrc, void *kdst, size_t maxlen, size_t *lencopied)
* Copy a NUL-terminated string, at most maxlen characters long,
* from the user address space. Return the number of characters
* copied (including the NUL) in *lencopied. If the string is
* too long, return ENAMETO... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/sh3/sh3/locore_subr.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sh3/sh3/locore_subr.S | 641 | 700 |
NetBSD/src:sys/arch/sh3/sh3/locore_subr.S:18 | add #-1, r0
cmp/eq #-1, r0
bf 1b
cmp/hi r3, r4
bf 6f
mov #0, r0
3:
tst r7, r7 /* set lencopied if needed */
bt 4f
mov r4, r1
sub r8, r1
mov.l r1, @r7
4:
mov.l .L_copyinstr_curpcb, r1 /* clear fault handler */
mov.l @r1, r2
mov #0, r1
mov.l r1, @(PCB_ONFAULT,r2)
rts
mov.l @r15+, r8
5:
bra 4b
mov... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/sh3/sh3/locore_subr.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sh3/sh3/locore_subr.S | 681 | 740 |
NetBSD/src:sys/arch/sh3/sh3/locore_subr.S:19 | /**************************************************************************/
#define UFETCHSTORE_PROLOGUE(func) \
mov.l .L ## func ## _VM_MAXUSER_ADDRESS, r1 ;\
cmp/hi r1, r4 /* bomb if uaddr isn't in user space */ ;\
bt/s 2f ;\
mov #EFAULT,r0 ;\
mov.l .L ## func ## _curpcb, r1 ;\
mov.l @r1... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/sh3/sh3/locore_subr.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sh3/sh3/locore_subr.S | 721 | 780 |
NetBSD/src:sys/arch/sh3/sh3/locore_subr.S:20 | ENTRY(_ufetch_16)
UFETCHSTORE_PROLOGUE(_ufetch_16)
mov.w @r4, r1 /* r1 = *uaddr */
mov.w r1 @r5 /* *valp = r1 */
UFETCHSTORE_EPILOGUE(_ufetch_16)
SET_ENTRY_SIZE(_ufetch_16)
/* LINTSTUB: int _ufetch_32(const uint32_t *uaddr, uint32_t *valp); */
ENTRY(_ufetch_32)
UFETCHSTORE_PROLOGUE(_ufetch_32)
mov.l @r4, r1 /* ... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/sh3/sh3/locore_subr.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sh3/sh3/locore_subr.S | 761 | 820 |
NetBSD/src:sys/arch/sh3/sh3/locore_subr.S:21 | */
ENTRY(kcopy)
mov.l r8, @-r15
mov.l r14, @-r15
sts.l pr, @-r15
mov r15, r14
mov r4, r3
mov.l .L_kcopy_curpcb, r1
mov.l @r1, r2
mov.l @(PCB_ONFAULT,r2) ,r8 /* save old fault handler */
mov.l .L_kcopy_onfault, r1
mov.l r1, @(PCB_ONFAULT,r2) /* set fault handler */
mov.l .L_kcopy_memcpy, r1
mov r5, r4
jsr ... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/sh3/sh3/locore_subr.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sh3/sh3/locore_subr.S | 801 | 860 |
NetBSD/src:sys/arch/sh3/sh3/locore_subr.S:22 | /*
* LINTSTUB: Func: int setjmp(label_t *jmpbuf)
*/
ENTRY(setjmp)
add #4*9, r4
mov.l r8, @-r4
mov.l r9, @-r4
mov.l r10, @-r4
mov.l r11, @-r4
mov.l r12, @-r4
mov.l r13, @-r4
mov.l r14, @-r4
mov.l r15, @-r4
sts.l pr, @-r4
rts
xor r0, r0
SET_ENTRY_SIZE(setjmp)
/*
* LINTSTUB: Func: void longjmp(label_t *j... | x86_64 | gas-like | handwritten | NetBSD/src | sys/arch/sh3/sh3/locore_subr.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sh3/sh3/locore_subr.S | 841 | 877 |
NetBSD/src:sys/arch/sh3/sh3/sh_ipl.S:1 | /* $NetBSD: sh_ipl.S,v 1.2 2025/11/17 21:53:12 uwe Exp $ */
/*
* Copyright (c) 2025 Valery Ushakov
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must... | arm64 | gas-like | handwritten | NetBSD/src | sys/arch/sh3/sh3/sh_ipl.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sh3/sh3/sh_ipl.S | 1 | 60 |
NetBSD/src:sys/arch/sh3/sh3/sh_ipl.S:2 | */
NENTRY(sh_ipl_get_config)
bra sh_ipl_bios_call
mov #SH_IPL_GET_CONFIG, r0
SET_ENTRY_SIZE(sh_ipl_get_config)
/**
* LINTSTUB: Func: int sh_ipl_get_ram_size(void);
*/
NENTRY(sh_ipl_get_ram_size)
bra sh_ipl_bios_call
mov #SH_IPL_GET_RAM_SIZE, r0
SET_ENTRY_SIZE(sh_ipl_write)
/**
* LINTSTUB: Func: void sh_ipl... | arm64 | gas-like | handwritten | NetBSD/src | sys/arch/sh3/sh3/sh_ipl.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sh3/sh3/sh_ipl.S | 41 | 77 |
NetBSD/src:sys/arch/sh3/sh3/sh_ipl.S:1 | /* $NetBSD: sh_ipl.S,v 1.1 2025/11/17 19:09:58 uwe Exp $ */
/*
* Copyright (c) 2025 Valery Ushakov
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must... | arm64 | gas-like | handwritten | NetBSD/src | sys/arch/sh3/sh3/sh_ipl.S | BSD-2-Clause | 2abd9d37a8d65272ed5e2b638ba86add437947e7 | github | kernel | https://github.com/NetBSD/src/blob/2abd9d37a8d65272ed5e2b638ba86add437947e7/sys/arch/sh3/sh3/sh_ipl.S | 1 | 60 |
NetBSD/src:sys/arch/sh3/sh3/sh_ipl.S:2 | */
NENTRY(sh_ipl_get_config)
bra .L_sh_ipl_bios_call
mov #SH_IPL_GET_CONFIG, r0
SET_ENTRY_SIZE(sh_ipl_get_config)
/**
* LINTSTUB: Func: int sh_ipl_get_ram_size(void);
*/
NENTRY(sh_ipl_get_ram_size)
bra .L_sh_ipl_bios_call
mov #SH_IPL_GET_RAM_SIZE, r0
SET_ENTRY_SIZE(sh_ipl_write)
/**
* LINTSTUB: Func: void ... | arm64 | gas-like | handwritten | NetBSD/src | sys/arch/sh3/sh3/sh_ipl.S | BSD-2-Clause | 2abd9d37a8d65272ed5e2b638ba86add437947e7 | github | kernel | https://github.com/NetBSD/src/blob/2abd9d37a8d65272ed5e2b638ba86add437947e7/sys/arch/sh3/sh3/sh_ipl.S | 41 | 75 |
NetBSD/src:sys/arch/shark/isa/isa_io_asm.S:8 | ldrb r3, [r1], #1
strb r3, [r0], #1
subs r2, r2, #1
bne Lisa_wr_1_loop
mov pc, lr
ENTRY(isa_bs_wr_2)
add r0, r1, r2
mov r1, r3
ldr r2, [sp, #0]
teq r2, #0
moveq pc, lr
Lisa_wr_2_loop:
ldrh r3, [r1], #2 /*.word 0xe0d130b2*/
strh r3, [r0], #2
subs r2, r2, #1
bne Lisa_wr_2_loop
mov pc, lr
ENTRY(isa_bs_w... | arm64 | gas-like | handwritten | NetBSD/src | sys/arch/shark/isa/isa_io_asm.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/shark/isa/isa_io_asm.S | 281 | 340 |
NetBSD/src:sys/arch/shark/isa/isa_io_asm.S:9 | ENTRY(isa_bs_sr_2)
add r0, r1, r2
mov r1, r3
ldr r2, [sp, #0]
teq r2, #0
moveq pc, lr
Lisa_bs_sr_2_loop:
strh r1, [r0], #2 /*.word e0c010b2*/
subs r2, r2, #1
bne Lisa_bs_sr_2_loop
mov pc, lr
/*
* Copy region
*/
ENTRY(isa_bs_c_2)
add r0, r1, r2
ldr r2, [sp, #0]
add r1, r2, r3
ldr r2, [sp, #4]
teq r2... | arm64 | gas-like | handwritten | NetBSD/src | sys/arch/shark/isa/isa_io_asm.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/shark/isa/isa_io_asm.S | 321 | 368 |
NetBSD/src:sys/arch/shark/isa/isa_irq.S:3 | #include <dev/isa/isareg.h>
#include <shark/isa/icu.h>
#include <machine/irqhandler.h>
.text
.align 0
/*
*
* irq_entry
*
* Main entry point for the IRQ vector
*
* This function reads the irq request bits in the IOMD registers
* IRQRQA, IRQRQB and DMARQ
* It then calls an installed handler for each bit that ... | arm64 | gas-like | handwritten | NetBSD/src | sys/arch/shark/isa/isa_irq.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/shark/isa/isa_irq.S | 81 | 140 |
NetBSD/src:sys/arch/shark/isa/isa_irq.S:4 | */
/* Some documentation is in isa_machdep.c */
ASENTRY_NP(irq_entry)
sub lr, lr, #0x00000004 /* Adjust the lr */
PUSHFRAMEINSVC /* Push an interrupt frame */
ENABLE_ALIGNMENT_FAULTS /* puts cur{cpu,lwp} in r4/r5 */
/* Load r8 with the ISA 8259 irqs */
/* r8 <- irq's pending [15:0] */
/* address of 8259 #1... | arm64 | gas-like | handwritten | NetBSD/src | sys/arch/shark/isa/isa_irq.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/shark/isa/isa_irq.S | 121 | 180 |
NetBSD/src:sys/arch/shark/isa/isa_irq.S:5 | ldr r1, [r4, #CI_INTR_DEPTH]
add r1, r1, #1
str r1, [r4, #CI_INTR_DEPTH]
/* Block the current requested interrupts */
ldr r1, .Ldisabled_mask
ldr r0, [r1]
stmfd sp!, {r0}
orr r0, r0, r8
/*
* Need to block all interrupts at the IPL or lower for
* all asserted interrupts.
* This basically emulates hardw... | arm64 | gas-like | handwritten | NetBSD/src | sys/arch/shark/isa/isa_irq.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/shark/isa/isa_irq.S | 161 | 220 |
NetBSD/src:sys/arch/shark/isa/isa_irq.S:6 | ldr r1, [r4, #CI_CPL]
str r9, [r4, #CI_CPL]
stmfd sp!, {r1}
/* Update the IOMD irq masks */
bl _C_LABEL(irq_setmasks)
mrs r0, cpsr /* Enable IRQ's */
bic r0, r0, #I32_bit
msr cpsr_all, r0
ldr r7, .Lirqhandlers
mov r9, #0x00000001
irqloop:
/* This would benefit from a special ffs type routine */
tst ... | arm64 | gas-like | handwritten | NetBSD/src | sys/arch/shark/isa/isa_irq.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/shark/isa/isa_irq.S | 201 | 260 |
NetBSD/src:sys/arch/shark/isa/isa_irq.S:7 | teq r0, #0x00000001 /* Was the irq serviced ? */
beq irqdone
ldr r6, [r6, #(IH_NEXT)]
teq r6, #0x00000000
bne irqchainloop
b nextirq
irqdone:
add r3, r6, #IH_EV_COUNT /* get address of ih's ev_count */
ldmia r3, {r1-r2} /* load ev_count */
adds r1, r1, #0x00000001 /* 64bit incr (lo) */
adc r2, r2, #0... | arm64 | gas-like | handwritten | NetBSD/src | sys/arch/shark/isa/isa_irq.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/shark/isa/isa_irq.S | 241 | 300 |
NetBSD/src:sys/arch/shark/isa/isa_irq.S:8 | LOCK_CAS_CHECK
DO_AST_AND_RESTORE_ALIGNMENT_FAULTS
PULLFRAMEFROMSVCANDEXIT
/* NOT REACHED */
b . - 8
.Lcurrent_mask:
.word _C_LABEL(current_mask) /* irq's that are usable */
.Lcpu_info_store:
.word _C_LABEL(cpu_info_store)
LOCK_CAS_CHECK_LOCALS
AST_ALIGNMENT_FAULT_LOCALS
ENTRY(irq_setmasks)
/* Disable in... | arm64 | gas-like | handwritten | NetBSD/src | sys/arch/shark/isa/isa_irq.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/shark/isa/isa_irq.S | 281 | 340 |
NetBSD/src:sys/arch/shark/isa/isa_irq.S:9 | possible to avoid them */
/* get current mask: these are the bits */
ldr r0, .Li8259_mask
ldr r2, [r0]
/* r2 = 0000.0000.0000.0000.ZZZZ.ZZZZ.ZZZZ.ZZZZ */
/* see if there's anything enabled on 8259 #2 */
tst r1, #0xff00
biceq r1, r1, #(1 << IRQ_SLAVE) /* no, so disable it */
orrne r1, r1, #(1 << IRQ_... | arm64 | gas-like | handwritten | NetBSD/src | sys/arch/shark/isa/isa_irq.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/shark/isa/isa_irq.S | 321 | 380 |
NetBSD/src:sys/arch/shark/isa/isa_irq.S:10 | ldr r0, [r0]
/* see if there's any change for 8259 #1 (master) */
tst r2, #0x00FF /* bottom 8 bits different? */
strbne r1, [r0, #(IO_ICU1 + 1)] /* icu1 / ocw1 */
/* anything for 8259 #2? */
tst r2, #0xFF00
mov r1, r1, lsr #8 /* next byte */
strbne r1, [r0, #(IO_ICU2 + 1)] /* icu2 / ... | arm64 | gas-like | handwritten | NetBSD/src | sys/arch/shark/isa/isa_irq.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/shark/isa/isa_irq.S | 361 | 380 |
NetBSD/src:sys/arch/shark/shark/shark_fiq.S:2 | * Created : 19/05/97
*/
#include <machine/asm.h>
#include <machine/cpu.h>
#include <shark/shark/shark_fiq.h>
#include <shark/shark/sequoia.h>
.text
/* this variable is used to detect when it is necessary to unwedge the
sequoia SMI/PMI edge detect logic. *sigh* */
Lfiqs_happened:
.word _C_LABEL(fiqs_happe... | arm64 | gas-like | handwritten | NetBSD/src | sys/arch/shark/shark/shark_fiq.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/shark/shark/shark_fiq.S | 41 | 100 |
NetBSD/src:sys/arch/shark/shark/shark_fiq.S:3 | the sequoia bit clear must be done. do it in that order so
the sequoia port accesses will clear the chip enable caused
by accessing FIQ_CLEAR_IOPORT
*/
/* set up to read/write the power management status register */
ldr r11, Lsequoia_index_cache
ldr r12, [r11]
/* see if the index is ... | arm64 | gas-like | handwritten | NetBSD/src | sys/arch/shark/shark/shark_fiq.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/shark/shark/shark_fiq.S | 81 | 140 |
NetBSD/src:sys/arch/shark/shark/shark_fiq.S:4 | strh r12, [r8, #SEQUOIA_DATA]
#else
.word 0xe1c8c2b6
#endif
ldr r12, Lfiqs_happened
ldr r11, [r12]
add r11, r11, #1
str r11, [r12]
cmp r9, #0
subseq pc, lr, #4 /* no routine => return from trap */
/* assume that the C routine follows the ARM procedure call standard.
save only user registers a... | arm64 | gas-like | handwritten | NetBSD/src | sys/arch/shark/shark/shark_fiq.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/shark/shark/shark_fiq.S | 121 | 147 |
NetBSD/src:sys/arch/shark/stand/ofwboot/srt0.S:1 | /* $NetBSD: srt0.S,v 1.1 2002/02/10 01:58:20 thorpej Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
* All rights reserved.
*
* Written by Jason R. Thorpe for Wasabi Systems, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the followi... | arm64 | gas-like | handwritten | NetBSD/src | sys/arch/shark/stand/ofwboot/srt0.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/shark/stand/ofwboot/srt0.S | 1 | 60 |
NetBSD/src:sys/arch/shark/stand/ofwboot/srt0.S:2 | b _C_LABEL(startup)
ENTRY(cpufunc_id)
mrc p15, 0, r0, c0, c0, 0
mov pc, lr
.data
.global _C_LABEL(sa110_cache_clean_addr)
_C_LABEL(sa110_cache_clean_addr):
.word 0x00000000
.global _C_LABEL(sa110_cache_clean_size)
_C_LABEL(sa110_cache_clean_size):
.word 0x00008000
.text
Lsa110_cache_clean_addr:
.word _C_L... | arm64 | gas-like | handwritten | NetBSD/src | sys/arch/shark/stand/ofwboot/srt0.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/shark/stand/ofwboot/srt0.S | 41 | 74 |
NetBSD/src:sys/arch/sparc/sparc/bsd_fdintr.s:2 | #include <sparc/sparc/auxreg.h>
#include <sparc/sparc/vaddrs.h>
#include <sparc/dev/fdreg.h>
#include <sparc/dev/fdvar.h>
#define FD_SET_SWINTR_4C \
sethi %hi(INTRREG_VA), %l5; \
ldub [%l5 + %lo(INTRREG_VA)], %l6; \
or %l6, IE_L4, %l6; \
stb %l6, [%l5 + %lo(INTRREG_VA)]
! raise(0,IPL_SOFTFDC) ! NOTE: CPU#... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc/sparc/bsd_fdintr.s | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc/sparc/bsd_fdintr.s | 41 | 100 |
NetBSD/src:sys/arch/sparc/sparc/bsd_fdintr.s:3 | or %l7, AUXIO4C_MB1|AUXIO4C_FTC, %l7; \
stb %l7, [%l6 + %lo(AUXREG_VA) + 3];
#define FD_DEASSERT_TC_4C \
ldub [%l6 + %lo(AUXREG_VA) + 3], %l7; \
andn %l7, AUXIO4C_FTC, %l7; \
or %l7, AUXIO4C_MB1, %l7; \
stb %l7, [%l6 + %lo(AUXREG_VA) + 3];
! flip TC bit in auxreg
#define FD_ASSERT_TC_4M \
sethi %hi(A... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc/sparc/bsd_fdintr.s | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc/sparc/bsd_fdintr.s | 81 | 140 |
NetBSD/src:sys/arch/sparc/sparc/bsd_fdintr.s:4 | #define FD_DEASSERT_TC \
cmp %l5, CPU_SUN4M; \
be 8f; \
nop; \
FD_DEASSERT_TC_4C; \
ba,a 9f; \
8: \
FD_DEASSERT_TC_4M; \
9:
#endif
/* Timeout waiting for chip ready */
#define POLL_TIMO 100000
/*
* register mnemonics. note overlapping assignments.
*/
#define R_fdc %l0
#define... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc/sparc/bsd_fdintr.s | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc/sparc/bsd_fdintr.s | 121 | 180 |
NetBSD/src:sys/arch/sparc/sparc/bsd_fdintr.s:5 | .seg "text"
.align 4
_ENTRY(_C_LABEL(fdchwintr))
set save_l, %l7
std %l0, [%l7]
st %l2, [%l7 + 8]
! tally interrupt (curcpu()->cpu_data.cpu_nintr++)
INCR64X(CPUINFO_VA+CPUINFO_NINTR, %l4, %l5, %l7)
! load fdc, if it's NULL there's nothing to do: schedule soft interrupt
sethi %hi(_C_LABEL(fdciop)), %l7
ld [%... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc/sparc/bsd_fdintr.s | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc/sparc/bsd_fdintr.s | 161 | 220 |
NetBSD/src:sys/arch/sparc/sparc/bsd_fdintr.s:6 | cmp %l7, FDC_ITASK_RESULT
be resultphase
!nop
cmp %l7, FDC_ITASK_DMA
bne,a ssi ! a spurious interrupt
mov FDC_ISTATUS_SPURIOUS, %l7 ! set status and post sw intr
! pseudo DMA
ld [R_fdc + FDC_TC], R_tc ! residual count
ld [R_fdc + FDC_DATA], R_buf ! IO buffer
ldub [R_msr], %l7 ! get MSR value
nextc:
... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc/sparc/bsd_fdintr.s | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc/sparc/bsd_fdintr.s | 201 | 260 |
NetBSD/src:sys/arch/sparc/sparc/bsd_fdintr.s:7 | stb %l7, [R_buf] ! *fdc->sc_bufp = *reg_fifo
1:
ldub [R_buf], %l7 ! writing:
stb %l7, [R_fifo] ! *reg_fifo = *fdc->sc_bufp
2:
inc R_buf ! fdc->sc_bufp++
bne,a nextc ! if (--fdc->sc_tc) goto ...
ldub [R_msr], %l7 ! get MSR value
! xfer done: update fdc->sc_buf & fdc->sc_tc, mark istate DONE
... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc/sparc/bsd_fdintr.s | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc/sparc/bsd_fdintr.s | 241 | 300 |
NetBSD/src:sys/arch/sparc/sparc/bsd_fdintr.s:8 | resultphase1:
clr R_stcnt
ldub [R_msr], %l7
set POLL_TIMO, %l6
1: deccc %l6 ! timeout?
be,a ssi ! if so, set status
mov FDC_ISTATUS_ERROR, %l7 ! and post sw interrupt
and %l7, (NE7_RQM | NE7_DIO | NE7_CB), %l7
cmp %l7, NE7_RQM
be 3f ! done
cmp %l7, (NE7_RQM | NE7_DIO | NE7_CB)
bne,a 1b ! loop ti... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc/sparc/bsd_fdintr.s | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc/sparc/bsd_fdintr.s | 281 | 331 |
NetBSD/src:sys/arch/sparc/sparc/bsd_fdintr.s:9 | ldd [%l7], %l0
mov %l0, %psr
nop
ld [%l7 + 8], %l2
jmp %l1
rett %l2
.Lpanic_msg:
.asciz "fdc: overrun"
#endif | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc/sparc/bsd_fdintr.s | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc/sparc/bsd_fdintr.s | 321 | 331 |
NetBSD/src:sys/arch/sparc/sparc/lock_stubs.s:2 | #include <machine/asm.h>
#include <machine/param.h>
#include <sparc/sparc/vaddrs.h>
#include <sparc/psl.h>
#include "assym.h"
curlwp = CPUINFO_VA + CPUINFO_CURLWP
/*
* Interlock hash table, used by the R/W lock helper routines.
*/
.section .bss
.align 1024
.globl _C_LABEL(_lock_hash)
OTYPE(_C_LABEL(_lock_hash... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc/sparc/lock_stubs.s | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc/sparc/lock_stubs.s | 41 | 100 |
NetBSD/src:sys/arch/sparc/sparc/lock_stubs.s:3 | * mutex code will spin or sleep while the mutex is
* owned "anonymously".
*/
sra %o3, 5, %o1 ! curlwp >> 5
sethi %hi(0xff000000), %o2 ! finish constructing
or %o1, %o2, %o1 ! lock word
st %o1, [%o0]
mutex_enter_crit_end: .globl mutex_enter_crit_end
retl
nop
/*
* void mutex_exit(kmutex_t *mtx);
*
*... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc/sparc/lock_stubs.s | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc/sparc/lock_stubs.s | 81 | 140 |
NetBSD/src:sys/arch/sparc/sparc/lock_stubs.s:4 | /*
* void mutex_spin_enter(kmutex_t *);
*/
ENTRY(mutex_spin_enter)
sethi %hi(CPUINFO_VA+CPUINFO_MTX_COUNT), %o4
ld [ %o4 + %lo(CPUINFO_VA+CPUINFO_MTX_COUNT) ], %o5
sub %o5, 1, %o1
st %o1, [ %o4 + %lo(CPUINFO_VA+CPUINFO_MTX_COUNT) ]
ldub [ %o0 + MTX_IPL ], %o2
rd %psr, %o1
sll %o2, 8, %o2
and %o1, PSR_PIL, %o3... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc/sparc/lock_stubs.s | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc/sparc/lock_stubs.s | 121 | 180 |
NetBSD/src:sys/arch/sparc/sparc/lock_stubs.s:5 | #if defined(DIAGNOSTIC)
ldub [ %o0 + MTX_LOCK ], %o1
tst %o1
bz _C_LABEL(mutex_vector_exit)
nop
clrb [ %o0 + MTX_LOCK ]
#elif defined(MULTIPROCESSOR)
clrb [ %o0 + MTX_LOCK ]
#endif
sethi %hi(CPUINFO_VA+CPUINFO_MTX_OLDSPL), %o2
ld [ %o2 + %lo(CPUINFO_VA+CPUINFO_MTX_OLDSPL) ], %o3
sethi %hi(CPUINFO_VA+CPUINFO... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc/sparc/lock_stubs.s | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc/sparc/lock_stubs.s | 161 | 220 |
NetBSD/src:sys/arch/sparc/sparc/lock_stubs.s:6 | or %o4, PSR_PIL, %o5
wr %o5, 0, %psr
nop
nop
nop
srl %o0, 3, %o5
and %o5, 1023, %o5
set _C_LABEL(_lock_hash), %o3
add %o5, %o3, %o5
1:
ldstub [%o5], %o3 ! %o5 == interlock address
tst %o3
bz,a 2f
nop
nop
nop
b,a 1b ! spin
nop
2:
ld [%o0], %o3 ! lock value
cmp %o1, %o3 ! same as expected val... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc/sparc/lock_stubs.s | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc/sparc/lock_stubs.s | 201 | 238 |
NetBSD/src:sys/arch/sparc/sparc/sigcode_state.s:3 | * Note that [%sp + 64 + 8] == %sp + 64 + 16. The copy at %sp+64+8
* will eventually be removed, with a hole left in its place, if things
* work out.
*/
#define SAVE_STATE \
/* \
* XXX the `save' and `restore' below are unnecessary: should \
* replace with simple arithmetic on %sp \
* \
* Make room on the ... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc/sparc/sigcode_state.s | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc/sparc/sigcode_state.s | 81 | 140 |
NetBSD/src:sys/arch/sparc/sparc/sigcode_state.s:4 | std %f18, [%sp + CCFSZ + 80]; \
std %f20, [%sp + CCFSZ + 88]; \
std %f22, [%sp + CCFSZ + 96]; \
std %f24, [%sp + CCFSZ + 104]; \
std %f26, [%sp + CCFSZ + 112]; \
std %f28, [%sp + CCFSZ + 120]; \
std %f30, [%sp + CCFSZ + 128]; \
1:
#define RESTORE_STATE \
/* \
* Now that the handler has returned, re-establish ... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc/sparc/sigcode_state.s | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc/sparc/sigcode_state.s | 121 | 161 |
NetBSD/src:sys/arch/sparc/stand/Makefile.inc:1 | # $NetBSD: Makefile.inc,v 1.14 2016/10/01 13:57:44 christos Exp $
NOSSP= # defined
NOPIE= # defined
NOMAN= # defined
BINDIR= /usr/mdec
NOPIE= yes
CPPFLAGS+= -DSTANDALONE -I.
CFLAGS+= -ffreestanding ${${ACTIVE_CC} == "gcc":? -msoft-float :}
.if ${MACHINE} == "sparc64"
CPPFLAGS+= -DSUN4U
.endif | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc/stand/Makefile.inc | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc/stand/Makefile.inc | 1 | 15 |
NetBSD/src:sys/arch/sparc/stand/common/srt0.S:2 | .comm _C_LABEL(romp), 4
.comm _C_LABEL(cputyp), 4
.comm _C_LABEL(nbpg), 4
.comm _C_LABEL(pgofset), 4
.comm _C_LABEL(pgshift), 4
.text
.globl start
start:
/*
* Set up a stack.
*/
set start, %o1
save %o1, -CCFSZ, %sp
/*
* Find which address we are at.
*/
1: call 2f
sethi %hi(1b), %l0
2: or %l0, %lo... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc/stand/common/srt0.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc/stand/common/srt0.S | 41 | 100 |
NetBSD/src:sys/arch/sparc/stand/common/srt0.S:3 | /*
* Jump to our relocated self.
*/
set 4f, %g1
jmp %g1
nop
4:
#ifdef notyet
/*
* Enable traps
*/
wr %g0, 0, %wim ! make sure we can set psr
nop; nop; nop
wr %g0, PSR_S|PSR_PS|PSR_PIL, %psr ! set initial psr
nop; nop; nop
wr %g0, 2, %wim ! set initial %wim (w1 invalid)
rd %psr, %l0
wr %l0, PSR_E... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc/stand/common/srt0.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc/stand/common/srt0.S | 81 | 140 |
NetBSD/src:sys/arch/sparc/stand/common/srt0.S:4 | srl %o1, 2, %o1 ! we do 4 byte writes now
1:
st %g0, [%o0] ! while (n--)
subcc %o1, 1, %o1 ! *p = 0; etc..
bnz 1b
add %o0, 4, %o0
2:
/*
* Enable interrupts, but only above level 11. This enables "L1-A",
* but avoids spurious interrupt bites from most other devices.
*/
rd %psr, %o0
andn %o0, PSR_PIL, %... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc/stand/common/srt0.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc/stand/common/srt0.S | 121 | 180 |
NetBSD/src:sys/arch/sparc/stand/common/srt0.S:5 | st %i0, [%o1 + %lo(_C_LABEL(romp))]
b,a is_sun4cm
is_openfirm:
! only javastations have OFW, so we know it is a sun4m
mov CPU_SUN4M, %g4
! save address of OpenFirmware client interface handler
sethi %hi(_C_LABEL(romp)), %o1
st %i3, [%o1 + %lo(_C_LABEL(romp))]
b,a is_sun4cm
is_sun4:
mov CPU_SUN4, %g4
mov SUN4... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc/stand/common/srt0.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc/stand/common/srt0.S | 161 | 220 |
NetBSD/src:sys/arch/sparc/stand/common/srt0.S:6 | nop
/*
* Openfirmware entry point: openfirmware(void *args)
*/
ENTRY(openfirmware)
sethi %hi(_C_LABEL(romp)), %o1
ld [%o1 + %lo(_C_LABEL(romp))], %o2
jmp %o2
nop
#ifdef TIGHT
/*
* XXX - Space saving .div & .rem routines (small & non-negative numbers only)
*/
.align 4
.global .div, .udiv
! int n = 0; while... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc/stand/common/srt0.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc/stand/common/srt0.S | 201 | 251 |
NetBSD/src:sys/arch/sparc/stand/common/srt0.S:7 | nop
sub %o0, %o1, %o0
1:
cmp %o0, %o1
bge,a 1b
sub %o0, %o1, %o0
2:
retl
nop
#endif /* TIGHT */ | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc/stand/common/srt0.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc/stand/common/srt0.S | 241 | 251 |
NetBSD/src:sys/arch/sparc/stand/common/srt0.S:5 | st %i0, [%o1 + %lo(_C_LABEL(romp))]
b,a is_sun4cm
is_openfirm:
! only javastations have OFW, so we know it is a sun4m
mov CPU_SUN4M, %g4
! save address of OpenFirmware client interface handler
sethi %hi(_C_LABEL(romp)), %o1
st %i3, [%o1 + %lo(_C_LABEL(romp))]
b,a is_sun4cm
is_sun4:
mov CPU_SUN4, %g4
mov SUN4... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc/stand/common/srt0.S | BSD-2-Clause | 3a3e6e6861107fa30395b99abb65697f94ef1bf8 | github | kernel | https://github.com/NetBSD/src/blob/3a3e6e6861107fa30395b99abb65697f94ef1bf8/sys/arch/sparc/stand/common/srt0.S | 161 | 220 |
NetBSD/src:sys/arch/sparc/stand/common/srt0.S:6 | nop
/*
* Openfirmware entry point: openfirmware(void *args)
*/
ENTRY(openfirmware)
sethi %hi(_C_LABEL(romp)), %o1
ld [%o1 + %lo(_C_LABEL(romp))], %o2
jmp %o2
nop
#ifdef TIGHT
/*
* XXX - Space saving .div & .rem routines (small & non-negative numbres only)
*/
.align 4
.global .div, .udiv
! int n = 0; while... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc/stand/common/srt0.S | BSD-2-Clause | 3a3e6e6861107fa30395b99abb65697f94ef1bf8 | github | kernel | https://github.com/NetBSD/src/blob/3a3e6e6861107fa30395b99abb65697f94ef1bf8/sys/arch/sparc/stand/common/srt0.S | 201 | 251 |
NetBSD/src:sys/arch/sparc/stand/ofwboot/srt0.s:2 | #ifdef _LP64
#define LDPTR ldx
#else
#define LDPTR lduw
#endif
.register %g2,#ignore
.register %g3,#ignore
/*
* Globals
*/
.globl _esym
.data
_esym: .word 0 /* end of symbol table */
/*
* Startup entry
*/
.text
.globl _start, _C_LABEL(kernel_text)
_C_LABEL(kernel_text) = _start
_start:
nop ! For s... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc/stand/ofwboot/srt0.s | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc/stand/ofwboot/srt0.s | 41 | 100 |
NetBSD/src:sys/arch/sparc/stand/ofwboot/srt0.s:3 | 1:
sub %sp, %g1, %g1
save %g1, %g0, %sp
#else
/* 32-bit stack */
btst 1, %sp
set CC64FSZ, %g1 ! Frame Size (negative)
bz 1f
set BIAS, %g2
sub %g1, %g2, %g1
1:
sub %sp, %g1, %g1 ! This is so we properly sign-extend things
andn %g1, 0x7, %g1
save %g1, %g0, %sp
#endif
/*
* Set the psr into a known state:
... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc/stand/ofwboot/srt0.s | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc/stand/ofwboot/srt0.s | 81 | 140 |
NetBSD/src:sys/arch/sparc/stand/ofwboot/srt0.s:4 | */
.align 8
.globl _C_LABEL(syncicache)
_C_LABEL(syncicache):
dec 4, %o1
flush %o0
brgz,a,pt %o1, _C_LABEL(syncicache)
inc 4, %o0
retl
nop
/*
* openfirmware(cell* param);
*
* OpenFirmware entry point
*
* If we're running in 32-bit mode we need to convert to a 64-bit stack
* and 64-bit cells. The cells... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc/stand/ofwboot/srt0.s | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc/stand/ofwboot/srt0.s | 121 | 180 |
NetBSD/src:sys/arch/sparc/stand/ofwboot/srt0.s:5 | wrpr %l0, %g0, %pstate
mov %l1, %g1
mov %l2, %g2
mov %l3, %g3
mov %l4, %g4
mov %l5, %g5
mov %l6, %g6
mov %l7, %g7
ret
restore %o0, %g0, %o0
1: ! v8 -- need to screw with stack & params
save %sp, -CC64FSZ, %sp ! Get a new 64-bit stack frame
add %sp, -BIAS, %sp
sethi %hi(_C_LABEL(romp)), %o1
rdpr %p... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc/stand/ofwboot/srt0.s | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc/stand/ofwboot/srt0.s | 161 | 220 |
NetBSD/src:sys/arch/sparc/stand/ofwboot/srt0.s:6 | * vaddr_t
* itlb_va_to_pa(vaddr_t)
*
* Find out if there is a mapping in iTLB for a given virtual address,
* return -1 if there is none.
*/
.align 8
.globl _C_LABEL(itlb_va_to_pa)
_C_LABEL(itlb_va_to_pa):
set _C_LABEL(itlb_slot_max), %o3
ld [%o3], %o3
dec %o3
sllx %o3, 3, %o3
clr %o1
0: ldxa [%o1] ASI_IMMU_... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc/stand/ofwboot/srt0.s | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc/stand/ofwboot/srt0.s | 201 | 260 |
NetBSD/src:sys/arch/sparc/stand/ofwboot/srt0.s:7 | .globl _C_LABEL(dtlb_va_to_pa)
_C_LABEL(dtlb_va_to_pa):
set _C_LABEL(dtlb_slot_max), %o3
ld [%o3], %o3
dec %o3
sllx %o3, 3, %o3
clr %o1
0: ldxa [%o1] ASI_DMMU_TLB_TAG, %o2
cmp %o2, %o0
bne,a %xcc, 1f
nop
/* return PA of matching entry */
ldxa [%o1] ASI_DMMU_TLB_DATA, %o0
sllx %o0, 23, %o0
srlx %o0, PGSHIFT... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc/stand/ofwboot/srt0.s | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc/stand/ofwboot/srt0.s | 241 | 300 |
NetBSD/src:sys/arch/sparc/stand/ofwboot/srt0.s:8 | stxa %o0, [%o3] ASI_IMMU
stxa %o1, [%g0] ASI_IMMU_DATA_IN
membar #Sync
retl
wrpr %o4, 0, %pstate
/*
* void
* dtlb_replace(vaddr_t vpn, uint32_t data_hi, uint32_t data_lo)
*
* Replace mapping in dTLB. Data tag is passed in two different
* registers so that it works even with 32-bit compilers.
*/
.align 8
... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc/stand/ofwboot/srt0.s | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc/stand/ofwboot/srt0.s | 281 | 340 |
NetBSD/src:sys/arch/sparc/stand/ofwboot/srt0.s:9 | retl
nop
/*
* void
* dtlb_enter(vaddr_t vpn, uint32_t data_hi, uint32_t data_lo)
*
* Insert new mapping into dTLB. Data tag is passed in two different
* registers so that it works even with 32-bit compilers.
*/
.align 8
.globl _C_LABEL(dtlb_enter)
_C_LABEL(dtlb_enter):
sllx %o1, 32, %o1
or %o1, %o2, %o1
r... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc/stand/ofwboot/srt0.s | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc/stand/ofwboot/srt0.s | 321 | 365 |
NetBSD/src:sys/arch/sparc64/sparc64/bsd_fdintr.s:2 | /* XXX this goes in a header file -- currently, it's hidden in locore.s */
#define INTREG_ADDR 0xf8002000
/* Timeout waiting for chip ready */
#define POLL_TIMO 100000
/*
* register mnemonics. note overlapping assignments.
*/
#define R_fdc %l0
#define R_msr %l1
#define R_fifo %l2
#define R_buf %l3
#define R_tc %l4
... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/bsd_fdintr.s | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/bsd_fdintr.s | 41 | 100 |
NetBSD/src:sys/arch/sparc64/sparc64/bsd_fdintr.s:3 | ! tally interrupt
sethi %hi(_C_LABEL(cnt)+V_INTR), %l7
ld [%l7 + %lo(_C_LABEL(cnt)+V_INTR)], %l6
inc %l6
st %l6, [%l7 + %lo(_C_LABEL(cnt)+V_INTR)]
! load fdc, if it's NULL there's nothing to do: schedule soft interrupt
sethi %hi(_C_LABEL(fdciop)), %l7
ld [%l7 + %lo(_C_LABEL(fdciop))], R_fdc
! tally interrupt
... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/bsd_fdintr.s | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/bsd_fdintr.s | 81 | 140 |
NetBSD/src:sys/arch/sparc64/sparc64/bsd_fdintr.s:4 | ! we filled/emptied the FIFO; update fdc->sc_buf & fdc->sc_tc
st R_tc, [R_fdc + FDC_TC]
b x
st R_buf, [R_fdc + FDC_DATA]
0:
bz resultphase ! overrun/underrun
btst NE7_DIO, %l7 ! IO direction
bz 1f
deccc R_tc
ldub [R_fifo], %l7 ! reading:
b 2f
stb %l7, [R_buf] ! *fdc->sc_bufp = *reg_fifo
1:
ldub... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/bsd_fdintr.s | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/bsd_fdintr.s | 121 | 180 |
NetBSD/src:sys/arch/sparc64/sparc64/bsd_fdintr.s:5 | andn %l7, AUXIO_LED_FTC, %l7
or %l7, AUXIO_LED_MB1, %l7
stb %l7, [%l6]
b resultphase1
nop
spurious:
mov ISTATE_SPURIOUS, %l7
st %l7, [R_fdc + FDC_ISTATE]
b,a ssi
sensei:
ldub [R_msr], %l7
set POLL_TIMO, %l6
1: deccc %l6 ! timeout?
be ssi
and %l7, (NE7_RQM | NE7_DIO | NE7_CB), %l7
cmp %l7, NE7_RQM
bne... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/bsd_fdintr.s | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/bsd_fdintr.s | 161 | 220 |
NetBSD/src:sys/arch/sparc64/sparc64/bsd_fdintr.s:6 | ldub [R_msr], %l7
cmp R_stcnt, FDC_NSTATUS ! status overrun?
bge 2f ! if so, load but dont store
ldub [R_fifo], %l7 ! load the status byte
stb %l7, [R_stat]
inc R_stat
inc R_stcnt
2: b 1b
ldub [R_msr], %l7
3:
! got status, update sc_nstat and mark istate IDLE
st R_stcnt, [R_fdc + FDC_NSTAT]
mov ISTAT... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/bsd_fdintr.s | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/bsd_fdintr.s | 201 | 236 |
NetBSD/src:sys/arch/sparc64/sparc64/copy.S:2 | * contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHAN... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/copy.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/copy.S | 41 | 100 |
NetBSD/src:sys/arch/sparc64/sparc64/copy.S:3 | * copyinstr(fromaddr, toaddr, maxlength, &lencopied)
*
* Copy a null terminated string from the user address space into
* the kernel address space.
*/
ENTRY(copyinstr)
! %o0 = fromaddr, %o1 = toaddr, %o2 = maxlen, %o3 = &lencopied
#ifdef NOTDEF_DEBUG
save %sp, -CC64FSZ, %sp
set 8f, %o0
mov %i0, %o1
mov %i1, %o... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/copy.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/copy.S | 81 | 140 |
NetBSD/src:sys/arch/sparc64/sparc64/copy.S:4 | bg,pt %icc, 0b ! fromaddr++;
inc %o0 ! goto loop;
ba,pt %xcc, Lcsdone ! }
mov ENAMETOOLONG, %o0 ! error = ENAMETOOLONG;
NOTREACHED
/*
* copyoutstr(fromaddr, toaddr, maxlength, &lencopied)
*
* Copy a null terminated string from the kernel
* address space to the user address space.
*/
ENTRY(copyoutstr)
... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/copy.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/copy.S | 121 | 180 |
NetBSD/src:sys/arch/sparc64/sparc64/copy.S:5 | 0: ! loop:
ldsb [%o0], %g1 ! c = *fromaddr;
stba %g1, [%o1] ASI_AIUS ! *toaddr++ = c;
inc %o1
brz,a,pn %g1, Lcsdone ! if (c == NULL)
clr %o0 ! { error = 0; done; }
deccc %o2 ! if (--len > 0) {
bg,pt %icc, 0b ! fromaddr++;
inc %o0 ! goto loop;
! }
mov ENAMETOOLONG, %o0 ! error = ENAMETOOLO... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/copy.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/copy.S | 161 | 220 |
NetBSD/src:sys/arch/sparc64/sparc64/copy.S:6 | 1: .asciz "copyin: src=%x dest=%x len=%x\n"
_ALIGN
.text
#endif
sethi %hi(CPCB), %o3
wr %g0, ASI_AIUS, %asi
LDPTR [%o3 + %lo(CPCB)], %o3
set Lcopyfault, %o4
! mov %o7, %g7 ! save return address
membar #Sync
STPTR %o4, [%o3 + PCB_ONFAULT]
cmp %o2, BCOPY_SMALL
Lcopyin_start:
bge,a Lcopyin_fancy ! if >= this ma... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/copy.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/copy.S | 201 | 260 |
NetBSD/src:sys/arch/sparc64/sparc64/copy.S:7 | .empty
btst 7, %o1
be,a Lcopyin_doubles
dec 8, %o2 ! if all lined up, len -= 8, goto copyin_doubes
! If the low bits match, we can make these line up.
1:
xor %o0, %o1, %o3 ! t = src ^ dst;
btst 1, %o3 ! if (t & 1) {
be,a 1f
btst 1, %o0 ! [delay slot: if (src & 1)]
! low bits do not match, must copy by b... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/copy.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/copy.S | 241 | 300 |
NetBSD/src:sys/arch/sparc64/sparc64/copy.S:8 | 0:
ldsha [%o0] %asi, %o4 ! do {
sth %o4, [%o1] ! *(short *)dst = *(short *)src;
inc 2, %o0 ! dst += 2, src += 2;
deccc 2, %o2 ! } while ((len -= 2) >= 0);
bge 0b
inc 2, %o1
b Lcopyin_mopb ! goto mop_up_byte;
btst 1, %o2 ! } [delay slot: if (len & 1)]
NOTREACHED
! low two bits match, so we can copy by ... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/copy.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/copy.S | 281 | 340 |
NetBSD/src:sys/arch/sparc64/sparc64/copy.S:9 | be 1f ! if (src & 4) {
dec 8, %o2 ! [delay slot: len -= 8]
lduwa [%o0] %asi, %o4 ! *(int *)dst = *(int *)src;
st %o4, [%o1]
inc 4, %o0 ! dst += 4, src += 4, len -= 4;
inc 4, %o1
dec 4, %o2 ! }
1:
Lcopyin_doubles:
ldxa [%o0] %asi, %g1 ! do {
stx %g1, [%o1] ! *(double *)dst = *(double *)src;
inc 8, %o0 ! d... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/copy.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/copy.S | 321 | 380 |
NetBSD/src:sys/arch/sparc64/sparc64/copy.S:10 | clr %o0
NOTREACHED
! mop up trailing byte (if present).
Lcopyin_mopb:
be,a Lcopyin_done
nop
ldsba [%o0] %asi, %o4
stb %o4, [%o1]
Lcopyin_done:
sethi %hi(CPCB), %o3
! stb %o4,[%o1] ! Store last byte -- should not be needed
LDPTR [%o3 + %lo(CPCB)], %o3
membar #Sync
STPTR %g0, [%o3 + PCB_ONFAULT]
wr %g0, ASI... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/copy.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/copy.S | 361 | 420 |
NetBSD/src:sys/arch/sparc64/sparc64/copy.S:11 | mov %i0, %o1
set CTX_SECONDARY, %o4
mov %i1, %o2
ldxa [%o4] ASI_DMMU, %o4
call printf
mov %i2, %o3
restore
.data
1: .asciz "copyout: src=%x dest=%x len=%x ctx=%d\n"
_ALIGN
.text
#endif
Ldocopy:
sethi %hi(CPCB), %o3
wr %g0, ASI_AIUS, %asi
LDPTR [%o3 + %lo(CPCB)], %o3
set Lcopyfault, %o4
! mov %o7, %g7 ! s... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/copy.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/copy.S | 401 | 460 |
NetBSD/src:sys/arch/sparc64/sparc64/copy.S:12 | ba Lcopyout_done
clr %o0
NOTREACHED
/*
* Plenty of data to copy, so try to do it optimally.
*/
Lcopyout_fancy:
! check for common case first: everything lines up.
! btst 7, %o0 ! done already
bne 1f
.empty
btst 7, %o1
be,a Lcopyout_doubles
dec 8, %o2 ! if all lined up, len -= 8, goto copyout_doubes
... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/copy.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/copy.S | 441 | 500 |
NetBSD/src:sys/arch/sparc64/sparc64/copy.S:13 | ! although low bits match, both are 1: must copy 1 byte to align
ldsb [%o0], %o4 ! *dst++ = *src++;
stba %o4, [%o1] %asi
inc %o0
inc %o1
dec %o2 ! len--;
btst 2, %o3 ! } [if (t & 2)]
1:
be,a 1f ! if (t & 2) {
btst 2, %o0 ! [delay slot: if (src & 2)]
dec 2, %o2 ! len -= 2;
0:
ldsh [%o0], %o4 ! do {
stha... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/copy.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/copy.S | 481 | 540 |
NetBSD/src:sys/arch/sparc64/sparc64/copy.S:14 | sta %o4, [%o1] %asi ! *(int *)dst = *(int *)src;
inc 4, %o0 ! dst += 4, src += 4;
deccc 4, %o2 ! } while ((len -= 4) >= 0);
bge 0b
inc 4, %o1
b Lcopyout_mopw ! goto mop_up_word_and_byte;
btst 2, %o2 ! } [delay slot: if (len & 2)]
NOTREACHED
! low three bits match, so we can copy by doublewords
1:
be 1f... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/copy.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/copy.S | 521 | 580 |
NetBSD/src:sys/arch/sparc64/sparc64/copy.S:15 | 1:
! mop up trailing word (if present) and byte (if present).
Lcopyout_mopw:
be Lcopyout_mopb ! no word, go mop up byte
btst 1, %o2 ! [delay slot: if (len & 1)]
ldsh [%o0], %o4 ! *(short *)dst = *(short *)src;
be Lcopyout_done ! if ((len & 1) == 0) goto done;
stha %o4, [%o1] %asi
ldsb [%o0 + 2], %o4 ! dst[2] ... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/copy.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/copy.S | 561 | 620 |
NetBSD/src:sys/arch/sparc64/sparc64/copy.S:16 | membar #StoreStore|#StoreLoad
#ifdef NOTDEF_DEBUG
save %sp, -CC64FSZ, %sp
set 1f, %o0
call printf
nop
restore
.data
1: .asciz "copyfault: fault occurred\n"
_ALIGN
.text
#endif
retl
wr %g0, ASI_PRIMARY_NOFAULT, %asi ! Restore ASI
/*
* Compare-and-swap the pointer in the user-space.
*
* int _ucas_32(vola... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/copy.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/copy.S | 601 | 660 |
NetBSD/src:sys/arch/sparc64/sparc64/copy.S:17 | #ifdef _LP64
/*
* Compare-and-swap the 64-bit integer in the user-space.
*
* int _ucas_64(volatile uint64_t *uptr, uint64_t old, uint64_t new,
* uint64_t *ret);
*/
ENTRY(_ucas_64)
sethi %hi(CPCB), %o4
wr %g0, ASI_AIUS, %asi
LDPTR [%o4 + %lo(CPCB)], %o4
set Lcopyfault, %o5 ! reusing copyin/copyout
membar ... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/copy.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/copy.S | 641 | 700 |
NetBSD/src:sys/arch/sparc64/sparc64/copy.S:18 | membar #StoreStore|#StoreLoad
#define UFETCHSTORE_EPILOGUE \
membar #Sync ;\
_UFETCHSTORE_EPILOGUE
#define UFETCHSTORE_RETURN_SUCCESS \
retl ;\
clr %o0
/* LINTSTUB: int _ufetch_8(const uint8_t *uaddr, uint8_t *valp); */
ENTRY(_ufetch_8)
UFETCHSTORE_PROLOGUE
lduba [%o0] ASI_AIUS, %o0 ! ... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/copy.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/copy.S | 681 | 740 |
NetBSD/src:sys/arch/sparc64/sparc64/copy.S:19 | stx %o0, [%o1] ! *valp = %o0
UFETCHSTORE_RETURN_SUCCESS
#endif /* _LP64 */
/* LINTSTUB: int _ustore_8(uint8_t *uaddr, uint8_t val); */
ENTRY(_ustore_8)
UFETCHSTORE_PROLOGUE
stba %o1, [%o0] ASI_AIUS ! *uaddr = val
UFETCHSTORE_EPILOGUE
UFETCHSTORE_RETURN_SUCCESS
/* LINTSTUB: int _ustore_16(uint16_t *uaddr, uint1... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/copy.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/copy.S | 721 | 780 |
NetBSD/src:sys/arch/sparc64/sparc64/copy.S:20 | /* probeget and probeset are meant to be used during autoconfiguration */
/*
* The following probably need to be changed, but to what I don't know.
*/
/*
* uint64_t
* probeget(addr, asi, size)
* paddr_t addr;
* int asi;
* int size;
*
* Read or write a (byte,word,longword) from the given address.
* Like {fu,s... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/copy.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/copy.S | 761 | 820 |
NetBSD/src:sys/arch/sparc64/sparc64/copy.S:21 | DLFLUSH(%o0,%o5) ! flush cache line
! }
0:
#ifndef _LP64
rdpr %pstate, %g1
wrpr %g1, PSTATE_AM, %pstate
#endif
btst 1, %o4
wr %o1, 0, %asi
membar #Sync
bz 0f ! if (len & 1)
btst 2, %o4
ba,pt %icc, 1f
lduba [%o0] %asi, %o0 ! value = *(char *)addr;
0:
bz 0f ! if (len & 2)
btst 4, %o4
ba,pt %icc,... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/copy.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/copy.S | 801 | 860 |
NetBSD/src:sys/arch/sparc64/sparc64/copy.S:22 | retl ! made it, clear onfault and return
membar #StoreStore|#StoreLoad
/*
* Fault handlers for probeget
*/
_C_LABEL(Lfsprobe):
#ifndef _LP64
wrpr %g1, 0, %pstate
#endif
STPTR %g0, [%o2 + PCB_ONFAULT]! error in r/w, clear pcb_onfault
mov -1, %o1
wr %g0, ASI_PRIMARY_NOFAULT, %asi ! Restore default ASI
me... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/copy.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/copy.S | 841 | 900 |
NetBSD/src:sys/arch/sparc64/sparc64/copy.S:23 | mov %o2, %o1
mov %o3, %o2
COMBINE(%o4, %o5, %o3)
#endif
mov %o2, %o4
! %o0 = addr, %o1 = asi, %o4 = (1,2,4), %o3 = val
sethi %hi(CPCB), %o2 ! Lfsbail requires CPCB in %o2
LDPTR [%o2 + %lo(CPCB)], %o2 ! cpcb->pcb_onfault = Lfsbail;
set _C_LABEL(Lfsbail), %o5
STPTR %o5, [%o2 + PCB_ONFAULT]
btst 1, %o4
wr %o1, ... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/copy.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/copy.S | 881 | 940 |
NetBSD/src:sys/arch/sparc64/sparc64/copy.S:24 | * kcopy() is exactly like bcopy except that it set pcb_onfault such that
* when a fault occurs, it is able to return -1 to indicate this to the
* caller.
*/
ENTRY(kcopy)
#ifdef DEBUG
set pmapdebug, %o4
ld [%o4], %o4
btst 0x80, %o4 ! PDB_COPY
bz,pt %icc, 3f
nop
save %sp, -CC64FSZ, %sp
mov %i0, %o1
set 2f, %o... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/copy.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/copy.S | 921 | 980 |
NetBSD/src:sys/arch/sparc64/sparc64/copy.S:25 | */
deccc %o2 ! while (--len >= 0)
bl 1f
.empty
0:
ldsb [%o0], %o4 ! *dst++ = *src++;
inc %o0
stb %o4, [%o1]
deccc %o2
bge 0b
inc %o1
1:
membar #Sync ! Make sure all fauls are processed
STPTR %g1, [%o5 + PCB_ONFAULT]! restore fault handler
membar #StoreStore|#StoreLoad
retl
clr %o0
NOTREACHED
/*
... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/copy.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/copy.S | 961 | 1,020 |
NetBSD/src:sys/arch/sparc64/sparc64/copy.S:26 | ldsb [%o0], %o4 ! do {
inc %o0 ! *dst++ = *src++;
stb %o4, [%o1]
deccc %o2
bnz 0b ! } while (--len != 0);
inc %o1
membar #Sync ! Make sure all traps are taken
STPTR %g1, [%o5 + PCB_ONFAULT]! restore fault handler
membar #StoreStore|#StoreLoad
retl
clr %o0
NOTREACHED
! lowest bit matches, so we can co... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/copy.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/copy.S | 1,001 | 1,060 |
NetBSD/src:sys/arch/sparc64/sparc64/copy.S:27 | ! low two bits match, so we can copy by longwords
1:
be,a 1f ! if (src & 2) {
btst 4, %o3 ! [delay slot: if (t & 4)]
! although low 2 bits match, they are 10: must copy one short to align
ldsh [%o0], %o4 ! (*short *)dst = *(short *)src;
inc 2, %o0 ! dst += 2;
sth %o4, [%o1]
dec 2, %o2 ! len -= 2;
inc 2, %... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/copy.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/copy.S | 1,041 | 1,100 |
NetBSD/src:sys/arch/sparc64/sparc64/copy.S:28 | stx %g5, [%o1] ! *(double *)dst = *(double *)src;
deccc 8, %o2 ! } while ((len -= 8) >= 0);
bge Lkcopy_doubles
inc 8, %o1
! check for a usual case again (save work)
btst 7, %o2 ! if ((len & 7) == 0)
be Lkcopy_done ! goto kcopy_done;
btst 4, %o2 ! if ((len & 4)) == 0)
be,a Lkcopy_mopw ! goto mop_up_word_a... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/copy.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/copy.S | 1,081 | 1,140 |
NetBSD/src:sys/arch/sparc64/sparc64/copy.S:29 | Lkcopy_done:
membar #Sync ! Make sure all traps are taken
STPTR %g1, [%o5 + PCB_ONFAULT]! restore fault handler
membar #StoreStore|#StoreLoad
retl
clr %o0
NOTREACHED
1:
stb %o4, [%o1]
membar #Sync ! Make sure all traps are taken
STPTR %g1, [%o5 + PCB_ONFAULT]! restore fault handler
membar #StoreStore|#Sto... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/copy.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/copy.S | 1,121 | 1,160 |
NetBSD/src:sys/arch/sparc64/sparc64/cpu_in_cksum.S:2 | /*
* Register args:
*
* %o0 - mbuf
* %o1 - len
* %o2 - off
* %o3 - sum
*
* // skip unnecessary part
* while (m && off > 0) {
* if (m->m_len > off)
* break;
* off -= m->m_len;
* m = m->m_next;
* }
*/
2: brz,pn %o0, 0f
brlez,pn %o1, 0f
lduw [%o0 + M_LEN], %o5
cmp %o2, %o5
blt,pt %icc,0f
nop
LD... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/cpu_in_cksum.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/cpu_in_cksum.S | 41 | 100 |
NetBSD/src:sys/arch/sparc64/sparc64/cpu_in_cksum.S:3 | * %g5 - temp
*/
0: srl %o3, 0, %o3 ! Make sure this is a 32-bit value going in
brz %o0, Lfinish ! for (; m && len > 0; m->m_next) {
clr %g1 ! swapped = 0;
brlez %o1, Lfinish
mov %o2, %o4 ! Stash this elsewhere for a bit
lduw [%o0 + M_LEN], %o2 ! Code duplicated at Lloop
srlx %o3, 32, %g4 ! REDUCE bigtime
se... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/cpu_in_cksum.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/cpu_in_cksum.S | 81 | 140 |
NetBSD/src:sys/arch/sparc64/sparc64/cpu_in_cksum.S:4 | add %o3, %o4, %o3
btst 1, %o5 ! if (!(*w & 3) &&
bz Lshort_aligned
nop
deccc %o2
bl,a,pn %icc, Lnext ! mlen >= 1) {
inc %o2
ldub [%o5], %o4 ! ADDBYTE {ROL; sum += *w; byte_swapped ^= 1;}
sllx %o3, 8, %o3 ! ROL { sum = sum << 8; }
inc %o5 ! }
add %o3, %o4, %o3
xor %g1, 1, %g1 ! Flip byte_swapped
Lshort_... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/cpu_in_cksum.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/cpu_in_cksum.S | 121 | 180 |
NetBSD/src:sys/arch/sparc64/sparc64/cpu_in_cksum.S:5 | inc 0xc, %o5 ! ADVANCE(12) }
bg,pt %icc, 0b
add %o3, %o4, %o3
add %o3, %g4, %o3
add %o3, %g5, %o3
Ltoofar:
inc 0xc, %o2
Ldo_int:
deccc 4, %o2
bl,pn %icc, Lfinish_short
nop
0:
lduw [%o5], %o4
inc 4, %o5
deccc 4, %o2
bge,pt %icc, 0b
add %o3, %o4, %o3
Lfinish_short:
btst 2, %o2
bz Lfinish_byte
nop
l... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/cpu_in_cksum.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/cpu_in_cksum.S | 161 | 220 |
NetBSD/src:sys/arch/sparc64/sparc64/cpu_in_cksum.S:6 | srlx %o3, 32, %o4 ! Reduce to 32-bits
srl %o3, 0, %o3
brz,pt %o0, 1f ! In general there is only one mbuf
add %o3, %o4, %o3
brgz,pt %o1, Lloop ! But usually all need to be fully checksummed
nop
1:
sethi %hi(0x0000ffff), %o5 ! data ptr not needed any more
srlx %o3, 16, %o4
or %o5, %lo(0x0000ffff), %o5
and %... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/cpu_in_cksum.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/cpu_in_cksum.S | 201 | 231 |
NetBSD/src:sys/arch/sparc64/sparc64/db_tlb_access.S:1 | /* $NetBSD: db_tlb_access.S,v 1.3 2015/03/02 14:17:06 nakayama Exp $ */
/*
* Copyright (c) 1996-2002 Eduardo Horvath
* Copyright (c) 2010 Matthew R. Green
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following condit... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/db_tlb_access.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/db_tlb_access.S | 1 | 60 |
NetBSD/src:sys/arch/sparc64/sparc64/db_tlb_access.S:2 | clr %l2
1:
ldxa [%l1] ASI_DMMU_TLB_TAG, %o2
membar #Sync
mov %l2, %o1
ldxa [%l1] ASI_DMMU_TLB_DATA, %o3
membar #Sync
inc %l2
set 2f, %o0
call _C_LABEL(db_printf)
inc 8, %l1
ldxa [%l1] ASI_DMMU_TLB_TAG, %o2
membar #Sync
mov %l2, %o1
ldxa [%l1] ASI_DMMU_TLB_DATA, %o3
membar #Sync
inc %l2
set 3f, %o0
ca... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/db_tlb_access.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/db_tlb_access.S | 41 | 100 |
NetBSD/src:sys/arch/sparc64/sparc64/db_tlb_access.S:3 | membar #Sync
inc %l2
set 2f, %o0
call _C_LABEL(db_printf)
inc 8, %l1
ldxa [%l1] ASI_IMMU_TLB_TAG, %o2
membar #Sync
mov %l2, %o1
ldxa [%l1] ASI_IMMU_TLB_DATA, %o3
membar #Sync
inc %l2
set 3f, %o0
call _C_LABEL(db_printf)
inc 8, %l1
cmp %l1, %l3
bl 1b
inc 8, %l0
ret
restore
.data
2:
.asciz "%2... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/db_tlb_access.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/db_tlb_access.S | 81 | 140 |
NetBSD/src:sys/arch/sparc64/sparc64/db_tlb_access.S:4 | mov %l2, %o1
srax %o2, 32, %o2
ldxa [%l1] ASI_DMMU_TLB_DATA, %o4
membar #Sync
srl %o4, 0, %o5
inc %l2
srax %o4, 32, %o4
set 2f, %o0
call _C_LABEL(db_printf)
inc 8, %l1
ldxa [%l1] ASI_DMMU_TLB_TAG, %o2
membar #Sync
srl %o2, 0, %o3
mov %l2, %o1
srax %o2, 32, %o2
ldxa [%l1] ASI_DMMU_TLB_DATA, %o4
membar ... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/db_tlb_access.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/db_tlb_access.S | 121 | 180 |
NetBSD/src:sys/arch/sparc64/sparc64/db_tlb_access.S:5 | membar #Sync
srl %o2, 0, %o3
mov %l2, %o1
srax %o2, 32, %o2
ldxa [%l1] ASI_IMMU_TLB_DATA, %o4
membar #Sync
srl %o4, 0, %o5
inc %l2
srax %o4, 32, %o4
set 2f, %o0
call _C_LABEL(db_printf)
inc 8, %l1
ldxa [%l1] ASI_IMMU_TLB_TAG, %o2
membar #Sync
srl %o2, 0, %o3
mov %l2, %o1
srax %o2, 32, %o2
ldxa [%l1] ... | sparc | gas-like | handwritten | NetBSD/src | sys/arch/sparc64/sparc64/db_tlb_access.S | BSD-2-Clause | 3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd | github | kernel | https://github.com/NetBSD/src/blob/3f1390c8cc18c3f67a4bd2632f8c7ad919cf86fd/sys/arch/sparc64/sparc64/db_tlb_access.S | 161 | 201 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.