source: soft/giet_vm/giet_libs/libsrl/srl_hw_helpers.h @ 523

Last change on this file since 523 was 258, checked in by alain, 11 years ago

This is a major release, including a deep restructuration of code.
The main evolutions are

  • use of the Tsar preloader to load the GIET boot-loader from disk
  • introduction of a FAT32 file system library,
  • use of this fat32 library by the boot-loader to load the map.bin data structure, and the various .elf files
  • reorganisation of drivers (one file per peripheral).
  • introduction of drivers for new peripherals: vci_chbuf_dma and vci_multi_ahci.
  • introduction of a new physical memory allocator in the boot code.

This release has been tested on the tsar_generic_iob architecture,
for the two following mappings: 4c_1p_iob_four.xml and 4c_1p_iob_sort.xml

  • Property svn:executable set to *
File size: 1.7 KB
Line 
1#ifndef SRL_HW_HELPERS_H
2#define SRL_HW_HELPERS_H
3
4/**
5 * @file
6 * @module{SRL}
7 * @short Miscellaneous APIs
8 */
9
10#include "stdio.h"
11
12
13/**
14  Standard API call, expands to nothing for this implementation.
15  */
16#define srl_busy_cycles(n) do{}while(0)
17
18//void useless(void *pointless,...){}
19/**
20  @this flushes the cache line containing the address.
21  */
22//TODO
23#define srl_dcache_flush_addr 0
24
25/*
26   static inline cpu_dcache_invld(void *ptr){
27   asm volatile (                               
28   " cache %0, %1"                           
29   : : "i" (0x11) , "R" (*(uint8_t*)(ptr))   
30   : "memory"                               
31   );                           
32   }
33   */
34
35/**
36  @this flushes a memory zone from cache.
37  */
38//TODO
39//void dcache_flush(const void * addr, size_t size)
40#define srl_dcache_flush_zone dcache_flush
41
42/**
43  @this waits for at least the given time (in cycles). The actual
44  time spent in this call is not predictable.
45
46  @param time Number of cycles to wait for
47  */
48void srl_sleep_cycles(unsigned int time);
49
50/**
51  @this returns the absolute timestamp counter from the
52  initialization of the platform.
53
54  @return Cycles from the initialization of the system
55  */
56static inline unsigned int srl_cycle_count() {
57    return giet_proctime();
58}
59
60
61/**
62  @this aborts the current execution. On most systems, @this will
63  simply hang.
64  */
65static inline void srl_abort() {
66    asm volatile ("break 0");
67    while (1);
68}
69
70
71/**
72 *
73 */
74static inline void srl_exit() {
75    giet_exit();
76}
77
78#endif
79
80// Local Variables:
81// tab-width: 4
82// c-basic-offset: 4
83// c-file-offsets:((innamespace . 0)(inline-open . 0))
84// indent-tabs-mode: nil
85// End:
86// vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
87
Note: See TracBrowser for help on using the repository browser.