Add physical page interface

This commit is contained in:
xj 2024-06-25 19:38:58 -07:00
parent 47a330b08f
commit e9b9e907c6
2 changed files with 27 additions and 0 deletions

View File

@ -53,3 +53,14 @@ void usb_hc_free(void* ptr){
if(ptr != NULL)
free(ptr);
}
usb_dir_page_t usb_alloc_dir_page(int len, int flag, int headroom_len){
return NULL;
}
void usb_free_dir_page(usb_dir_page_t page){
}

View File

@ -23,6 +23,7 @@ Modification: Use usb_malloc, usb_free and usb_align functions
#define USB_MEM_H_
#include <stddef.h>
#include <stdint.h>
#include "usb_config.h"
#define USB_MEM_ALIGNX __attribute__((aligned(CONFIG_USB_ALIGN_SIZE)))
@ -35,5 +36,20 @@ void *usb_hc_malloc_align(size_t align, size_t size);
#define usb_free(ptr) usb_hc_free(ptr)
#define usb_align(align, size) usb_hc_malloc_align(align, size)
struct usb_dir_page{
uint64_t vir_addr;
uint64_t phy_addr;
uint32_t size;
uint32_t len;
uint32_t flag;
uint32_t headroom_len;
}__PACKED;
typedef struct usb_dir_page *usb_dir_page_t;
usb_dir_page_t usb_alloc_dir_page(int len, int flag, int headroom_len);
void usb_free_dir_page(usb_dir_page_t page);
#endif