From 3da63063d2342371cd7c6e969124b8066dc1b6c3 Mon Sep 17 00:00:00 2001 From: aoyama Date: Tue, 23 Feb 2021 11:48:21 +0000 Subject: [PATCH] Make more efficient clearing interrupts on all processors at boot time. Without this modification, because of the volatile qualifier, the compiler does not produce four `` = 0 '' assignments, but code equivalent to: *(volatile uint32_t *)INT_ST_MASK3 = 0; *(volatile uint32_t *)INT_ST_MASK2 = *(volatile uint32_t *)INT_ST_MASK3; *(volatile uint32_t *)INT_ST_MASK1 = *(volatile uint32_t *)INT_ST_MASK2; *(volatile uint32_t *)INT_ST_MASK0 = *(volatile uint32_t *)INT_ST_MASK1; Anders Gavare reported to Miod Vallat, and he gave me a diff. --- sys/arch/luna88k/luna88k/machdep.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/arch/luna88k/luna88k/machdep.c b/sys/arch/luna88k/luna88k/machdep.c index 9501ad85210..a2f0949eef7 100644 --- a/sys/arch/luna88k/luna88k/machdep.c +++ b/sys/arch/luna88k/luna88k/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.134 2020/05/31 06:23:57 dlg Exp $ */ +/* $OpenBSD: machdep.c,v 1.135 2021/02/23 11:48:21 aoyama Exp $ */ /* * Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -995,9 +995,9 @@ luna88k_bootstrap() cmmu = &cmmu8820x; /* clear and disable all interrupts */ - *(volatile uint32_t *)INT_ST_MASK0 = - *(volatile uint32_t *)INT_ST_MASK1 = - *(volatile uint32_t *)INT_ST_MASK2 = + *(volatile uint32_t *)INT_ST_MASK0 = 0; + *(volatile uint32_t *)INT_ST_MASK1 = 0; + *(volatile uint32_t *)INT_ST_MASK2 = 0; *(volatile uint32_t *)INT_ST_MASK3 = 0; /* clear software interrupts; just read registers */ -- 2.20.1