当前位置:网站首页>B_ QuRT_ User_ Guide(35)
B_ QuRT_ User_ Guide(35)
2022-06-30 22:04:00 【weixin_ thirty-eight million four hundred and ninety-eight thou】
B_QuRT_User_Guide(35)
- 21.35 qurt_mem_region_attr_set_bus_attr()
- 21.36 qurt_mem_region_attr_set_cache_mode()
- 21.37 qurt_mem_region_attr_set_mapping()
- 21.38 qurt_mem_region_attr_set_physaddr()
- 21.39 qurt_mem_region_attr_set_physaddr_64()
- 21.40 qurt_mem_region_attr_set_type()
- 21.41 qurt_mem_region_attr_set_virtaddr()
- 21.42 qurt_mem_region_create()
- 21.43 qurt_mem_region_delete()
- 21.44 qurt_mem_region_query()
- 21.45 qurt_mem_region_query_64()
- 21.46 qurt_mem_syncht()
- 21.47 data type
- 21.47.1 Define file
- 21.47.2 Data structure document
- 21.47.3 Typedef Define documents
- 21.47.3.1 typedef unsigned int qurt_addr_t
- 21.47.3.2 typedef unsigned int qurt_paddr_t
- 21.47.3.3 typedef unsigned long long qurt_paddr_64_t
- 21.47.3.4 typedef unsigned int qurt_mem_region_t
- 21.47.3.5 typedef unsigned int qurt_mem_fs_region_t
- 21.47.3.6 typedef unsigned int qurt_mem_pool_t
- 21.47.3.7 typedef unsigned int qurt_size_t
- 21.47.4 Enumerating document types
- 21.47.5 Variable document
- 21.48 macro
21.35 qurt_mem_region_attr_set_bus_attr()
21.35.1 Function document
21.35.1.1 static void qurt_mem_region_attr_set_bus_attr ( qurt_mem_region_attr_t ∗ attr, unsigned abits )
Set (A1, A0) Bus attribute bit .
Related data types
qurt_mem_region_attr_t
Parameters
in,out | attr | Pointer to memory region attribute structure . |
in | attr | Used with memory areas (A1, A0) position , Expressed as 2 Bit binary number . |
Return value
None.
Dependencies
None.
21.36 qurt_mem_region_attr_set_cache_mode()
21.36.1 Function document
21.36.1.1 static void qurt_mem_region_attr_set_cache_mode ( qurt_mem_region_attr_t ∗ attr, qurt_mem_cache_mode_t mode )
Set the cache operation mode in the specified memory region attribute structure .
Related data types
qurt_mem_region_attr_t
qurt_mem_cache_mode_t
Parameters
in,out | attr | Pointer to memory region attribute structure . |
in | mode | Cache mode . Return value : |
QURT_MEM_CACHE_WRITEBACK | ||
QURT_MEM_CACHE_WRITETHROUGH | ||
QURT_MEM_CACHE_WRITEBACK_ | ||
NONL2CACHEABLE | ||
QURT_MEM_CACHE_WRITETHROUGH_ | ||
NONL2CACHEABLE | ||
QURT_MEM_CACHE_WRITEBACK_L2CACHEABLE | ||
QURT_MEM_CACHE_WRITETHROUGH_ | ||
L2CACHEABLE | ||
QURT_MEM_CACHE_NONE |
Return value
None.
Dependencies
None.
21.37 qurt_mem_region_attr_set_mapping()
21.37.1 Function document
21.37.1.1 static void qurt_mem_region_attr_set_mapping ( qurt_mem_region_attr_t ∗ attr, qurt_mem_mapping_t mapping )
Set the memory mapping in the specified memory area attribute structure .
The mapping value indicates how the memory region is mapped in virtual memory .
Related data types
qurt_mem_region_attr_t
qurt_mem_mapping_t
Parameters
in,out | attr | Pointer to memory region attribute structure . |
in | mapping | mapping . Return value : |
QURT_MEM_MAPPING_VIRTUAL | ||
QURT_MEM_MAPPING_PHYS_CONTIGUOUS | ||
QURT_MEM_MAPPING_IDEMPOTENT | ||
QURT_MEM_MAPPING_VIRTUAL_FIXED | ||
QURT_MEM_MAPPING_NONE | ||
QURT_MEM_MAPPING_VIRTUAL_RANDOM | ||
QURT_MEM_MAPPING_INVALID |
Return value
None.
Dependencies
None.
21.38 qurt_mem_region_attr_set_physaddr()
21.38.1 Function document
21.38.1.1 static void qurt_mem_region_attr_set_physaddr ( qurt_mem_region_attr_t ∗ attr, qurt_paddr_t addr )
Set the memory area in the specified memory attribute structure 32 Bit physical address .
Be careful : The physical address property is explicitly set only for memory regions with physical contiguous mappings . otherwise QuRT Automatically set the memory area when it is created .
Related data types
qurt_mem_region_attr_t
qurt_paddr_t
Parameters
in,out | attr | Pointer to memory region attribute structure . |
in | addr | Physical address of memory area . |
Return value
None.
21.39 qurt_mem_region_attr_set_physaddr_64()
21.39.1 Function document
21.39.1.1 static void qurt_mem_region_attr_set_physaddr_64 ( qurt_mem_region_attr_t ∗ attr, qurt_paddr_64_t addr_64 )
Set the memory area in the specified memory attribute structure 64 Bit physical address .
Be careful : The physical address property is explicitly set only for memory regions with physical contiguous mappings . otherwise , It is created by QuRT Automatic setting .
Related data types
qurt_mem_region_attr_t
qurt_paddr_64_t
Parameters
in,out | attr | Pointer to memory region attribute structure . |
in | addr_64 | Memory area 64 Bit physical address . |
Return value
None.
21.40 qurt_mem_region_attr_set_type()
21.40.1 Function document
21.40.1.1 static void qurt_mem_region_attr_set_type ( qurt_mem_region_attr_t ∗ attr,qurt_mem_region_type_t type )
Set the memory type in the specified memory region attribute structure .
Type indicates whether the memory region is local to the application or shared between applications .
Related data types
qurt_mem_region_attr_t
qurt_mem_region_type_t
Parameters
in,out | attr | Pointer to memory region attribute structure . |
in | type | Memory type . Return value : |
QURT_MEM_REGION_LOCAL | ||
QURT_MEM_REGION_SHARED |
Return value
None.
Dependencies
None.
21.41 qurt_mem_region_attr_set_virtaddr()
21.41.1 Function document
21.41.1.1 static void qurt_mem_region_attr_set_virtaddr ( qurt_mem_region_attr_t ∗ attr, qurt_addr_t addr )
Set the virtual address of the memory area in the specified memory attribute structure .
Related data types
qurt_mem_region_attr_t
qurt_addr_t
Parameters
in,out | attr | Pointer to memory region attribute structure . |
in | addr | Memory area virtual address . |
Return value
None.
Dependencies
None.
21.42 qurt_mem_region_create()
21.42.1 Function document
21.42.1.1 int qurt_mem_region_create ( qurt_mem_region_t ∗ region, qurt_size_t size, qurt_mem_pool_t pool, qurt_mem_region_attr_t ∗ attr )
Create a memory region with the specified properties .
Application usage qurt_mem_region_attr_init() and qurt_mem_region_attr_set_bus_attr() Initialize the memory area attribute structure .
If the virtual address property is set to its default value ( The first 21.34.1.1 section ), Then the virtual address of the memory area will automatically allocate any available virtual address value .
If the memory mapping attribute is set to virtual mapping , The physical address of the memory area will also be automatically allocated .
Be careful : The physical address attribute is set explicitly in the attribute structure , Only applicable to memory regions with physical continuous mapping .
Memory areas are always allocated to memory pools . pool Value specifies the memory pool to which the memory region is allocated .
Be careful : If attr Designated as NULL, The default attribute value is used to create the memory area ( The first 21.34.1.1 section ). QuRT Predefined memory pool objects qurt_mem_default_pool( The first 21 section ), It's in SMI Allocate memory area in memory .
Related data types
qurt_mem_region_t
qurt_size_t
qurt_mem_pool_t
qurt_mem_region_attr_t
Parameters
out | region | Pointer to memory area object . |
in | size | Memory area size ( In bytes ). If size No 4K Integer multiple , Then round up to 4K The border . |
in | pool | Memory pool of area . |
in | attr | Pointer to memory region attribute structure . |
Return value
QURT_EOK – The memory area was created successfully .
QURT_EMEM – There is not enough memory to create an area .
Dependencies
None.
21.43 qurt_mem_region_delete()
21.43.1 Function document
21.43.1.1 int qurt_mem_region_delete ( qurt_mem_region_t region )
Delete the specified memory area .
If the caller application creates a memory region , Delete it and the system reclaims its allocated memory .
If different applications create memory areas ( And share with the caller application ), Then only delete the local memory mapping to the region ; The system does not reclaim memory .
Related data types
qurt_mem_region_t
Parameters
in | region | Memory area object . |
Return value
QURT_EOK – Region successfully deleted.
Dependencies
None.
21.44 qurt_mem_region_query()
21.44.1 Function document
21.44.1.1 int qurt_mem_region_query (qurt_mem_region_t * region_handle, qurt_addr_t vaddr, qurt_paddr_t paddr)
Query memory area .
This function determines whether a dynamically created memory region exists at the specified virtual or physical address ( The first 21.42.1.1 section ). Once the memory area is determined to exist , Its properties can be accessed ( The first 21.25.1.1 section ).
Be careful : If QURT_EINVALID Be passed on to vaddr and paddr( Or neither ), This function returns QURT_EFATAL.
Related data types
qurt_mem_region_t
qurt_paddr_t
Parameters
out | region_handle | Points to the memory area object ( If there is ) The pointer to . |
in | vaddr | Virtual address to query ; If you specify vaddr, You have to paddr Set to value QURT_EINVALID. |
in | paddr | The physical address to query ; If you specify paddr, You have to vaddr Set to value QURT_EINVALID. |
Return value
QURT_EOK – The query was successfully executed .
QURT_EMEM – The region for the specified address was not found .
QURT_EFATAL – Invalid input parameter .
Dependencies
None.
21.45 qurt_mem_region_query_64()
21.45.1 Function document
21.45.1.1 int qurt_mem_region_query_64 ( qurt_mem_region_t ∗ region_handle,qurt_addr_t vaddr, qurt_paddr_64_t paddr_64 )
Determines whether a dynamically created memory region exists at the specified virtual or physical address ( The first 21.42.1.1 section ). Once the memory area is determined to exist , Its properties can be accessed ( The first 21.25.1.1 section ).
Be careful : If you will QURT_EINVALID Pass to vaddr and paddr( Or neither ), Then this function returns QURT_EFATAL.
Related data types
qurt_mem_region_t
qurt_addr_t
qurt_paddr_64_t
Parameters
out | region_handle | Points to the memory area object ( If there is ) The pointer to . |
in | vaddr | Virtual address to query ; If you specify vaddr, You have to paddr Set to value QURT_EINVALID. |
in | paddr_64 | 64 Bit physical address query ; If you specify paddr, You have to vaddr Set to value QURT_EINVALID. |
Return value
QURT_EOK – success .
QURT_EMEM – The region for the specified address was not found .
QURT_EFATAL – Invalid input parameter .
Dependencies
None.
21.46 qurt_mem_syncht()
21.46.1 Function document
21.46.1.1 static void qurt_mem_syncht ( void )
Perform heavyweight synchronization of memory transactions .
Until all previous memory transactions originating from the current thread ( Cached and uncached loads / Storage 、mem_locked etc. ) Are complete and globally observable , This operation will return .
Be careful : Be careful : This is done as Hexagon syncht The wrapper implementation of the instruction .
Return value
None.
Dependencies
None.
21.47 data type
This section describes the data types of the memory management service .
- The memory pool is QuRT Said to qurt_mem_pool_t Object of type .
- The memory area is represented by qurt_mem_region_t Object of type .
- Memory area attributes are stored in qurt_mem_region_attr_t In the structure of type .
- The memory area type is stored as qurt_mem_region_type_t Type value .
- The memory area mapping is specified as qurt_mem_mapping_t Type value .
- The cache type is specified as qurt_mem_cache_type_t Type value .
- The cache mode is specified as qurt_mem_cache_mode_t Type value .
- The cache opcode is specified as qurt_mem_cache_op_t Type value .
21.47.1 Define file
21.47.1.1 #define QURT_POOL_REMOVE_ALL_OR_NONE 1
21.47.1.2 #define PAGE_SHIFT_AMT 12
ent Upper QuRT MMU Entry extraction macro :tlbhi_tlblo
21.47.1.3 #define QURT_MMU_EXTRACT_PPAGE( ent )
Value:
((((unsigned long long)ent >> 1) & 0x7FFFFF) | (((unsigned long long)ent >> 38) & 0x800000))
21.47.2 Data structure document
21.47.2.1 struct qurt_mem_region_attr_t
QuRT Memory region attribute type .
21.47.2.2 struct qurt_mem_pool_attr_t
QuRT User physical memory pool type .
21.47.3 Typedef Define documents
21.47.3.1 typedef unsigned int qurt_addr_t
QuRT Address type .
21.47.3.2 typedef unsigned int qurt_paddr_t
QuRT Physical memory address type .
21.47.3.3 typedef unsigned long long qurt_paddr_64_t
QuRT 64 Bit physical memory address type .
21.47.3.4 typedef unsigned int qurt_mem_region_t
QuRT Memory area type .
21.47.3.5 typedef unsigned int qurt_mem_fs_region_t
QuRT Memory FS Area type .
21.47.3.6 typedef unsigned int qurt_mem_pool_t
QuRT Memory pool type .
21.47.3.7 typedef unsigned int qurt_size_t
QuRT size type .
21.47.4 Enumerating document types
21.47.4.1 enum qurt_mem_mapping_t
QuRT Memory area mapping type .
Enumerator:
* QURT_MEM_MAPPING_VIRTUAL: The default mode . Area virtual address range maps to the available contiguous area of physical memory . QuRT The system selects the base address in physical memory . This makes the most efficient use of virtual memory , And applies to most memory use cases .
* QURT_MEM_MAPPING_PHYS_CONTIGUOUS: The area virtual address space must be mapped to a contiguous area of physical memory . When the memory area is bypassed Hexagon Virtual memory addressed external device access , This is necessary . The base address in physical memory must be specified explicitly .
* QURT_MEM_MAPPING_IDEMPOTENT: The area virtual address space maps to the same area of physical memory .
* QURT_MEM_MAPPING_VIRTUAL_FIXED: Area virtual address space maps to a specified area of physical memory or ( If no area is specified ) To any available physical memory . Use this mapping to call... From by using the mapping qurt_mem_region_create() Reserved virtual space creation area .
* QURT_MEM_MAPPING_NONE: Reserve a virtual memory area (VMA). If you don't delete the memory area first , It is not allowed to remap the virtual range . When such an area is deleted , The corresponding virtual memory address remains unchanged .
* QURT_MEM_MAPPING_VIRTUAL_RANDOM: The system selects a random virtual address and maps it to available contiguous physical addresses .
* QURT_MEM_MAPPING_PHYS_DISCONTIGUOUS: Allocate discontinuous physical memory blocks when virtual memory is continuous . When there are contiguous blocks smaller than the requested size , It will help . The physical address is not used as get_attr Part of the call provides .
* QURT_MEM_MAPPING_INVALID: Reserved as invalid mapping type .
21.47.4.2 enum qurt_mem_cache_mode_t
QuRT Cache type mode .
Enumerator:
* QURT_MEM_CACHE_WRITEBACK: Write back .
* QURT_MEM_CACHE_NONE_SHARED: Normal uncached memory that can be shared with other subsystems .
* QURT_MEM_CACHE_WRITETHROUGH: General writing .
* QURT_MEM_CACHE_WRITEBACK_NONL2CACHEABLE: Write back non L2 cache
* QURT_MEM_CACHE_WRITETHROUGH_NONL2CACHEABLE: Write through non L2 Cache write .
* QURT_MEM_CACHE_WRITEBACK_L2CACHEABLE: Write back L2 cache
* QURT_MEM_CACHE_WRITETHROUGH_L2CACHEABLE: General writing L2 Cache write .
* QURT_MEM_CACHE_DEVICE: Volatile memory mapping device . Cannot interrupt 、 Reorder or replay to cancel access to device memory .
* QURT_MEM_CACHE_NONE: Have been abandoned - change to the use of sth. QURT_MEM_CACHE_DEVICE.
* QURT_MEM_CACHE_DEVICE_SFC: Enable limits on the number of outstanding transactions .
* QURT_MEM_CACHE_INVALID: Reserved as invalid cache type .
21.47.4.3 enum qurt_perm_t
Memory access permissions .
Enumerator:
* QURT_PERM_READ: Read permissions .
* QURT_PERM_WRITE: Write permissions .
* QURT_PERM_EXECUTE: Executive authority .
* QURT_PERM_NODUMP: Skip dump mapping . During process domain dump , Some mappings on the host memory must be skipped , To avoid memory being deleted from the host and DSP Race condition for a process to crash before deleting a map .
* QURT_PERM_FULL: Read 、 Write and execute permissions .
21.47.4.4 enum qurt_mem_cache_type_t
QuRT Cache type ; Specify data cache or instruction cache .
Enumerator:
* QRT_MEM_ICACHE: Instruction cache .
* QURT_MEM_DCACHE: Data caching .
21.47.4.5 enum qurt_mem_cache_op_t
QuRT Cache opcode type .
Enumerator:
* QURT_MEM_CACHE_FLUSH: Refresh
* QURT_MEM_CACHE_INVALIDATE: Invalid
* QURT_MEM_CACHE_FLUSH_INVALIDATE: Refresh invalid
* QURT_MEM_CACHE_FLUSH_ALL: Refresh all
* QURT_MEM_CACHE_FLUSH_INVALIDATE_ALL: All refreshes are invalid
* QURT_MEM_CACHE_TABLE_FLUSH_INVALIDATE: Invalid table refresh
21.47.4.6 enum qurt_mem_region_type_t
QuRT Memory area type .
Enumerator:
* QURT_MEM_REGION_LOCAL: Local
* QURT_MEM_REGION_LOCAL: share
* QURT_MEM_REGION_LOCAL: User access
* QURT_MEM_REGION_LOCAL: FS
* QURT_MEM_REGION_LOCAL: Reserved as invalid area type
21.47.4.7 enum qurt_cache_type_t
Enumerator:
* HEXAGON_L1_I_CACHE: Hexagon L1 Instruction cache
* HEXAGON_L1_D_CACHE: Hexagon L1 Data caching
* HEXAGON_L2_CACHE: Hexagon L2 cache
21.47.4.8 enum qurt_cache_partition_size_t
Enumerator:
* FULL_SIZE: Fully shared cache , No partition required
* HALF_SIZE: 1/2 Mainly ,1/2 To assist .
* THREE_QUARTER_SIZE: 3/4 Mainly ,1/4 To assist .
* SEVEN_EIGHTHS_SIZE: Main use 7/8, Auxiliary use 1/8; Only applicable to L2 cache .
21.47.5 Variable document
21.47.5.1 qurt_mem_pool_t qurt_mem_default_pool
Memory pool object .
21.48 macro
This section introduces the macro of memory management service .
21.48.1 Define Define documents
21.48.1.1 #define QURT_SYSTEM_ALLOC_VIRTUAL 1
Allocate available virtual memory in the address space of all processes .
边栏推荐
- Gartner focuses on low code development in China how UNIPRO practices "differentiation"
- 兴奋神经递质——谷氨酸与大脑健康
- [introduction to MySQL] the first conversation · first time in the "database" Mainland
- 1-20 预检请求
- 国产数据库乱象
- vncserver: Failed command ‘/etc/X11/Xvnc-session‘: 256!
- Anaconda下安装Jupyter notebook
- Analyse des risques liés aux liaisons de microservices
- Prediction and regression of stacking integrated model
- [career planning for Digital IC graduates] Chap.1 overview of IC industry chain and summary of representative enterprises
猜你喜欢
机器学习工作要求研究生吗?
牛逼|珍藏多年的工具让我实现了带薪摸鱼自由
JD and Tencent renewed the three-year strategic cooperation agreement; The starting salary rose to 260000 yuan, and Samsung sk of South Korea scrambled for a raise to retain semiconductor talents; Fir
1-2 安装并配置MySQL相关的软件
Introduction and example of template method mode
Stinky tofu made by Grandma
Neurotransmetteurs excitateurs - glutamate et santé cérébrale
Open the jupyter notebook/lab and FAQ & settings on the remote server with the local browser
Go Web 编程入门: 一探优秀测试库 GoConvey
[BSP video tutorial] BSP video tutorial issue 19: AES encryption practice of single chip bootloader, including all open source codes of upper and lower computers (June 26, 2022)
随机推荐
1-17 express Middleware
1-15 nodemon
Prediction and regression of stacking integrated model
1-12 preliminary understanding of Express
Vite2 is compatible with lower versions of chrome (such as Sogou 80). Some grammars requiring higher versions are processed through polyfills
I want to know who I need to know to open a stock account? In addition, is it safe to open a mobile account?
Modify the name of the launched applet
The programmer's girlfriend gave me a fatigue driving test
PostgreSQL存储结构浅析
Look at the top 10 capabilities of alicloud cipu
谈谈数字化转型的几个关键问题
Is machine learning suitable for girls?
How to realize the center progress bar in wechat applet
交易所系统开发如何开发?数字货币交易所系统开发成熟技术案例
Arcmap|assign values to different categories of IDS with the field calculator
Develop your own package
Akk bacteria - the next generation of beneficial bacteria
将Nagios监控信息存入MySQL
MFC interface library bcgcontrolbar v33.0 - desktop alarm window, grid control upgrade, etc
Notes [introduction to JUC package and future]