clark@ttidca.TTI.COM (Ralph Clark) (08/03/88)
Posting #28 was an AT-only kernel fix to change the use of lock/unlock to use x=lock(); restore(x). Here's the lock/unlock/restore patch for xt_wini.c. The kernel compiles with undefined _unlock without it. -------- this is xt_wini.c.cdif V1.3b ------------------------------- *** xt_wini.c.1.3 Fri Jul 30 20:45:00 1988 --- xt_wini.c Fri Jul 30 20:55:18 1988 *************** *** 249,254 **** --- 249,255 ---- vir_bytes vir, ct; phys_bytes user_phys; extern phys_bytes umap(); + register int old_state; mode = (wn->wn_opcode == DISK_READ ? DMA_READ : DMA_WRITE); vir = (vir_bytes) wn->wn_address; *************** *** 271,277 **** if (top_end != top_addr) panic("Trying to DMA across 64K boundary", top_addr); /* Now set up the DMA registers. */ ! lock(); port_out(DMA_M2, mode); /* set the DMA mode */ port_out(DMA_M1, mode); /* set it again */ port_out(DMA_ADDR, low_addr); /* output low-order 8 bits */ --- 272,278 ---- if (top_end != top_addr) panic("Trying to DMA across 64K boundary", top_addr); /* Now set up the DMA registers. */ ! old_state = lock(); port_out(DMA_M2, mode); /* set the DMA mode */ port_out(DMA_M1, mode); /* set it again */ port_out(DMA_ADDR, low_addr); /* output low-order 8 bits */ *************** *** 279,285 **** port_out(DMA_TOP, top_addr); /* output highest 4 bits */ port_out(DMA_COUNT, low_ct); /* output low 8 bits of count - 1 */ port_out(DMA_COUNT, high_ct); /* output high 8 bits of count - 1 */ ! unlock(); } /*=========================================================================* --- 280,286 ---- port_out(DMA_TOP, top_addr); /* output highest 4 bits */ port_out(DMA_COUNT, low_ct); /* output low 8 bits of count - 1 */ port_out(DMA_COUNT, high_ct); /* output high 8 bits of count - 1 */ ! restore(old_state); } /*=========================================================================* *************** *** 477,488 **** int drive; struct param *paramp; { command[0] = WIN_SPECIFY; /* Specify some parameters */ command[1] = drive << 5; /* Drive number */ if (com_out(NO_DMA_INT) != OK) /* Output command block */ return(ERR); ! lock(); /* No. of cylinders (high byte) */ win_out(paramp->nr_cyl >> 8); --- 478,491 ---- int drive; struct param *paramp; { + register int old_state; + command[0] = WIN_SPECIFY; /* Specify some parameters */ command[1] = drive << 5; /* Drive number */ if (com_out(NO_DMA_INT) != OK) /* Output command block */ return(ERR); ! old_state = lock(); /* No. of cylinders (high byte) */ win_out(paramp->nr_cyl >> 8); *************** *** 507,513 **** /* Ecc burst length */ win_out(paramp->max_ecc); ! unlock(); if (check_init() != OK) { /* See if controller accepted parameters */ w_need_reset = TRUE; --- 510,516 ---- /* Ecc burst length */ win_out(paramp->max_ecc); ! restore(old_state); if (check_init() != OK) { /* See if controller accepted parameters */ w_need_reset = TRUE; *************** *** 596,602 **** { /* Output the command block to the winchester controller and return status */ ! register int i; int r; port_out(WIN_DMA, mode); --- 599,605 ---- { /* Output the command block to the winchester controller and return status */ ! register int i, old_state; int r; port_out(WIN_DMA, mode); *************** *** 613,619 **** } ! lock(); for (i=0; i<6; i++) { if(hd_wait(WST_REQ) != OK) --- 616,622 ---- } ! old_state = lock(); for (i=0; i<6; i++) { if(hd_wait(WST_REQ) != OK) *************** *** 628,634 **** port_out(WIN_DATA, command[i]); } ! unlock(); if(i != 6) { return(ERR); --- 631,637 ---- port_out(WIN_DATA, command[i]); } ! restore(old_state); if(i != 6) { return(ERR); -------------------- end of patch ------------------------------------ -- Ralph Clark (clark@ttidca.tti.com) {csun|philabs|psivax}!ttidca!clark