XenevaOS
Loading...
Searching...
No Matches
aucomponent.h
Go to the documentation of this file.
1
10#ifndef __AU_COMPONENT_H__
11#define __AU_COMPONENT_H__
12
13#include <stdint.h>
14#include <stddef.h>
15#include <audrv.h>
16#include <drvctl.h>
17
19 AU_RES_IRQ_SPI = 1, /* value = SPI number registered via GICRegisterSPIHandler */
20 AU_RES_PHYS_PAGE = 2, /* value = physical page from AuPmmngrAllocPage */
21 AU_RES_PHYS_RUN = 3, /* value = physical base from AuPmmngrAllocPages */
22 AU_RES_MMIO = 4, /* value = virtual base, extra = physical base, extra2 = page count */
23};
24
32
33/* find the loaded driver whose image contains `addr` (NULL if none) */
35extern AuDriver* AuDriverFindByName(const char* name);
36
37/* hold / release a driver so it cannot be unloaded while in use */
38extern int AuDriverRef(AuDriver* drv);
39extern void AuDriverUnref(AuDriver* drv);
40
41/* record / forget a resource owned by a driver */
44/* forget a resource whichever driver holds it (memory can change hands) */
46
47/* kernel symbols a driver imports can be replaced by tracking wrappers;
48 * returns NULL when `name` is not overridden (see pe.c AuGetProcAddress) */
49extern void* AuDriverImportOverride(const char* name);
50
51/* load (or reload after an unload) a driver by name and run its AuDriverMain */
52extern int AuDriverLoadByName(const char* name);
53
54/* true when a loaded driver, or a built-in one (aubuiltin.h), owns this PCI function */
55extern bool AuDriverClaimsPci(int bus, int dev, int func);
56
57/* /dev/drvctl: write "unload NAME", "load NAME" or "list" */
58extern void AuDriverCtlInitialize(void);
59
60/* unload a running driver: veto check, AuDriverUnload(), release tracked
61 * resources, unmap and free the image, return its region to the free list */
62extern int AuDriverUnload(AuDriver* drv);
63extern int AuDriverUnloadByName(const char* name);
64
65#endif
unsigned char uint8_t
Definition acefiex.h:161
COMPILER_DEPENDENT_UINT64 uint64_t
Definition acefiex.h:165
AU_EXTERN AU_EXPORT int AuDriverUnload()
Definition ahci.cpp:112
AuDriver * AuDriverFindByName(const char *name)
Definition audrv.c:866
AuResKind
Definition aucomponent.h:18
@ AU_RES_IRQ_SPI
Definition aucomponent.h:19
@ AU_RES_PHYS_RUN
Definition aucomponent.h:21
@ AU_RES_MMIO
Definition aucomponent.h:22
@ AU_RES_PHYS_PAGE
Definition aucomponent.h:20
bool AuDriverClaimsPci(int bus, int dev, int func)
Definition audrv.c:1105
void AuDriverUnref(AuDriver *drv)
Definition audrv.c:876
AuDriver * AuDriverOwnerOf(uint64_t addr)
AuDriverOwnerOf – the loaded driver whose image contains addr.
Definition audrv.c:843
void * AuDriverImportOverride(const char *name)
Definition audrv.c:989
int AuDriverRef(AuDriver *drv)
Definition audrv.c:870
int AuDriverLoadByName(const char *name)
AuDriverLoadByName – (re)load a driver that is not currently loaded, then run its AuDriverMain....
Definition audrv.c:1080
void AuDriverUntrackAny(uint8_t kind, uint64_t value)
Definition audrv.c:910
struct _au_resource_ AuResource
void AuDriverUntrack(AuDriver *drv, uint8_t kind, uint64_t value)
Definition audrv.c:895
int AuDriverUnloadByName(const char *name)
Definition audrv.c:1072
void AuDriverTrack(AuDriver *drv, uint8_t kind, uint64_t value, uint64_t extra, uint64_t extra2)
Definition audrv.c:881
void AuDriverCtlInitialize(void)
Definition audrv.c:1188
struct drm_crtc struct drm_plane struct drm_plane const struct drm_crtc_funcs const char * name
Definition drm_crtc.h:1242
const struct device * dev
Definition drm_print.h:519
Definition aucomponent.h:25
struct _au_resource_ * next
Definition aucomponent.h:26
uint64_t extra
Definition aucomponent.h:29
uint8_t kind
Definition aucomponent.h:27
uint64_t extra2
Definition aucomponent.h:30
uint64_t value
Definition aucomponent.h:28
Definition audrv.h:79