diff options
author | Megan Wachs <megan@sifive.com> | 2016-12-01 14:17:20 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-01 14:17:20 -0800 |
commit | 66c882e380656d45dec9019255d7a1106bb1f5ff (patch) | |
tree | 530a4bf5eaf3370a829cd87d3e8179ac921c829f /software/demo_gpio | |
parent | ae5f878d6acadabaa671a7a30b87e16eb1d718a7 (diff) |
Add missing file (#12)
Diffstat (limited to 'software/demo_gpio')
-rw-r--r-- | software/demo_gpio/plic_driver.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/software/demo_gpio/plic_driver.h b/software/demo_gpio/plic_driver.h new file mode 100644 index 0000000..66410be --- /dev/null +++ b/software/demo_gpio/plic_driver.h @@ -0,0 +1,46 @@ +// See LICENSE file for licence details + +#ifndef PLIC_DRIVER_H +#define PLIC_DRIVER_H + +#include "platform.h" + +typedef struct __plic_instance_t +{ + uintptr_t base_addr; + + uint32_t num_sources; + uint32_t num_priorities; + +} plic_instance_t; + +typedef uint32_t plic_source; +typedef uint32_t plic_priority; +typedef uint32_t plic_threshold; + +void PLIC_init ( + plic_instance_t * this_plic, + uintptr_t base_addr, + uint32_t num_sources, + uint32_t num_priorities + ); + +void PLIC_set_threshold (plic_instance_t * this_plic, + plic_threshold threshold); + +void PLIC_enable_interrupt (plic_instance_t * this_plic, + plic_source source); + +void PLIC_disable_interrupt (plic_instance_t * this_plic, + plic_source source); + +void PLIC_set_priority (plic_instance_t * this_plic, + plic_source source, + plic_priority priority); + +plic_source PLIC_claim_interrupt(plic_instance_t * this_plic); + +void PLIC_complete_interrupt(plic_instance_t * this_plic, + plic_source source); + +#endif |