added API driver interface for MMU
This commit is contained in:
@@ -30,6 +30,7 @@
|
|||||||
#include "driver_vec.h"
|
#include "driver_vec.h"
|
||||||
#include "driver_mem.h"
|
#include "driver_mem.h"
|
||||||
#include "pci.h"
|
#include "pci.h"
|
||||||
|
#include "mmu.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* driver interface struct for the SD card BaS driver
|
* driver interface struct for the SD card BaS driver
|
||||||
@@ -131,6 +132,16 @@ static struct framebuffer_driver_interface framebuffer_interface =
|
|||||||
.framebuffer_info = &info_fb
|
.framebuffer_info = &info_fb
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* driver interface struct for the BaS MMU driver
|
||||||
|
*/
|
||||||
|
static struct mmu_driver_interface mmu_interface =
|
||||||
|
{
|
||||||
|
.map_page_locked = &mmu_map_page_locked,
|
||||||
|
.unlock_page = &mmu_unlock_page,
|
||||||
|
.report_locked_pages = &mmu_report_locked_pages
|
||||||
|
};
|
||||||
|
|
||||||
static struct generic_interface interfaces[] =
|
static struct generic_interface interfaces[] =
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
@@ -167,6 +178,14 @@ static struct generic_interface interfaces[] =
|
|||||||
.revision = 1,
|
.revision = 1,
|
||||||
.interface.pci = &pci_interface,
|
.interface.pci = &pci_interface,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
.type = MMU_DRIVER,
|
||||||
|
.name = "MMU",
|
||||||
|
.description = "BaS MMU driver",
|
||||||
|
.version = 0,
|
||||||
|
.revision = 1,
|
||||||
|
.interface.mmu = &mmu_interface,
|
||||||
|
},
|
||||||
/* insert new drivers here */
|
/* insert new drivers here */
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ enum driver_type
|
|||||||
MCD_DRIVER,
|
MCD_DRIVER,
|
||||||
VIDEO_DRIVER,
|
VIDEO_DRIVER,
|
||||||
PCI_DRIVER,
|
PCI_DRIVER,
|
||||||
|
MMU_DRIVER,
|
||||||
END_OF_DRIVERS, /* marks end of driver list */
|
END_OF_DRIVERS, /* marks end of driver list */
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -259,6 +260,13 @@ struct pci_bios_interface {
|
|||||||
// int32_t reserved[2];
|
// int32_t reserved[2];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct mmu_driver_interface
|
||||||
|
{
|
||||||
|
int32_t (*map_page_locked)(uint32_t address, uint32_t length);
|
||||||
|
int32_t (*unlock_page)(uint32_t address, uint32_t length);
|
||||||
|
int32_t (*report_locked_pages)(void);
|
||||||
|
};
|
||||||
|
|
||||||
union interface
|
union interface
|
||||||
{
|
{
|
||||||
struct generic_driver_interface *gdi;
|
struct generic_driver_interface *gdi;
|
||||||
@@ -266,6 +274,7 @@ union interface
|
|||||||
struct dma_driver_interface *dma;
|
struct dma_driver_interface *dma;
|
||||||
struct framebuffer_driver_interface *fb;
|
struct framebuffer_driver_interface *fb;
|
||||||
struct pci_bios_interface *pci;
|
struct pci_bios_interface *pci;
|
||||||
|
struct mmu_driver_interface *mmu;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct generic_interface
|
struct generic_interface
|
||||||
|
|||||||
@@ -102,4 +102,11 @@ extern long video_sbt;
|
|||||||
extern void mmu_init(void);
|
extern void mmu_init(void);
|
||||||
extern int mmu_map_page(uint32_t virt, uint32_t phys, enum mmu_page_size sz, const struct mmu_map_flags *flags);
|
extern int mmu_map_page(uint32_t virt, uint32_t phys, enum mmu_page_size sz, const struct mmu_map_flags *flags);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* API functions for the BaS driver interface
|
||||||
|
*/
|
||||||
|
extern int32_t mmu_map_page_locked(uint32_t address, uint32_t length);
|
||||||
|
extern int32_t mmu_unlock_page(uint32_t address, uint32_t length);
|
||||||
|
extern int32_t mmu_report_locked_pages(void);
|
||||||
|
|
||||||
#endif /* _MMU_H_ */
|
#endif /* _MMU_H_ */
|
||||||
|
|||||||
Reference in New Issue
Block a user