Fork me on GitHub

root/include/fiwix/ramdisk.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  * fiwix/include/fiwix/ramdisk.h
   3  *
   4  * Copyright 2018, Jordi Sanfeliu. All rights reserved.
   5  * Distributed under the terms of the Fiwix License.
   6  */
   7 
   8 #ifndef _FIWIX_RAMDISK_H
   9 #define _FIWIX_RAMDISK_H
  10 
  11 #include <fiwix/fs.h>
  12 
  13 #define RAMDISK_MAJOR   1       /* ramdisk device major number */
  14 #define RAMDISK_MINORS  1       /* number of minors */
  15 #define RAMDISK_SIZE    4096    /* default ramdisk size in KBs */
  16 #define RAMDISK_MAXSIZE 131072  /* maximum ramdisk size in KBs */
  17 
  18 struct ramdisk {
  19         char *addr;             /* ramdisk memory address */
  20 };
  21 
  22 extern struct ramdisk ramdisk_table[RAMDISK_MINORS];
  23 
  24 int ramdisk_open(struct inode *, struct fd *);
  25 int ramdisk_close(struct inode *, struct fd *);
  26 int ramdisk_read(__dev_t, __blk_t, char *, int);
  27 int ramdisk_write(__dev_t, __blk_t, char *, int);
  28 int ramdisk_ioctl(struct inode *, int, unsigned long int);
  29 int ramdisk_lseek(struct inode *, __off_t);
  30 
  31 void ramdisk_init(void);
  32 
  33 #endif /* _FIWIX_RAMDISK_H */

/* [previous][next][first][last][top][bottom][index][help] */