| 1 | /* | 
|---|
| 2 | * \file    : reset_utils.h | 
|---|
| 3 | * \date    : August 2012 | 
|---|
| 4 | * \author  : Cesar Fuguet | 
|---|
| 5 | */ | 
|---|
| 6 |  | 
|---|
| 7 | #ifndef BOOT_UTILS_H | 
|---|
| 8 | #define BOOT_UTILS_H | 
|---|
| 9 |  | 
|---|
| 10 | #include <elf-types.h> | 
|---|
| 11 | #include <reset_tty.h> | 
|---|
| 12 | #include <reset_ioc.h> | 
|---|
| 13 | #include <defs.h> | 
|---|
| 14 | #include <mcc.h> | 
|---|
| 15 | #include <io.h> | 
|---|
| 16 |  | 
|---|
| 17 | /******************************************************************** | 
|---|
| 18 | * Integer types definition | 
|---|
| 19 | ********************************************************************/ | 
|---|
| 20 | typedef unsigned int size_t; | 
|---|
| 21 | typedef unsigned int addr_t; | 
|---|
| 22 |  | 
|---|
| 23 | /******************************************************************** | 
|---|
| 24 | * Other types definition | 
|---|
| 25 | ********************************************************************/ | 
|---|
| 26 |  | 
|---|
| 27 | /* | 
|---|
| 28 | * cache line aligned disk block (sector) buffer | 
|---|
| 29 | */ | 
|---|
| 30 | struct aligned_blk | 
|---|
| 31 | { | 
|---|
| 32 | char b[BLOCK_SIZE]; | 
|---|
| 33 | } __attribute__((aligned(CACHE_LINE_SIZE))); | 
|---|
| 34 |  | 
|---|
| 35 | /******************************************************************** | 
|---|
| 36 | * Utility functions definition | 
|---|
| 37 | ********************************************************************/ | 
|---|
| 38 |  | 
|---|
| 39 | extern unsigned int proctime(); | 
|---|
| 40 |  | 
|---|
| 41 | extern int pread(size_t file_offset, void *buf, size_t nbyte, size_t offset); | 
|---|
| 42 |  | 
|---|
| 43 | extern void* memcpy(void *_dst, const void *_src, size_t n); | 
|---|
| 44 | extern void* memset(void *_dst, int c, size_t len); | 
|---|
| 45 |  | 
|---|
| 46 | extern void check_elf_header(Elf32_Ehdr *ehdr); | 
|---|
| 47 | extern void reset_print_elf_phdr(Elf32_Phdr * elf_phdr_ptr); | 
|---|
| 48 |  | 
|---|
| 49 | #if USE_IOB | 
|---|
| 50 | void reset_mcc_invalidate (const void * buf, size_t size); | 
|---|
| 51 | #endif /* USE_IOB */ | 
|---|
| 52 |  | 
|---|
| 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 |  | 
|---|
| 58 | // vim: tabstop=4 : softtabstop=4 : shiftwidth=4 : expandtab | 
|---|
| 59 |  | 
|---|