mm: rename struct mem_drv_bank to sys_mm_drv_bank
Simply to put them into correct namespace as the struct is part of public API. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
parent
ca1aae6183
commit
9a6e32f87c
4 changed files with 13 additions and 13 deletions
|
|
@ -18,14 +18,14 @@
|
||||||
#include <zephyr/drivers/mm/mm_drv_bank.h>
|
#include <zephyr/drivers/mm/mm_drv_bank.h>
|
||||||
#include <zephyr/sys/mem_stats.h>
|
#include <zephyr/sys/mem_stats.h>
|
||||||
|
|
||||||
void sys_mm_drv_bank_init(struct mem_drv_bank *bank, uint32_t bank_pages)
|
void sys_mm_drv_bank_init(struct sys_mm_drv_bank *bank, uint32_t bank_pages)
|
||||||
{
|
{
|
||||||
bank->unmapped_pages = 0;
|
bank->unmapped_pages = 0;
|
||||||
bank->mapped_pages = bank_pages;
|
bank->mapped_pages = bank_pages;
|
||||||
bank->max_mapped_pages = bank_pages;
|
bank->max_mapped_pages = bank_pages;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t sys_mm_drv_bank_page_mapped(struct mem_drv_bank *bank)
|
uint32_t sys_mm_drv_bank_page_mapped(struct sys_mm_drv_bank *bank)
|
||||||
{
|
{
|
||||||
bank->unmapped_pages--;
|
bank->unmapped_pages--;
|
||||||
bank->mapped_pages++;
|
bank->mapped_pages++;
|
||||||
|
|
@ -35,14 +35,14 @@ uint32_t sys_mm_drv_bank_page_mapped(struct mem_drv_bank *bank)
|
||||||
return bank->mapped_pages;
|
return bank->mapped_pages;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t sys_mm_drv_bank_page_unmapped(struct mem_drv_bank *bank)
|
uint32_t sys_mm_drv_bank_page_unmapped(struct sys_mm_drv_bank *bank)
|
||||||
{
|
{
|
||||||
bank->unmapped_pages++;
|
bank->unmapped_pages++;
|
||||||
bank->mapped_pages--;
|
bank->mapped_pages--;
|
||||||
return bank->unmapped_pages;
|
return bank->unmapped_pages;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sys_mm_drv_bank_stats_get(struct mem_drv_bank *bank,
|
void sys_mm_drv_bank_stats_get(struct sys_mm_drv_bank *bank,
|
||||||
struct sys_memory_stats *stats)
|
struct sys_memory_stats *stats)
|
||||||
{
|
{
|
||||||
stats->free_bytes = bank->unmapped_pages *
|
stats->free_bytes = bank->unmapped_pages *
|
||||||
|
|
@ -53,7 +53,7 @@ void sys_mm_drv_bank_stats_get(struct mem_drv_bank *bank,
|
||||||
CONFIG_MM_DRV_PAGE_SIZE;
|
CONFIG_MM_DRV_PAGE_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sys_mm_drv_bank_stats_reset_max(struct mem_drv_bank *bank)
|
void sys_mm_drv_bank_stats_reset_max(struct sys_mm_drv_bank *bank)
|
||||||
{
|
{
|
||||||
bank->max_mapped_pages = bank->mapped_pages;
|
bank->max_mapped_pages = bank->mapped_pages;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
static struct k_spinlock tlb_lock;
|
static struct k_spinlock tlb_lock;
|
||||||
extern struct k_spinlock sys_mm_drv_common_lock;
|
extern struct k_spinlock sys_mm_drv_common_lock;
|
||||||
|
|
||||||
static struct mem_drv_bank hpsram_bank[L2_SRAM_BANK_NUM];
|
static struct sys_mm_drv_bank hpsram_bank[L2_SRAM_BANK_NUM];
|
||||||
|
|
||||||
#ifdef CONFIG_SOC_INTEL_COMM_WIDGET
|
#ifdef CONFIG_SOC_INTEL_COMM_WIDGET
|
||||||
#include <adsp_comm_widget.h>
|
#include <adsp_comm_widget.h>
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
#include <zephyr/sys/mem_stats.h>
|
#include <zephyr/sys/mem_stats.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
struct mem_drv_bank {
|
struct sys_mm_drv_bank {
|
||||||
uint32_t unmapped_pages;
|
uint32_t unmapped_pages;
|
||||||
uint32_t mapped_pages;
|
uint32_t mapped_pages;
|
||||||
uint32_t max_mapped_pages;
|
uint32_t max_mapped_pages;
|
||||||
|
|
@ -39,7 +39,7 @@ struct mem_drv_bank {
|
||||||
* @param bank Pointer to the memory bank structure used for tracking
|
* @param bank Pointer to the memory bank structure used for tracking
|
||||||
* @param bank_pages Number of pages in the memory bank
|
* @param bank_pages Number of pages in the memory bank
|
||||||
*/
|
*/
|
||||||
void sys_mm_drv_bank_init(struct mem_drv_bank *bank, uint32_t bank_pages);
|
void sys_mm_drv_bank_init(struct sys_mm_drv_bank *bank, uint32_t bank_pages);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Track the mapping of a page in the specified memory bank
|
* @brief Track the mapping of a page in the specified memory bank
|
||||||
|
|
@ -51,7 +51,7 @@ void sys_mm_drv_bank_init(struct mem_drv_bank *bank, uint32_t bank_pages);
|
||||||
*
|
*
|
||||||
* @return The number of pages mapped within the memory bank
|
* @return The number of pages mapped within the memory bank
|
||||||
*/
|
*/
|
||||||
uint32_t sys_mm_drv_bank_page_mapped(struct mem_drv_bank *bank);
|
uint32_t sys_mm_drv_bank_page_mapped(struct sys_mm_drv_bank *bank);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Track the unmapping of a page in the specified memory bank
|
* @brief Track the unmapping of a page in the specified memory bank
|
||||||
|
|
@ -63,7 +63,7 @@ uint32_t sys_mm_drv_bank_page_mapped(struct mem_drv_bank *bank);
|
||||||
*
|
*
|
||||||
* @return The number of unmapped pages within the memory bank
|
* @return The number of unmapped pages within the memory bank
|
||||||
*/
|
*/
|
||||||
uint32_t sys_mm_drv_bank_page_unmapped(struct mem_drv_bank *bank);
|
uint32_t sys_mm_drv_bank_page_unmapped(struct sys_mm_drv_bank *bank);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Reset the max number of pages mapped in the bank
|
* @brief Reset the max number of pages mapped in the bank
|
||||||
|
|
@ -74,7 +74,7 @@ uint32_t sys_mm_drv_bank_page_unmapped(struct mem_drv_bank *bank);
|
||||||
*
|
*
|
||||||
* @param bank Pointer to the memory bank's data structure
|
* @param bank Pointer to the memory bank's data structure
|
||||||
*/
|
*/
|
||||||
void sys_mm_drv_bank_stats_reset_max(struct mem_drv_bank *bank);
|
void sys_mm_drv_bank_stats_reset_max(struct sys_mm_drv_bank *bank);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Retrieve the memory usage stats for the specified memory bank
|
* @brief Retrieve the memory usage stats for the specified memory bank
|
||||||
|
|
@ -84,7 +84,7 @@ void sys_mm_drv_bank_stats_reset_max(struct mem_drv_bank *bank);
|
||||||
* @param bank Pointer to the memory bank's data structure
|
* @param bank Pointer to the memory bank's data structure
|
||||||
* @param stats Pointer to memory into which to copy the system memory stats
|
* @param stats Pointer to memory into which to copy the system memory stats
|
||||||
*/
|
*/
|
||||||
void sys_mm_drv_bank_stats_get(struct mem_drv_bank *bank,
|
void sys_mm_drv_bank_stats_get(struct sys_mm_drv_bank *bank,
|
||||||
struct sys_memory_stats *stats);
|
struct sys_memory_stats *stats);
|
||||||
|
|
||||||
#endif /* ZEPHYR_INCLUDE_DRIVERS_MM_DRV_BANK_H */
|
#endif /* ZEPHYR_INCLUDE_DRIVERS_MM_DRV_BANK_H */
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
#define EXPECTED(x) ((x) * CONFIG_MM_DRV_PAGE_SIZE)
|
#define EXPECTED(x) ((x) * CONFIG_MM_DRV_PAGE_SIZE)
|
||||||
|
|
||||||
static struct mem_drv_bank bank_data = {0x123, 0x234, 0x345};
|
static struct sys_mm_drv_bank bank_data = {0x123, 0x234, 0x345};
|
||||||
|
|
||||||
static void test_stats(const char *error_string,
|
static void test_stats(const char *error_string,
|
||||||
struct sys_memory_stats *stats,
|
struct sys_memory_stats *stats,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue