/
usr
/
src
/
linux-headers-5.15.0-181
/
arch
/
nds32
/
include
/
asm
/
/usr/src/linux-headers-5.15.0-181/arch/nds32/include/asm
mkdir
upload
Name
Size
Mode
Actions
assembler.h
598
0644
edit
dl
rm
barrier.h
431
0644
edit
dl
rm
bitfield.h
47127
0644
edit
dl
rm
cache.h
276
0644
edit
dl
rm
cacheflush.h
1986
0644
edit
dl
rm
cache_info.h
315
0644
edit
dl
rm
current.h
304
0644
edit
dl
rm
delay.h
938
0644
edit
dl
rm
elf.h
6021
0644
edit
dl
rm
fixmap.h
831
0644
edit
dl
rm
fpu.h
3195
0644
edit
dl
rm
fpuemu.h
1272
0644
edit
dl
rm
ftrace.h
1161
0644
edit
dl
rm
futex.h
2483
0644
edit
dl
rm
highmem.h
1624
0644
edit
dl
rm
io.h
2474
0644
edit
dl
rm
irqflags.h
848
0644
edit
dl
rm
Kbuild
194
0644
edit
dl
rm
l2_cache.h
4791
0644
edit
dl
rm
linkage.h
264
0644
edit
dl
rm
memory.h
2713
0644
edit
dl
rm
mmu.h
213
0644
edit
dl
rm
mmu_context.h
1409
0644
edit
dl
rm
nds32.h
2018
0644
edit
dl
rm
nds32_fpu_inst.h
2510
0644
edit
dl
rm
page.h
1591
0644
edit
dl
rm
perf_event.h
445
0644
edit
dl
rm
pgalloc.h
1419
0644
edit
dl
rm
pgtable.h
11676
0644
edit
dl
rm
pmu.h
13350
0644
edit
dl
rm
proc-fns.h
1668
0644
edit
dl
rm
processor.h
2405
0644
edit
dl
rm
ptrace.h
1686
0644
edit
dl
rm
sfp-machine.h
4463
0644
edit
dl
rm
shmparam.h
462
0644
edit
dl
rm
stacktrace.h
884
0644
edit
dl
rm
string.h
471
0644
edit
dl
rm
suspend.h
258
0644
edit
dl
rm
swab.h
810
0644
edit
dl
rm
syscall.h
5496
0644
edit
dl
rm
syscalls.h
510
0644
edit
dl
rm
thread_info.h
2390
0644
edit
dl
rm
tlb.h
249
0644
edit
dl
rm
tlbflush.h
1144
0644
edit
dl
rm
uaccess.h
8272
0644
edit
dl
rm
unistd.h
156
0644
edit
dl
rm
vdso.h
429
0644
edit
dl
rm
vdso_datapage.h
1104
0644
edit
dl
rm
vdso_timer_info.h
357
0644
edit
dl
rm
vermagic.h
214
0644
edit
dl
rm
vmalloc.h
93
0644
edit
dl
rm
Edit:
/usr/src/linux-headers-5.15.0-181/arch/nds32/include/asm/fpu.h
(3195B)
/* SPDX-License-Identifier: GPL-2.0 */ /* Copyright (C) 2005-2018 Andes Technology Corporation */ #ifndef __ASM_NDS32_FPU_H #define __ASM_NDS32_FPU_H #if IS_ENABLED(CONFIG_FPU) #ifndef __ASSEMBLY__ #include <linux/sched/task_stack.h> #include <linux/preempt.h> #include <asm/ptrace.h> extern bool has_fpu; extern void save_fpu(struct task_struct *__tsk); extern void load_fpu(const struct fpu_struct *fpregs); extern bool do_fpu_exception(unsigned int subtype, struct pt_regs *regs); extern int do_fpuemu(struct pt_regs *regs, struct fpu_struct *fpu); #define test_tsk_fpu(regs) (regs->fucop_ctl & FUCOP_CTL_mskCP0EN) /* * Initially load the FPU with signalling NANS. This bit pattern * has the property that no matter whether considered as single or as * double precision, it still represents a signalling NAN. */ #define sNAN64 0xFFFFFFFFFFFFFFFFULL #define sNAN32 0xFFFFFFFFUL #if IS_ENABLED(CONFIG_SUPPORT_DENORMAL_ARITHMETIC) /* * Denormalized number is unsupported by nds32 FPU. Hence the operation * is treated as underflow cases when the final result is a denormalized * number. To enhance precision, underflow exception trap should be * enabled by default and kerenl will re-execute it by fpu emulator * when getting underflow exception. */ #define FPCSR_INIT (FPCSR_mskUDFE | FPCSR_mskIEXE) #else #define FPCSR_INIT 0x0UL #endif extern const struct fpu_struct init_fpuregs; static inline void disable_ptreg_fpu(struct pt_regs *regs) { regs->fucop_ctl &= ~FUCOP_CTL_mskCP0EN; } static inline void enable_ptreg_fpu(struct pt_regs *regs) { regs->fucop_ctl |= FUCOP_CTL_mskCP0EN; } static inline void enable_fpu(void) { unsigned long fucop_ctl; fucop_ctl = __nds32__mfsr(NDS32_SR_FUCOP_CTL) | FUCOP_CTL_mskCP0EN; __nds32__mtsr(fucop_ctl, NDS32_SR_FUCOP_CTL); __nds32__isb(); } static inline void disable_fpu(void) { unsigned long fucop_ctl; fucop_ctl = __nds32__mfsr(NDS32_SR_FUCOP_CTL) & ~FUCOP_CTL_mskCP0EN; __nds32__mtsr(fucop_ctl, NDS32_SR_FUCOP_CTL); __nds32__isb(); } static inline void lose_fpu(void) { preempt_disable(); #if IS_ENABLED(CONFIG_LAZY_FPU) if (last_task_used_math == current) { last_task_used_math = NULL; #else if (test_tsk_fpu(task_pt_regs(current))) { #endif save_fpu(current); } disable_ptreg_fpu(task_pt_regs(current)); preempt_enable(); } static inline void own_fpu(void) { preempt_disable(); #if IS_ENABLED(CONFIG_LAZY_FPU) if (last_task_used_math != current) { if (last_task_used_math != NULL) save_fpu(last_task_used_math); load_fpu(¤t->thread.fpu); last_task_used_math = current; } #else if (!test_tsk_fpu(task_pt_regs(current))) { load_fpu(¤t->thread.fpu); } #endif enable_ptreg_fpu(task_pt_regs(current)); preempt_enable(); } #if !IS_ENABLED(CONFIG_LAZY_FPU) static inline void unlazy_fpu(struct task_struct *tsk) { preempt_disable(); if (test_tsk_fpu(task_pt_regs(tsk))) save_fpu(tsk); preempt_enable(); } #endif /* !CONFIG_LAZY_FPU */ static inline void clear_fpu(struct pt_regs *regs) { preempt_disable(); if (test_tsk_fpu(regs)) disable_ptreg_fpu(regs); preempt_enable(); } #endif /* CONFIG_FPU */ #endif /* __ASSEMBLY__ */ #endif /* __ASM_NDS32_FPU_H */
Save
cmd:
run