Modify source files

This commit is contained in:
xj 2024-06-11 00:26:36 -07:00
parent b17ce138fa
commit 02990bfd1e
4 changed files with 19 additions and 6 deletions

View File

@ -1,2 +1,4 @@
#include <libmem.h>
#include "usb_mem.h" #include "usb_mem.h"

View File

@ -1,8 +1,18 @@
/*
* Copyright (c) 2022, sakumisu
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef USB_MEM_H_ #ifndef USB_MEM_H_
#define USB_MEM_H_ #define USB_MEM_H_
#include <stddef.h>
#define USB_MEM_ALIGNX __attribute__((aligned(CONFIG_USB_ALIGN_SIZE)))
void *usb_hc_malloc(size_t size);
void usb_hc_free();
void *usb_hc_malloc_align(size_t align, size_t size);
#endif #endif

View File

@ -25,6 +25,7 @@ INC_DIR = -I$(KERNEL_ROOT)/services/drivers/usb/ \
-I$(KERNEL_ROOT)/services/drivers/usb/components/class/wireless \ -I$(KERNEL_ROOT)/services/drivers/usb/components/class/wireless \
-I$(KERNEL_ROOT)/services/drivers/usb/components/common \ -I$(KERNEL_ROOT)/services/drivers/usb/components/common \
-I$(KERNEL_ROOT)/services/drivers/usb/components/core \ -I$(KERNEL_ROOT)/services/drivers/usb/components/core \
-I$(KERNEL_ROOT)/services/drivers/usb/components/mem \
-I$(KERNEL_ROOT)/services/drivers/usb/components/osal \ -I$(KERNEL_ROOT)/services/drivers/usb/components/osal \
-I$(KERNEL_ROOT)/services/drivers/usb/components/port \ -I$(KERNEL_ROOT)/services/drivers/usb/components/port \
-I$(KERNEL_ROOT)/services/drivers/usb/components/port/xhci \ -I$(KERNEL_ROOT)/services/drivers/usb/components/port/xhci \

View File

@ -36,13 +36,13 @@ extern "C"
#include <stddef.h> #include <stddef.h>
/* ================ USB common Configuration ================ */ /* ================ USB common Configuration ================ */
void *usb_hc_malloc(size_t size); // void *usb_hc_malloc(size_t size);
void usb_hc_free(); // void usb_hc_free();
void *usb_hc_malloc_align(size_t align, size_t size); // void *usb_hc_malloc_align(size_t align, size_t size);
#define usb_malloc(size) usb_hc_malloc(size) // #define usb_malloc(size) usb_hc_malloc(size)
#define usb_free(ptr) usb_hc_free(ptr) // #define usb_free(ptr) usb_hc_free(ptr)
#define usb_align(align, size) usb_hc_malloc_align(align, size) // #define usb_align(align, size) usb_hc_malloc_align(align, size)
#ifndef CONFIG_USB_DBG_LEVEL #ifndef CONFIG_USB_DBG_LEVEL
#define CONFIG_USB_DBG_LEVEL USB_DBG_ERROR #define CONFIG_USB_DBG_LEVEL USB_DBG_ERROR