1/*- 2 * Copyright (c) 1990 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * William Jolitz. 7 * 8 * %sccs.include.386.c% 9 * 10 * @(#)icu.s 5.1 (Berkeley) 04/24/90 11 */ 12 13/* 14 * AT/386 15 * Vector interrupt control section 16 * W. Jolitz 8/89 17 */ 18 19 .data 20 .globl _imen 21 .globl _cpl 22_cpl: .long 15 # current priority level (all off) 23_imen: .long 0xffff # interrupt mask enable (all off) 24 .text 25 26 .globl _iml0 # masks off all interrupts 27 .globl _splhigh 28 .globl _splclock 29 .globl _spl6 30_iml0: 31_spl6: 32_splhigh: 33_splclock: 34 cli # disable interrupts 35 movw $0xffff,%ax # set new priority level 36 movw %ax,%dx 37 orw _imen,%ax # mask off those not enabled yet 38 movw %ax,%cx 39 NOP 40 outb %al,$0x21 /* update icu's */ 41 NOP 42 movb %ah,%al 43 NOP 44 outb %al,$0xA1 45 NOP 46 movzwl _cpl,%eax # return old priority 47 movw %dx,_cpl # set new priority level 48# sti # enable interrupts 49 ret 50 51 .globl _iml1 # mask off all but irq0 52 .globl _spltty # block clists 53_iml1: 54_spltty: 55 cli # disable interrupts 56 movw $0xfffe,%ax # set new priority level 57 movw %ax,%dx 58 orw _imen,%ax # mask off those not enabled yet 59 movw %ax,%cx 60 NOP 61 outb %al,$0x21 /* update icu's */ 62 NOP 63 movb %ah,%al 64 NOP 65 outb %al,$0xA1 66 NOP 67 movzwl _cpl,%eax # return old priority 68 movw %dx,_cpl # set new priority level 69# sti # enable interrupts 70 ret 71 72 .globl _iml8 # mask off all but irq0-1 73_iml8: 74 cli # disable interrupts 75 movw $0xfffc,%ax # set new priority level 76 movw %ax,%dx 77 orw _imen,%ax # mask off those not enabled yet 78 movw %ax,%cx 79 NOP 80 outb %al,$0x21 /* update icu's */ 81 NOP 82 movb %ah,%al 83 NOP 84 outb %al,$0xA1 85 NOP 86 movzwl _cpl,%eax # return old priority 87 movw %dx,_cpl # set new priority level 88# sti # enable interrupts 89 ret 90 91 .globl _iml9 # mask off all but irq0-1,8 92 .globl _iml2 # alias for PC hardware level 2 93 .globl _splimp 94 .globl _splnet 95_iml9: 96_iml2: 97_splimp: 98_splnet: 99 cli # disable interrupts 100 movw $0xfef8,%ax # set new priority level 101 movw %ax,%dx 102 orw _imen,%ax # mask off those not enabled yet 103 movw %ax,%cx 104 NOP 105 outb %al,$0x21 /* update icu's */ 106 NOP 107 movb %ah,%al 108 NOP 109 outb %al,$0xA1 110 NOP 111 movzwl _cpl,%eax # return old priority 112 movw %dx,_cpl # set new priority level 113# sti # enable interrupts 114 ret 115 116 .globl _iml10 # mask off all but irq0-1,8-9 117_iml10: 118 cli # disable interrupts 119 movw $0xfcf8,%ax # set new priority level 120 movw %ax,%dx 121 orw _imen,%ax # mask off those not enabled yet 122 movw %ax,%cx 123 NOP 124 outb %al,$0x21 /* update icu's */ 125 NOP 126 movb %ah,%al 127 NOP 128 outb %al,$0xA1 129 NOP 130 movzwl _cpl,%eax # return old priority 131 movw %dx,_cpl # set new priority level 132 sti # enable interrupts 133 ret 134 135 .globl _iml11 # mask off all but irq0-1,8-10 136_iml11: 137 cli # disable interrupts 138 movw $0xf8f8,%ax # set new priority level 139 movw %ax,%dx 140 orw _imen,%ax # mask off those not enabled yet 141 movw %ax,%cx 142 NOP 143 outb %al,$0x21 /* update icu's */ 144 NOP 145 movb %ah,%al 146 NOP 147 outb %al,$0xA1 148 NOP 149 movzwl _cpl,%eax # return old priority 150 movw %dx,_cpl # set new priority level 151 sti # enable interrupts 152 ret 153 154 .globl _iml12 # mask off all but irq0-1,8-11 155_iml12: 156 cli # disable interrupts 157 movw $0xf0f8,%ax # set new priority level 158 movw %ax,%dx 159 orw _imen,%ax # mask off those not enabled yet 160 movw %ax,%cx 161 NOP 162 outb %al,$0x21 /* update icu's */ 163 NOP 164 movb %ah,%al 165 NOP 166 outb %al,$0xA1 167 NOP 168 movzwl _cpl,%eax # return old priority 169 movw %dx,_cpl # set new priority level 170 sti # enable interrupts 171 ret 172 173 .globl _iml13 # mask off all but irq0-1,8-12 174_iml13: 175 cli # disable interrupts 176 movw $0xe0f8,%ax # set new priority level 177 movw %ax,%dx 178 orw _imen,%ax # mask off those not enabled yet 179 movw %ax,%cx 180 NOP 181 outb %al,$0x21 /* update icu's */ 182 NOP 183 movb %ah,%al 184 NOP 185 outb %al,$0xA1 186 NOP 187 movzwl _cpl,%eax # return old priority 188 movw %dx,_cpl # set new priority level 189 sti # enable interrupts 190 ret 191 192 .globl _iml14 # mask off all but irq0-1,8-13 193 .globl _splbio 194_iml14: 195_splbio: 196 cli # disable interrupts 197 movw $0xc0f8,%ax # set new priority level 198 movw %ax,%dx 199 orw _imen,%ax # mask off those not enabled yet 200 movw %ax,%cx 201 NOP 202 outb %al,$0x21 /* update icu's */ 203 NOP 204 movb %ah,%al 205 NOP 206 outb %al,$0xA1 207 NOP 208 movzwl _cpl,%eax # return old priority 209 movw %dx,_cpl # set new priority level 210# sti # enable interrupts 211 ret 212 213 .globl _iml15 # mask off all but irq0-1,8-14 214_iml15: 215 cli # disable interrupts 216 movw $0x80f8,%ax # set new priority level 217 movw %ax,%dx 218 orw _imen,%ax # mask off those not enabled yet 219 movw %ax,%cx 220 NOP 221 outb %al,$0x21 /* update icu's */ 222 NOP 223 movb %ah,%al 224 NOP 225 outb %al,$0xA1 226 NOP 227 movzwl _cpl,%eax # return old priority 228 movw %dx,_cpl # set new priority level 229 sti # enable interrupts 230 ret 231 232 .globl _iml3 # mask off all but irq0-1,8-15 233_iml3: 234 cli # disable interrupts 235 movw $0x00f8,%ax # set new priority level 236 movw %ax,%dx 237 orw _imen,%ax # mask off those not enabled yet 238 movw %ax,%cx 239 NOP 240 outb %al,$0x21 /* update icu's */ 241 NOP 242 movb %ah,%al 243 NOP 244 outb %al,$0xA1 245 NOP 246 movzwl _cpl,%eax # return old priority 247 movw %dx,_cpl # set new priority level 248 sti # enable interrupts 249 ret 250 251 .globl _iml4 # mask off all but irq0-1,8-15,3 252_iml4: 253 cli # disable interrupts 254 movw $0x00f0,%ax # set new priority level 255 movw %ax,%dx 256 orw _imen,%ax # mask off those not enabled yet 257 movw %ax,%cx 258 NOP 259 outb %al,$0x21 /* update icu's */ 260 NOP 261 movb %ah,%al 262 NOP 263 outb %al,$0xA1 264 NOP 265 movzwl _cpl,%eax # return old priority 266 movw %dx,_cpl # set new priority level 267 sti # enable interrupts 268 ret 269 270 .globl _iml5 # mask off all but irq0-1,8-15,3-4 271_iml5: 272 cli # disable interrupts 273 movw $0x00e0,%ax # set new priority level 274 movw %ax,%dx 275 orw _imen,%ax # mask off those not enabled yet 276 movw %ax,%cx 277 NOP 278 outb %al,$0x21 /* update icu's */ 279 NOP 280 movb %ah,%al 281 NOP 282 outb %al,$0xA1 283 NOP 284 movzwl _cpl,%eax # return old priority 285 movw %dx,_cpl # set new priority level 286 sti # enable interrupts 287 ret 288 289 .globl _iml6 # mask off all but irq0-1,8-15,3-5 290_iml6: 291 cli # disable interrupts 292 movw $0x00c0,%ax # set new priority level 293 movw %ax,%dx 294 orw _imen,%ax # mask off those not enabled yet 295 movw %ax,%cx 296 NOP 297 outb %al,$0x21 /* update icu's */ 298 NOP 299 movb %ah,%al 300 NOP 301 outb %al,$0xA1 302 NOP 303 movzwl _cpl,%eax # return old priority 304 movw %dx,_cpl # set new priority level 305 sti # enable interrupts 306 ret 307 308 .globl _iml7,_splsoftclock # mask off all but irq0-1,8-15,3-7 309_iml7: 310_splsoftclock: 311 cli # disable interrupts 312 movw $0x0080,%ax # set new priority level 313 movw %ax,%dx 314 orw _imen,%ax # mask off those not enabled yet 315 movw %ax,%cx 316 NOP 317 outb %al,$0x21 /* update icu's */ 318 NOP 319 movb %ah,%al 320 NOP 321 outb %al,$0xA1 322 NOP 323 movzwl _cpl,%eax # return old priority 324 movw %dx,_cpl # set new priority level 325# sti # enable interrupts 326 ret 327 328 .globl _imlnone # masks off no interrupts 329 .globl _splnone 330 .globl _spl0 331_imlnone: 332_splnone: 333_spl0: 334 cli # disable interrupts 335 movw $0,%ax # set new priority level 336 movw %ax,%dx 337 orw _imen,%ax # mask off those not enabled yet 338 movw %ax,%cx 339 NOP 340 outb %al,$0x21 /* update icu's */ 341 NOP 342 movb %ah,%al 343 NOP 344 outb %al,$0xA1 345 NOP 346 movzwl _cpl,%eax # return old priority 347 movw %dx,_cpl # set new priority level 348 sti # enable interrupts 349 ret 350 351 .globl _splx 352_splx: 353 cli # disable interrupts 354 movw 4(%esp),%ax # new priority level 355 movw %ax,%dx 356 orw _imen,%ax # mask off those not enabled yet 357 movw %ax,%cx 358 NOP 359 outb %al,$0x21 /* update icu's */ 360 NOP 361 movb %ah,%al 362 NOP 363 outb %al,$0xA1 364 NOP 365 movzwl _cpl,%eax # return old priority 366 movw %dx,_cpl # set new priority level 367 cmpw $0,%dx # XXX 368 jne 1f # XXX 369 sti # enable interrupts 3701: 371 ret 372