static int imx_uart_last_close(int major, int minor, void *arg) { #if defined(USE_INTERRUPTS) BSP_remove_rtems_irq_handler(&imx_uart_tx_isr_data[minor]); BSP_remove_rtems_irq_handler(&imx_uart_rx_isr_data[minor]); #endif return 0; }
int timer_instdis(int t, int inst, unsigned period) { rtems_irq_connect_data xx; xx.name = BSP_MISC_IRQ_LOWEST_OFFSET + t; xx.hdl = timer_isr; xx.handle = (rtems_irq_hdl_param)t; xx.on = 0; xx.off = 0; xx.isOn = 0; if ( !inst ) { openpic_maptimer(t, 0); openpic_inittimer(t, 0, 0); } if ( ! ( inst ? BSP_install_rtems_irq_handler(&xx) : BSP_remove_rtems_irq_handler(&xx) ) ) { openpic_maptimer(t, 0); openpic_inittimer(t, 0, 0); fprintf(stderr,"unable to %s timer ISR #%i\n", inst ? "install" : "remove", t); return -1; } if ( inst ) { openpic_maptimer( t, 1 ); openpic_inittimer( t, 8 + t, OPENPIC_VEC_SOURCE - BSP_PCI_IRQ_LOWEST_OFFSET + xx.name ); openpic_settimer( t, period, 1 ); } return 0; }
void ReInstall_clock(void (*new_clock_isr)(void *)) { uint32_t isrlevel = 0; rtems_irq_connect_data clockIrqConnData; rtems_interrupt_disable(isrlevel); clockIrqConnData.name = BSP_PIT; if ( ! BSP_get_current_rtems_irq_handler(&clockIrqConnData)) { printk("Unable to stop system clock\n"); rtems_fatal_error_occurred(1); } BSP_remove_rtems_irq_handler (&clockIrqConnData); clockIrqConnData.on = ClockOn; clockIrqConnData.off = ClockOff; clockIrqConnData.isOn = ClockIsOn; clockIrqConnData.name = BSP_PIT; clockIrqConnData.hdl = new_clock_isr; if (!BSP_install_rtems_irq_handler (&clockIrqConnData)) { printk("Unable to connect Clock Irq handler\n"); rtems_fatal_error_occurred(1); } rtems_interrupt_enable(isrlevel); }
int BSP_disconnect_clock_handler (void) { if (!BSP_get_current_rtems_irq_handler(&clockIrqData)) { printk("Unable to stop system clock\n"); rtems_fatal_error_occurred(1); } return BSP_remove_rtems_irq_handler (&clockIrqData); }
static int release_aux(void) { if (--aux_count) return 0; kbd_write_cmd(AUX_INTS_OFF); /* Disable controller ints */ kbd_write_command_w(KBD_CCMD_MOUSE_DISABLE); BSP_remove_rtems_irq_handler( &ps2_isr_data ); return 0; }
void Clock_exit(void) { rtems_irq_connect_data clockIrqConnData; clockIrqConnData.name = BSP_PIT; if (!BSP_get_current_rtems_irq_handler(&clockIrqConnData)) { printk("Unable to stop system clock\n"); rtems_fatal_error_occurred(1); } BSP_remove_rtems_irq_handler (&clockIrqConnData); }
int BSP_connect_clock_handler (rtems_irq_hdl hdl) { if (!BSP_get_current_rtems_irq_handler(&clockIrqData)) { printk("Unable to get system clock handler\n"); rtems_fatal_error_occurred(1); } if (!BSP_remove_rtems_irq_handler (&clockIrqData)) { printk("Unable to remove current system clock handler\n"); rtems_fatal_error_occurred(1); } /* * Reinit structure */ clockIrqData.name = BSP_PERIODIC_TIMER; clockIrqData.hdl = (rtems_irq_hdl) hdl; clockIrqData.on = (rtems_irq_enable)clockOn; clockIrqData.off = (rtems_irq_enable)clockOff; clockIrqData.isOn = (rtems_irq_is_enabled)clockIsOn; return BSP_install_rtems_irq_handler (&clockIrqData); }
void Clock_exit(void) { ClockOff(&clockIrqData); BSP_remove_rtems_irq_handler (&clockIrqData); }
void cs8900_detach_interrupt (cs8900_device *cs) { BSP_remove_rtems_irq_handler(&cs8900_isr_data); }
NS16550_STATIC void ns16550_cleanup_interrupts(int minor) { #if defined(BSP_FEATURE_IRQ_EXTENSION) rtems_status_code sc = RTEMS_SUCCESSFUL; console_tbl *c = Console_Port_Tbl [minor]; sc = rtems_interrupt_handler_remove( c->ulIntVector, ns16550_isr, (void *) minor ); if (sc != RTEMS_SUCCESSFUL) { /* FIXME */ printk("%s: Error: Remove interrupt handler\n", __func__); rtems_fatal_error_occurred(0xdeadbeef); } #elif defined(BSP_FEATURE_IRQ_LEGACY) int rv = 0; console_tbl *c = Console_Port_Tbl [minor]; rtems_irq_connect_data cd = { .name = c->ulIntVector, .hdl = ns16550_isr, .handle = (void *) minor }; rv = BSP_remove_rtems_irq_handler(&cd); if (rv == 0) { /* FIXME */ printk("%s: Error: Remove interrupt handler\n", __func__); rtems_fatal_error_occurred(0xdeadbeef); } #endif } /* * ns16550_write_support_polled * * Console Termios output entry point. * */ ssize_t ns16550_write_support_polled( int minor, const char *buf, size_t len ) { int nwrite = 0; /* * poll each byte in the string out of the port. */ while (nwrite < len) { /* * transmit character */ ns16550_write_polled(minor, *buf++); nwrite++; } /* * return the number of bytes written. */ return nwrite; }
/* * disable clock. */ void Clock_driver_support_shutdown_hardware (void) { BSP_remove_rtems_irq_handler (&clock_isr_data); TIMER_CR (0) &= ~(TIMER_ENABLE); }
static void Clock_driver_support_shutdown_hardware( void ) { BSP_remove_rtems_irq_handler(&clock_isr_data); }
static int serial_mouse_last_close(int major, int minor, void *arg) { BSP_remove_rtems_irq_handler( &serial_mouse_isr_data ); return 0; }
int NET_EMBEMB(rtems_,NETDRIVER_PREFIX,_attach) (struct rtems_bsdnet_ifconfig *config, int attaching) { int error = 0; device_t dev = net_dev_get(config); struct NET_SOFTC *sc; struct ifnet *ifp; #ifndef HAVE_LIBBSPEXT rtems_irq_connect_data irq_data = { 0, the_net_isr, #if ISMINVERSION(4,6,99) 0, #endif noop, noop, noop1 }; #endif if ( !dev ) return 1; if ( !dev->d_softc.NET_SOFTC_BHANDLE_FIELD ) { #if defined(NETDRIVER_PCI) device_printf(dev,NETDRIVER" unit not configured; executing setup..."); /* setup should really be performed prior to attaching. * Wipe the device; setup and re-obtain the device... */ memset(dev,0,sizeof(*dev)); error = NET_EMBEMB(rtems_,NETDRIVER_PREFIX,_pci_setup)(-1); /* re-obtain the device */ dev = net_dev_get(config); if ( !dev ) { printk("Unable to re-assign device structure???\n"); return 1; } if (error <= 0) { device_printf(dev,NETDRIVER" FAILED; unable to attach interface, sorry\n"); return 1; } device_printf(dev,"success\n"); #else device_printf(dev,NETDRIVER" unit not configured; use 'rtems_"NETDRIVER"_setup()'\n"); return 1; #endif } if ( !net_driver_ticks_per_sec ) rtems_clock_get( RTEMS_CLOCK_GET_TICKS_PER_SECOND, &net_driver_ticks_per_sec ); sc = device_get_softc( dev ); ifp = &sc->arpcom.ac_if; #ifdef DEBUG_MODULAR if (!METHODSPTR) { device_printf(dev,NETDRIVER": method pointer not set\n"); return -1; } #endif if ( attaching ) { if ( ifp->if_init ) { device_printf(dev,NETDRIVER" Driver already attached.\n"); return -1; } if ( config->hardware_address ) { /* use configured MAC address */ memcpy(sc->arpcom.ac_enaddr, config->hardware_address, ETHER_ADDR_LEN); } else { #ifdef NET_READ_MAC_ADDR NET_READ_MAC_ADDR(sc); #endif } if ( METHODSPTR->n_attach(dev) ) { device_printf(dev,NETDRIVER"_attach() failed\n"); return -1; } } else { if ( !ifp->if_init ) { device_printf(dev,NETDRIVER" Driver not attached.\n"); return -1; } if ( METHODSPTR->n_detach ) { if ( METHODSPTR->n_detach(dev) ) { device_printf(dev,NETDRIVER"_detach() failed\n"); return -1; } } else { device_printf(dev,NETDRIVER"_detach() not implemented\n"); return -1; } } if ( !sc->tid ) sc->tid = rtems_bsdnet_newproc(NETDRIVER"d", 4096, net_daemon, sc); if (attaching) { #ifdef DEBUG printf("Installing IRQ # %i\n",sc->irq_no); #endif #ifdef HAVE_LIBBSPEXT if ( bspExtInstallSharedISR(sc->irq_no, the_net_isr, sc, 0) ) #else /* BSP dependent :-( */ irq_data.name = sc->irq_no; #if ISMINVERSION(4,6,99) irq_data.handle = (rtems_irq_hdl_param)sc; #else thesc = sc; #endif if ( ! BSP_install_rtems_irq_handler( &irq_data ) ) #endif { fprintf(stderr,NETDRIVER": unable to install ISR\n"); error = -1; } } else { if ( sc->irq_no ) { #ifdef DEBUG printf("Removing IRQ # %i\n",sc->irq_no); #endif #ifdef HAVE_LIBBSPEXT if (bspExtRemoveSharedISR(sc->irq_no, the_net_isr, sc)) #else /* BSP dependent :-( */ irq_data.name = sc->irq_no; #if ISMINVERSION(4,6,99) irq_data.handle = (rtems_irq_hdl_param)sc; #endif if ( ! BSP_remove_rtems_irq_handler( &irq_data ) ) #endif { fprintf(stderr,NETDRIVER": unable to uninstall ISR\n"); error = -1; } } } return error; }
static int console_last_close(int major, int minor, void *arg) { BSP_remove_rtems_irq_handler (&console_isr_data); return 0; }