Setjmp and longjmp 支持 CYGARC_JMP_BUF_SIZE hal_jmp_buf[CYGARC_JMP_BUF_SIZE] hal_setjmp( hal_jmp_buf env ) hal_longjmp( hal_jmp_buf env, int val ) 这些函数提供了对C函数setjmp() and longjmp()的支持。
中断状态控制 HAL_DISABLE_INTERRUPTS( old ) HAL_RESTORE_INTERRUPTS( old ) HAL_ENABLE_INTERRUPTS() HAL_QUERY_INTERRUPTS( state ) 这些宏提供了CPU中断屏蔽机制。通常它们只应当操作CPU状态寄存器,enable和disable中断递送,而不应当访问中断控制器。
HAL_XCACHE_BURST_SIZE() allows the size of cache to/from memory bursts to be controlled. This macro will only be defined if this functionality is available.
HAL_XCACHE_UNLOCK() cancels the locking of the memory region given. This should normally correspond to a region supplied in a matching lock call. This macro will only be defined if this functionality is available.
HAL_XCACHE_UNLOCK_ALL() cancels all existing locked memory regions. This may be required as part of the cache initialization on some architectures. This macro will only be defined if this functionality is available.
Cache线控制 HAL_DCACHE_ALLOCATE( base , size ) HAL_DCACHE_FLUSH( base , size ) HAL_XCACHE_INVALIDATE( base , size ) HAL_DCACHE_STORE( base , size ) HAL_DCACHE_READ_HINT( base , size ) HAL_DCACHE_WRITE_HINT( base , size ) HAL_DCACHE_ZERO( base , size ) All of these macros apply a cache operation to all cache lines that match the memory address region defined by the base and size arguments. These macros will only be defined if the described functionality is available. Also, it is not guaranteed that the cache function will only be applied to just the described regions, in some architectures it may be applied to the whole cache.
HAL_DCACHE_ALLOCATE() allocates lines in the cache for the given region without reading their contents from memory, hence the contents of the lines is undefined. This is useful for preallocating lines which are to be completely overwritten, for example in a block copy operation.
HAL_DCACHE_FLUSH() invalidates all cache lines in the region after writing any dirty lines to memory.
HAL_XCACHE_INVALIDATE() invalidates all cache lines in the region. Any dirty lines are invalidated without being written to memory.
HAL_DCACHE_STORE() writes all dirty lines in the region to memory, but does not invalidate any lines.
HAL_DCACHE_READ_HINT() hints to the cache that the region is going to be read from in the near future. This may cause the region to be speculatively read into the cache.
HAL_DCACHE_WRITE_HINT() hints to the cache that the region is going to be written to in the near future. This may have the identical behavior to HAL_DCACHE_READ_HINT().
HAL_DCACHE_ZERO() allocates and zeroes lines in the cache for the given region without reading memory. This is useful if a large area of memory is to be cleared.
文章评论(0条评论)
登录后参与讨论