-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmacdev.c
executable file
·52 lines (45 loc) · 1.06 KB
/
macdev.c
1
/*MAC Psuedo Device for Mac -> Vax communication*/#include <types.h>#define _MACDEV_C_#include "mmemory.h"#include "macdev.h"#pragma segment MAC_DEVICElong set_macvax_interrupt( long command){ /*Set up an interrupt*/ IPR(MVCR) = (unsigned long)command; /*Check for overflow*/ if(IPR(MVCS) & MVCS_INT_BIT) IPR(MVCS) |= MVCS_ERR_BIT; else /*Set the Interrupt bit*/ IPR(MVCS) |= MVCS_INT_BIT; if(MVCS_INT_ENB(IPR(MVCS)) == 0) { /*system doesn't want interrupts*/ return 0; } else { /*Set up the interrupt*/ IPR(SISR) |= MACVAX_INTERRUPT_BIT; /*IPL 23*/ return 1; }}void clear_macvax_interrupt(void){ /*clear the MVCS registers interrupt bit, leaving the system SISR alone */ /*We can't alter the SISR as something else might have requested a level*/ /* 23 interrupt */ IPR(MVCS) &= ~MVCS_INT_BIT;}/*return vector address for MACVAX interrupt*/address macvax_interrupt(void){ if(MVCS_INT( IPR(MVCS) ) == 0) /*covers the case where we cancel the interrupt*/ return (address) 0; else return (address) V_MACVAX;}