source: soft/giet_vm/giet_drivers/iob_driver.c @ 284

Last change on this file since 284 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

File size: 1.7 KB
Line 
1///////////////////////////////////////////////////////////////////////////////////
2// File     : iob_driver.c
3// Date     : 23/05/2013
4// Author   : alain greiner
5// Copyright (c) UPMC-LIP6
6///////////////////////////////////////////////////////////////////////////////////
7// The iob_driver.c and iob_driver.h files are part ot the GIET-VM kernel.
8// This driver supports the TSAR vci_io_bridge, that is a bridge to access
9// The external peripherals, implementing an IO_MMU.
10///////////////////////////////////////////////////////////////////////////////////
11// The seg_iob_base virtual base addresses must be defined in giet_vsegs.ld file.
12///////////////////////////////////////////////////////////////////////////////////
13
14#include <giet_config.h>
15#include <iob_driver.h>
16#include <utils.h>
17
18#if !defined(GIET_USE_IOMMU)
19# error: You must define GIET_USE_IOMMU in the giet_config.h file
20#endif
21
22#if !defined( USE_IOB )
23# error: You must define USE_IOB in the hard_config.h file
24#endif
25
26///////////////////////////////////////////////////////////////////////////////
27//      _iob_inval_tlb_entry()
28// This function invalidates a TLB entry identified by a virtual address.
29// Returns 0 if success, returns 1 if failure
30///////////////////////////////////////////////////////////////////////////////
31unsigned int _iob_inval_tlb_entry( unsigned int vaddr )
32{
33#if USE_IOB
34
35    unsigned int * iob_address = (unsigned int *) &seg_iob_base ;
36    iob_address[IOB_INVAL_PTE] = vaddr;
37    return 0; 
38
39#else
40
41    return 1;
42
43#endif
44}
45
46
47// Local Variables:
48// tab-width: 4
49// c-basic-offset: 4
50// c-file-offsets:((innamespace . 0)(inline-open . 0))
51// indent-tabs-mode: nil
52// End:
53// vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
54
Note: See TracBrowser for help on using the repository browser.