OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [mp3/] [sw/] [mad-xess/] [fsyst.h] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 291 simons
 
2
 
3
/* Where does filesystem start */
4
extern unsigned char *root_file;
5
#define ROOT_FILE ((struct file_struct *)root_file)//0x20000)
6
 
7
enum enum_file_type {
8
  /* Must be first file.  */
9
  FT_ROOT,
10
  /* Track number.  */
11
  FT_TRACK_NO,
12
  /* Track name.  */
13
  FT_TRACK_NAME,
14
  /* Track data.  */
15
  FT_TRACK_DATA,
16
  /* Last record.  */
17
  FT_END
18
};
19
 
20
struct file_struct {
21
  /* Length of file, including header.  */
22
  unsigned int length;
23
 
24
  /* File type.  */
25
  enum enum_file_type type;
26
 
27
  /* Actual file data.  */
28
  unsigned int data[1];
29
};
30
 
31
#define HEADER_SIZE (sizeof (struct file_struct) - sizeof (unsigned int))
32
 
33
/* Returns file, that holds track number.  */
34
extern struct file_struct *find_track_no (int no, struct file_struct *root);
35
 
36
/* Returns track name from file struct, pointing at FT_TRACK_NO.  */
37
extern char *track_name (struct file_struct *fs);
38
 
39
/* Returns track data from file struct, pointing at FT_TRACK_NO.  */
40
extern struct file_struct *track_data (struct file_struct *fs);
41
 
42
/* Finds last record.  */
43
extern struct file_struct * end_file (struct file_struct *root);
44
 
45
/* Adds file to the end of file list.  Returns new file address, if
46
   sucessful, otherwise NULL.  */
47
extern struct file_struct *add_file (struct file_struct *root,
48
                              struct file_struct *file);
49
/* Initializes filesystem at root.  */
50
extern void init_fsyst (struct file_struct *root);
51
 
52
#ifdef EMBED
53
#define swap(x) (x)
54
#else
55
extern unsigned int swap (unsigned int x);
56
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.