Changeset 758 for trunk/softs/tsar_boot/include/reset_utils.h
- Timestamp:
- Jul 24, 2014, 3:19:18 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/softs/tsar_boot/include/reset_utils.h
r701 r758 5 5 */ 6 6 7 #ifndef BOOT_UTILS_H8 #define BOOT_UTILS_H7 #ifndef RESET_UTILS_H 8 #define RESET_UTILS_H 9 9 10 10 #include <elf-types.h> 11 #include <reset_tty.h> 12 #include <reset_ioc.h> 11 #include <inttypes.h> 13 12 #include <defs.h> 14 #include <mcc.h>15 #include <io.h>16 17 /********************************************************************18 * Integer types definition19 ********************************************************************/20 typedef unsigned int size_t;21 typedef unsigned int addr_t;22 13 23 14 /******************************************************************** … … 26 17 27 18 /* 28 * cache line aligned disk block (sector) buffer 19 * cache line aligned disk block (sector) buffer 29 20 */ 30 21 struct aligned_blk … … 37 28 ********************************************************************/ 38 29 39 extern unsigned int proctime(); 30 /** 31 * \brief processor waits for n cycles 32 */ 33 static inline void reset_sleep(int cycles) 34 { 35 volatile int i; 36 for (i = 0; i < cycles; i++); 37 } 40 38 41 extern int pread(size_t file_offset, void *buf, size_t nbyte, size_t offset); 39 /** 40 * \brief returns processor count 41 */ 42 static inline unsigned int proctime() 43 { 44 register unsigned int ret asm ("v0"); 45 asm volatile ("mfc0 %0, $9":"=r" (ret)); 46 return ret; 47 } 42 48 43 extern void* memcpy(void *_dst, const void *_src, size_t n); 44 extern void* memset(void *_dst, int c, size_t len); 49 int pread(size_t file_offset, void *buf, size_t nbyte, size_t offset); 45 50 46 extern void check_elf_header(Elf32_Ehdr *ehdr);47 extern void reset_print_elf_phdr(Elf32_Phdr * elf_phdr_ptr);51 void* memcpy(void *_dst, const void *_src, size_t n); 52 void* memset(void *_dst, int c, size_t len); 48 53 49 #if USE_IOB 50 void reset_mcc_invalidate (const void * buf, size_t size); 51 #endif /* USE_IOB */ 54 void check_elf_header(Elf32_Ehdr *ehdr); 55 void reset_print_elf_phdr(Elf32_Phdr * elf_phdr_ptr); 52 56 53 #if (CACHE_COHERENCE == 0) || USE_IOB 54 void reset_buf_invalidate (const void * buf, size_t line_size, size_t size); 55 #endif /* (CACHE_COHERENCE == 0) || USE_IOB */ 56 #endif /* BOOT_UTILS_H */ 57 #endif /* RESET_UTILS_H */ 57 58 58 59 // vim: tabstop=4 : softtabstop=4 : shiftwidth=4 : expandtab
Note: See TracChangeset
for help on using the changeset viewer.