9
0
Fork 0

svn_rev_235

beginning filesystem support
This commit is contained in:
Sascha Hauer 2007-07-05 18:01:35 +02:00 committed by Sascha Hauer
parent 0ed157cd19
commit 7880ba6372
3 changed files with 51 additions and 1 deletions

View File

@ -10,7 +10,8 @@
#define DEVICE_TYPE_ETHER 1
#define DEVICE_TYPE_STDIO 2
#define DEVICE_TYPE_DRAM 3
#define MAX_DEVICE_TYPE 3
#define DEVICE_TYPE_FS 3
#define MAX_DEVICE_TYPE 4
#include <param.h>
@ -54,6 +55,7 @@ struct driver_d {
int (*get) (struct device_d*, struct param_d *);
int (*set) (struct device_d*, struct param_d *, value_t val);
void *driver_data;
unsigned long type;
void *type_data;
};
@ -68,6 +70,9 @@ void unregister_device(struct device_d *);
struct device_d *device_from_spec_str(const char *str, char **endp);
struct device_d *get_device_by_name(char *name);
struct device_d *get_device_by_type(ulong type, struct device_d *last);
struct device_d *get_device_by_id(char *id);
struct driver_d *get_driver_by_name(char *name);
ssize_t read(struct device_d *dev, void *buf, size_t count, ulong offset, ulong flags);
ssize_t write(struct device_d *dev, void *buf, size_t count, ulong offset, ulong flags);

34
include/fs.h Normal file
View File

@ -0,0 +1,34 @@
#ifndef __FS_H
#define __FS_H
#include <driver.h>
#define FS_TYPE_CRAMFS 1
struct partition;
struct fs_driver_d {
ulong type;
char *name;
int (*ls) (struct device_d *dev, const char *filename);
int (*load) (char *dst, struct device_d *dev, const char *filename);
int (*probe) (struct device_d *dev);
struct driver_d drv;
};
struct fs_device_d {
ulong type;
char *name;
struct device_d *parent; /* the device we are associated with */
struct device_d dev; /* our own device */
struct fs_driver_d *driver;
};
int register_filesystem(struct device_d *dev, char *fsname);
//int unregister_filesystem(struct device_d *dev);
int register_fs_driver(struct fs_driver_d *new_fs_drv);
#endif /* __FS_H */

View File

@ -3,5 +3,16 @@
struct device_d;
struct partition {
int num;
unsigned long offset;
struct device_d *parent;
struct device_d device;
char name[16];
};
#endif /* __PARTITION_H */