XenevaOS
Loading...
Searching...
No Matches
Classes | Typedefs | Functions
gic.h File Reference
#include <aa64hcode.h>
#include <stdint.h>
#include <aurora.h>
Include dependency graph for gic.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _gic_
 

Typedefs

typedef struct _gic_ GIC
 

Functions

GICAuGetSystemGIC ()
 
void GICInitialize ()
 GICInitialize – initialize the gic controller, it can be parsed through ACPI MADT or hard-coding.
 
AU_EXTERN AU_EXPORT void GICEnableIRQ (uint32_t irq)
 
void GICEnableSPIIRQ (uint32_t irq)
 GICEnableIRQ – enable an SPI IRQ.
 
AU_EXTERN AU_EXPORT void GICClearPendingIRQ (uint32_t irq)
 
uint32_t GICReadIAR ()
 GICReadIAR – read interrupt acknowledge register.
 
void GICCheckPending (uint32_t irq)
 
uint64_t AuGICGetMSIAddress (int interruptID)
 AuGICGetMSIAddress – calculate and return MSI address for given spi offset.
 
uint32_t AuGICGetMSIData (int interruptID)
 AuGICGetMSIData – obtains composited MSI data address of respected interruptID, useful in PCIe.
 
int AuGICAllocateSPI ()
 AuGICAllocateSPI – allocates Shared Peripheral interrupt ID.
 
void AuGICDeallocateSPI (int spiID)
 AuGICDeallocateSPI – free up an used SPI id.
 
void GICSendEOI (uint32_t irqnum)
 GICSendEOI –sends end of interrupt to GIC cpu interface.
 
void GICSetupTimer ()
 
void GICSetTargetCPU (int spi)
 
void GICRegisterSPIHandler (void *fptr, int spi)
 GICRegisterSPIHandler – register a spi handler to callback list.
 
void GICCallSPIHandler (int spi)
 GICCallSPIHandler – jump to a callback handler associated with given spi number.
 

Detailed Description

BSD 2-Clause License

Copyright (c) 2022-2025, Manas Kamal Choudhury All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Typedef Documentation

◆ GIC

typedef struct _gic_ GIC

Function Documentation

◆ AuGetSystemGIC()

GIC * AuGetSystemGIC ( )

◆ AuGICAllocateSPI()

int AuGICAllocateSPI ( )
extern

AuGICAllocateSPI – allocates Shared Peripheral interrupt ID.

◆ AuGICDeallocateSPI()

void AuGICDeallocateSPI ( int  spiID)
extern

AuGICDeallocateSPI – free up an used SPI id.

Parameters
spiID– target spi id

◆ AuGICGetMSIAddress()

uint64_t AuGICGetMSIAddress ( int  interruptID)
extern

AuGICGetMSIAddress – calculate and return MSI address for given spi offset.

Parameters
interruptID– spi offset
Returns
composited MSI address

◆ AuGICGetMSIData()

uint32_t AuGICGetMSIData ( int  interruptID)
extern

AuGICGetMSIData – obtains composited MSI data address of respected interruptID, useful in PCIe.

Parameters
interruptID– interrupt ID of device

◆ GICCallSPIHandler()

void GICCallSPIHandler ( int  spi)
extern

GICCallSPIHandler – jump to a callback handler associated with given spi number.

Parameters
spi– SPI number

◆ GICCheckPending()

void GICCheckPending ( uint32_t  irq)
extern

◆ GICClearPendingIRQ()

AU_EXTERN AU_EXPORT void GICClearPendingIRQ ( uint32_t  irq)

◆ GICEnableIRQ()

AU_EXTERN AU_EXPORT void GICEnableIRQ ( uint32_t  irq)

@briefGICEnableIRQ – enable an IRQ

Parameters
irq– IRQ number

◆ GICEnableSPIIRQ()

void GICEnableSPIIRQ ( uint32_t  irq)
extern

GICEnableIRQ – enable an SPI IRQ.

Parameters
irq– IRQ number

GICEnableIRQ – enable an SPI IRQ.

Parameters
irq– IRQ number

◆ GICInitialize()

void GICInitialize ( )
extern

GICInitialize – initialize the gic controller, it can be parsed through ACPI MADT or hard-coding.

◆ GICReadIAR()

uint32_t GICReadIAR ( )
extern

GICReadIAR – read interrupt acknowledge register.

◆ GICRegisterSPIHandler()

void GICRegisterSPIHandler ( void *  fptr,
int  spi 
)
extern

GICRegisterSPIHandler – register a spi handler to callback list.

Parameters
fptr– SPI Callback address
spi– SPI number

◆ GICSendEOI()

void GICSendEOI ( uint32_t  irqnum)
extern

GICSendEOI –sends end of interrupt to GIC cpu interface.

Parameters
irqnum– interrupt ID of the device

◆ GICSetTargetCPU()

void GICSetTargetCPU ( int  spi)
extern

◆ GICSetupTimer()

void GICSetupTimer ( )
extern