Skip to content
Snippets Groups Projects
Select Git revision
  • 61ad0c0efa4b8cde9296f6431d3dc470a474fee3
  • master default protected
  • replication_test
  • release-1.10 protected
  • dev protected
  • 556-usage-statistics
  • 553-semantic-recommendation-2
  • 553-semantic-recommendation
  • release-1.9 protected
  • 551-init-broker-service-permissions
  • 549-test-oai-pmh
  • 545-saving-multiple-times-breaks-pid-metadata
  • 499-standalone-compute-service-2
  • 539-load-tests
  • hotfix/helm-chart
  • luca_ba_new_interface
  • 534-bug-when-adding-access-to-user-that-is-not-registered-at-dashboard-service
  • release-1.8 protected
  • 533-integrate-semantic-recommendation
  • feature/openshift
  • 518-spark-doesn-t-map-the-headers-correct
  • v1.10.4 protected
  • v1.10.3 protected
  • v1.10.2 protected
  • v1.10.1 protected
  • v1.10.0-rc13 protected
  • v1.10.0-rc12 protected
  • v1.10.0-rc11 protected
  • v1.10.0-rc10 protected
  • v1.10.0-rc9 protected
  • v1.10.0-rc8 protected
  • v1.10.0-rc7 protected
  • v1.10.0-rc6 protected
  • v1.10.0-rc5 protected
  • v1.10.0-rc4 protected
  • v1.10.0-rc3 protected
  • v1.10.0-rc2 protected
  • v1.10.0rc1 protected
  • v1.10.0rc0 protected
  • v1.10.0 protected
  • v1.9.3 protected
41 results

app.py

Blame
  • irq.c 1.73 KiB
    /**
     * @file kernel/irq.c
     * @author Armin Luntzer (armin.luntzer@univie.ac.at)
     *
     * @ingroup irq
     * @defgroup irq IRQ interface
     *
     * @brief kernel IRQ interface
     *
     * this implements the high-level IRQ logic (which is admittedly not very
     * thought-through)
     */
    
    
    #include <errno.h>
    #include <kernel/irq.h>
    #include <kernel/export.h>
    
    static struct irq_dev *irq_ctrl;
    
    
    /**
     * @brief request a slot for an interrupt handler
     */
    
    int irq_request(unsigned int irq, enum isr_exec_priority priority,
    		irq_handler_t handler, void *data)
    {
    	struct irq_data cfg;
    
    
    	if (!irq_ctrl)
    		return -EINVAL;
    
    	if (!irq_ctrl->irq_enable)
    		return -EINVAL;
    
    	cfg.irq      = irq;
    	cfg.priority = priority;
    	cfg.handler  = handler;
    	cfg.data     = data;
    
    	return irq_ctrl->irq_enable(&cfg);
    }
    EXPORT_SYMBOL(irq_request);
    
    /**
     * @brief release an interrupt handler
     */
    
    int irq_free(unsigned int irq, irq_handler_t handler, void *data)
    {
    	struct irq_data cfg;
    
    
    	if (!irq_ctrl)
    		return -EINVAL;
    
    	if (!irq_ctrl->irq_disable)
    		return -EINVAL;
    
    	cfg.irq      = irq;
    	cfg.handler  = handler;
    	cfg.data     = data;
    
    	irq_ctrl->irq_disable(&cfg);
    
    	return 0;
    }
    EXPORT_SYMBOL(irq_free);
    
    
    /**
     * @brief execute deferred interrupt handlers
     */
    
    int irq_exec_deferred(void)
    {
    	if (!irq_ctrl)
    		return -EINVAL;
    
    	if (irq_ctrl->irq_deferred)
    		irq_ctrl->irq_deferred();
    
    	return 0;
    }
    EXPORT_SYMBOL(irq_exec_deferred);
    
    
    /**
     * @brief set CPU affinity to a particular CPU (in SMP)
     */
    
    int irq_set_affinity(unsigned int irq, int cpu)
    {
    	if (!irq_ctrl)
    		return -EINVAL;
    
    	if (irq_ctrl->irq_set_affinity)
    		irq_ctrl->irq_set_affinity(irq, cpu);
    
    	return 0;
    
    }
    EXPORT_SYMBOL(irq_set_affinity);
    
    /**
     * @brief initialise the IRQ system
     */
    
    void irq_init(struct irq_dev *dev)
    {
    	irq_ctrl = dev;
    }