From 7c9498f7cba9843286aa0585b1e86b54e05bfc48 Mon Sep 17 00:00:00 2001 From: bjh21 Date: Fri, 25 Aug 2000 16:43:46 +0000 Subject: [PATCH] Move setsoftast() and friends into cpu.h and make them into macros, so arm26 is the same as every other port (except arm32). --- sys/arch/arm26/arm26/except.c | 21 ++------------------- sys/arch/arm26/arm26/stubs.c | 11 ++--------- sys/arch/arm26/include/cpu.h | 29 ++++++++++++++++++++++++++++- sys/arch/arm26/include/intr.h | 13 +------------ 4 files changed, 33 insertions(+), 41 deletions(-) diff --git a/sys/arch/arm26/arm26/except.c b/sys/arch/arm26/arm26/except.c index 5d9768d3ffd3..d89bbb32519c 100644 --- a/sys/arch/arm26/arm26/except.c +++ b/sys/arch/arm26/arm26/except.c @@ -1,4 +1,4 @@ -/* $NetBSD: except.c,v 1.12 2000/08/25 01:04:07 thorpej Exp $ */ +/* $NetBSD: except.c,v 1.13 2000/08/25 16:43:46 bjh21 Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 Ben Harris * All rights reserved. @@ -32,7 +32,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: except.c,v 1.12 2000/08/25 01:04:07 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: except.c,v 1.13 2000/08/25 16:43:46 bjh21 Exp $"); #include "opt_cputypes.h" #include "opt_ddb.h" @@ -697,23 +697,6 @@ ast_handler(struct trapframe *tf) userret(p, pc, sticks); } - - -void -setsoftast() -{ - astpending = 1; -} - -extern int want_resched; /* XXX */ - -void -need_resched(struct cpu_info *ci) -{ - want_resched = 1; - setsoftast(); -} - #ifdef DEBUG static void diff --git a/sys/arch/arm26/arm26/stubs.c b/sys/arch/arm26/arm26/stubs.c index c8c6dde65c3e..08c1c2c6ffeb 100644 --- a/sys/arch/arm26/arm26/stubs.c +++ b/sys/arch/arm26/arm26/stubs.c @@ -1,23 +1,16 @@ -/* $NetBSD: stubs.c,v 1.4 2000/08/20 15:16:52 bjh21 Exp $ */ +/* $NetBSD: stubs.c,v 1.5 2000/08/25 16:43:46 bjh21 Exp $ */ /* * stubs.c -- functions I haven't written yet */ #include -__RCSID("$NetBSD: stubs.c,v 1.4 2000/08/20 15:16:52 bjh21 Exp $"); +__RCSID("$NetBSD: stubs.c,v 1.5 2000/08/25 16:43:46 bjh21 Exp $"); #include #include #include -void -need_proftick(p) - struct proc *p; -{ - panic("need_proftick not implemented"); -} - void resettodr() { diff --git a/sys/arch/arm26/include/cpu.h b/sys/arch/arm26/include/cpu.h index 7aac5536fb79..eec4404983d8 100644 --- a/sys/arch/arm26/include/cpu.h +++ b/sys/arch/arm26/include/cpu.h @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.h,v 1.2 2000/05/26 21:19:30 thorpej Exp $ */ +/* $NetBSD: cpu.h,v 1.3 2000/08/25 16:43:47 bjh21 Exp $ */ /*- * Copyright (c) 1998 Ben Harris * All rights reserved. @@ -54,4 +54,31 @@ extern struct cpu_info cpu_info_store; #define INSN_SIZE 4 +#ifdef _KERNEL +/* ASTs etc */ + +#include +extern int want_resched, astpending; + +#define setsoftast() \ +do { \ + astpending = 1; \ +} while (/* CONSTCOND */ 0) + +#define need_resched(ci) \ +do { \ + want_resched = 1; \ + setsoftast(); \ +} while (/* CONSTCOND */ 0) + +#define need_proftick(p) \ +do { \ + (p)->p_flag |= P_OWEUPC; \ + setsoftast(); \ +} while (/* CONSTCOND */ 0) + +#define signotify(p) setsoftast() + +#endif /* _KERNEL */ + #endif diff --git a/sys/arch/arm26/include/intr.h b/sys/arch/arm26/include/intr.h index bf31b475abda..eaf4ac42eae0 100644 --- a/sys/arch/arm26/include/intr.h +++ b/sys/arch/arm26/include/intr.h @@ -1,4 +1,4 @@ -/* $NetBSD: intr.h,v 1.3 2000/08/25 01:04:07 thorpej Exp $ */ +/* $NetBSD: intr.h,v 1.4 2000/08/25 16:43:47 bjh21 Exp $ */ /*- * Copyright (c) 1998, 2000 Ben Harris * All rights reserved. @@ -100,17 +100,6 @@ extern int hardsplx(int); #define IST_EDGE 2 /* edge-triggered */ #define IST_LEVEL 3 /* level-triggered */ -/* - * Emulated AST handling (faked trap on return to user code) - */ - -#define signotify(p) setsoftast() -extern void setsoftast(void); - -struct cpu_info; -extern void need_resched(struct cpu_info *); -extern void need_proftick(struct proc *); - /* * Soft Interrupts */