Module Name: src Committed By: skrll Date: Sat Jun 10 09:18:50 UTC 2023
Modified Files: src/sys/arch/riscv/riscv: spl.S Log Message: Remove magic numbers. NFCI. Copyright maintenance while I'm here. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/riscv/riscv/spl.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/riscv/riscv/spl.S diff -u src/sys/arch/riscv/riscv/spl.S:1.6 src/sys/arch/riscv/riscv/spl.S:1.7 --- src/sys/arch/riscv/riscv/spl.S:1.6 Sun May 7 12:41:49 2023 +++ src/sys/arch/riscv/riscv/spl.S Sat Jun 10 09:18:50 2023 @@ -1,11 +1,11 @@ -/* $NetBSD: spl.S,v 1.6 2023/05/07 12:41:49 skrll Exp $ */ +/* $NetBSD: spl.S,v 1.7 2023/06/10 09:18:50 skrll Exp $ */ /*- - * Copyright (c) 2014 The NetBSD Foundation, Inc. + * Copyright (c) 2014,2023 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation - * by Matt Thomas of 3am Software Foundry. + * by Matt Thomas of 3am Software Foundry, and Nick Hudson. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,7 +32,9 @@ #include <machine/asm.h> #include "assym.h" -__RCSID("$NetBSD: spl.S,v 1.6 2023/05/07 12:41:49 skrll Exp $") +__RCSID("$NetBSD: spl.S,v 1.7 2023/06/10 09:18:50 skrll Exp $") + +#define SZINT (1 << INT_SCALESHIFT) .data .globl _C_LABEL(ipl_sie_map) @@ -55,8 +57,7 @@ ENTRY_NP(splx) INT_L t0, CI_CPL(a3) // get current IPL bge a0, t0, 2f - - sll t2, a0, 2 // INT_SCALESHIFT + sll t2, a0, INT_SCALESHIFT PTR_LA a1, _C_LABEL(ipl_sie_map) add a1, a1, t2 INT_L a1, 0(a1) @@ -124,51 +125,51 @@ END(spl0) ENTRY_NP(splsoftclock) li t1, IPL_SOFTCLOCK - INT_L t0, _C_LABEL(ipl_sie_map) + 4 * IPL_SOFTCLOCK + INT_L t0, _C_LABEL(ipl_sie_map) + SZINT * IPL_SOFTCLOCK j _splraise END(splsoftclock) ENTRY_NP(splsoftbio) li t1, IPL_SOFTBIO - INT_L t0, _C_LABEL(ipl_sie_map) + 4 * IPL_SOFTBIO + INT_L t0, _C_LABEL(ipl_sie_map) + SZINT * IPL_SOFTBIO j _splraise END(splsoftbio) ENTRY_NP(splsoftnet) li t1, IPL_SOFTNET - INT_L t0, _C_LABEL(ipl_sie_map) + 4 * IPL_SOFTNET + INT_L t0, _C_LABEL(ipl_sie_map) + SZINT * IPL_SOFTNET j _splraise END(splsoftnet) ENTRY_NP(splsoftserial) li t1, IPL_SOFTSERIAL - INT_L t0, _C_LABEL(ipl_sie_map) + 4 * IPL_SOFTSERIAL + INT_L t0, _C_LABEL(ipl_sie_map) + SZINT * IPL_SOFTSERIAL j _splraise END(splsoftserial) ENTRY_NP(splvm) li t1, IPL_VM - INT_L t0, _C_LABEL(ipl_sie_map) + 4 * IPL_VM + INT_L t0, _C_LABEL(ipl_sie_map) + SZINT * IPL_VM j _splraise END(splvm) ENTRY_NP(splsched) li t1, IPL_SCHED - INT_L t0, _C_LABEL(ipl_sie_map) + 4 * IPL_SCHED + INT_L t0, _C_LABEL(ipl_sie_map) + SZINT * IPL_SCHED j _splraise END(splsched) #if 0 ENTRY_NP(splddb) li t1, IPL_DDB - INT_L t0, _C_LABEL(ipl_sie_map) + 4 * IPL_DDB + INT_L t0, _C_LABEL(ipl_sie_map) + SZINT * IPL_DDB j _splraise END(splddb) #endif ENTRY_NP(splhigh) li t1, IPL_HIGH - INT_L t0, _C_LABEL(ipl_sie_map) + 4 * IPL_HIGH + INT_L t0, _C_LABEL(ipl_sie_map) + SZINT * IPL_HIGH j _splraise END(splhigh) @@ -177,7 +178,7 @@ END(splhigh) ENTRY_NP(splraise) // a0 = new higher IPL mv t1, a0 - sll t2, a0, 2 // INT_SCALESHIFT + sll t2, a0, INT_SCALESHIFT PTR_LA a1, _C_LABEL(ipl_sie_map) add a1, a1, t2 INT_L t0, 0(a1)