summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2011-01-11 22:15:30 +0000
committerjhb <jhb@FreeBSD.org>2011-01-11 22:15:30 +0000
commitb8525325b4b77c78808cba393c046e7ed86b5609 (patch)
tree3cc20fbd6c4745937f42045e9f4cbed448b7b9cd
parent624ce4a8a0707a5354fc77837fe5697f9bf8b07c (diff)
downloadFreeBSD-src-b8525325b4b77c78808cba393c046e7ed86b5609.zip
FreeBSD-src-b8525325b4b77c78808cba393c046e7ed86b5609.tar.gz
- Retire some unused ithread priorities: PI_TTYHIGH, PI_TAPE, and
PI_DISKLOW. While here, rename PI_TTYLOW to PI_TTY. - Add a macro PI_SWI() that takes a SWI_* constant as an argument and returns the suitable thread priority.
-rw-r--r--sys/kern/kern_intr.c19
-rw-r--r--sys/sys/priority.h14
2 files changed, 11 insertions, 22 deletions
diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c
index 2ebb056..ea1aa1b 100644
--- a/sys/kern/kern_intr.c
+++ b/sys/kern/kern_intr.c
@@ -130,22 +130,18 @@ intr_priority(enum intr_type flags)
INTR_TYPE_CAM | INTR_TYPE_MISC | INTR_TYPE_CLK | INTR_TYPE_AV);
switch (flags) {
case INTR_TYPE_TTY:
- pri = PI_TTYLOW;
+ pri = PI_TTY;
break;
case INTR_TYPE_BIO:
- /*
- * XXX We need to refine this. BSD/OS distinguishes
- * between tape and disk priorities.
- */
pri = PI_DISK;
break;
case INTR_TYPE_NET:
pri = PI_NET;
break;
case INTR_TYPE_CAM:
- pri = PI_DISK; /* XXX or PI_CAM? */
+ pri = PI_DISK;
break;
- case INTR_TYPE_AV: /* Audio/video */
+ case INTR_TYPE_AV:
pri = PI_AV;
break;
case INTR_TYPE_CLK:
@@ -1082,7 +1078,7 @@ swi_add(struct intr_event **eventp, const char *name, driver_intr_t handler,
*eventp = ie;
}
error = intr_event_add_handler(ie, name, NULL, handler, arg,
- (pri * RQ_PPQ) + PI_SOFT, flags, cookiep);
+ PI_SWI(pri), flags, cookiep);
if (error)
return (error);
if (pri == SWI_CLOCK) {
@@ -1656,18 +1652,13 @@ db_dump_intrhand(struct intr_handler *ih)
case PI_AV:
db_printf("AV ");
break;
- case PI_TTYHIGH:
- case PI_TTYLOW:
+ case PI_TTY:
db_printf("TTY ");
break;
- case PI_TAPE:
- db_printf("TAPE");
- break;
case PI_NET:
db_printf("NET ");
break;
case PI_DISK:
- case PI_DISKLOW:
db_printf("DISK");
break;
case PI_DULL:
diff --git a/sys/sys/priority.h b/sys/sys/priority.h
index e05bd4d..a7aaedd 100644
--- a/sys/sys/priority.h
+++ b/sys/sys/priority.h
@@ -85,14 +85,12 @@
#define PI_REALTIME (PRI_MIN_ITHD + 0)
#define PI_AV (PRI_MIN_ITHD + 4)
-#define PI_TTYHIGH (PRI_MIN_ITHD + 8)
-#define PI_TAPE (PRI_MIN_ITHD + 12)
-#define PI_NET (PRI_MIN_ITHD + 16)
-#define PI_DISK (PRI_MIN_ITHD + 20)
-#define PI_TTYLOW (PRI_MIN_ITHD + 24)
-#define PI_DISKLOW (PRI_MIN_ITHD + 28)
-#define PI_DULL (PRI_MIN_ITHD + 32)
-#define PI_SOFT (PRI_MIN_ITHD + 36)
+#define PI_NET (PRI_MIN_ITHD + 8)
+#define PI_DISK (PRI_MIN_ITHD + 12)
+#define PI_TTY (PRI_MIN_ITHD + 16)
+#define PI_DULL (PRI_MIN_ITHD + 20)
+#define PI_SOFT (PRI_MIN_ITHD + 24)
+#define PI_SWI(x) (PI_SOFT + (x) * RQ_PPQ)
#define PRI_MIN_KERN (64)
#define PRI_MAX_KERN (PRI_MIN_REALTIME - 1)
OpenPOWER on IntegriCloud