Author: mcayland Date: Sun Mar 14 15:33:32 2010 New Revision: 690 URL: http://tracker.coreboot.org/trac/openbios/changeset/690
Log: Move the fs header file into include/fs to synchronise with the code directory structure.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@siriusit.co.uk
Added: trunk/openbios-devel/include/fs/ trunk/openbios-devel/include/fs/fs.h (props changed) - copied unchanged from r689, trunk/openbios-devel/include/openbios/fs.h Deleted: trunk/openbios-devel/include/openbios/fs.h Modified: trunk/openbios-devel/fs/ext2/ext2_fs.c trunk/openbios-devel/fs/grubfs/grubfs_fs.c trunk/openbios-devel/fs/hfs/hfs_fs.c trunk/openbios-devel/fs/hfsplus/hfsp_fs.c trunk/openbios-devel/fs/ioglue.c trunk/openbios-devel/fs/iso9660/iso9660_fs.c trunk/openbios-devel/packages/misc-files.c
Modified: trunk/openbios-devel/fs/ext2/ext2_fs.c ============================================================================== --- trunk/openbios-devel/fs/ext2/ext2_fs.c Sun Mar 14 15:21:02 2010 (r689) +++ trunk/openbios-devel/fs/ext2/ext2_fs.c Sun Mar 14 15:33:32 2010 (r690) @@ -8,7 +8,7 @@
#include "libext2.h" #include "ext2_utils.h" -#include "openbios/fs.h" +#include "fs/fs.h" #include "libc/vsprintf.h"
typedef struct {
Modified: trunk/openbios-devel/fs/grubfs/grubfs_fs.c ============================================================================== --- trunk/openbios-devel/fs/grubfs/grubfs_fs.c Sun Mar 14 15:21:02 2010 (r689) +++ trunk/openbios-devel/fs/grubfs/grubfs_fs.c Sun Mar 14 15:33:32 2010 (r690) @@ -16,7 +16,7 @@
#include "openbios/config.h" #include "openbios/bindings.h" -#include "openbios/fs.h" +#include "fs/fs.h" #include "filesys.h" #include "glue.h" #include "libc/diskio.h"
Modified: trunk/openbios-devel/fs/hfs/hfs_fs.c ============================================================================== --- trunk/openbios-devel/fs/hfs/hfs_fs.c Sun Mar 14 15:21:02 2010 (r689) +++ trunk/openbios-devel/fs/hfs/hfs_fs.c Sun Mar 14 15:33:32 2010 (r690) @@ -15,7 +15,7 @@ */
#include "openbios/config.h" -#include "openbios/fs.h" +#include "fs/fs.h" #include "libc/vsprintf.h" #include "libhfs.h"
Modified: trunk/openbios-devel/fs/hfsplus/hfsp_fs.c ============================================================================== --- trunk/openbios-devel/fs/hfsplus/hfsp_fs.c Sun Mar 14 15:21:02 2010 (r689) +++ trunk/openbios-devel/fs/hfsplus/hfsp_fs.c Sun Mar 14 15:33:32 2010 (r690) @@ -15,7 +15,7 @@ */
#include "openbios/config.h" -#include "openbios/fs.h" +#include "fs/fs.h" #include "libhfsp.h" #include "volume.h" #include "record.h"
Modified: trunk/openbios-devel/fs/ioglue.c ============================================================================== --- trunk/openbios-devel/fs/ioglue.c Sun Mar 14 15:21:02 2010 (r689) +++ trunk/openbios-devel/fs/ioglue.c Sun Mar 14 15:33:32 2010 (r690) @@ -16,7 +16,7 @@
#include "openbios/config.h" #include "openbios/bindings.h" -#include "openbios/fs.h" +#include "fs/fs.h" #include "libc/diskio.h" #include "os.h" #include "hfs_mdb.h"
Modified: trunk/openbios-devel/fs/iso9660/iso9660_fs.c ============================================================================== --- trunk/openbios-devel/fs/iso9660/iso9660_fs.c Sun Mar 14 15:21:02 2010 (r689) +++ trunk/openbios-devel/fs/iso9660/iso9660_fs.c Sun Mar 14 15:33:32 2010 (r690) @@ -5,7 +5,7 @@ */
#include "libiso9660.h" -#include "openbios/fs.h" +#include "fs/fs.h" #include "libc/vsprintf.h"
typedef struct {
Copied: trunk/openbios-devel/include/fs/fs.h (from r689, trunk/openbios-devel/include/openbios/fs.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/openbios-devel/include/fs/fs.h Sun Mar 14 15:33:32 2010 (r690, copy of r689, trunk/openbios-devel/include/openbios/fs.h) @@ -0,0 +1,90 @@ +/* + * Creation Date: <2001/05/06 17:12:45 samuel> + * Time-stamp: <2003/10/22 11:43:45 samuel> + * + * <fs_loader.h> + * + * Generic file system access + * + * Copyright (C) 2001, 2002, 2003 Samuel Rydh (samuel@ibrium.se) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation + * + */ + +#ifndef _H_FS +#define _H_FS + + +typedef struct fs_ops fs_ops_t; +typedef struct opaque_struct file_desc_t; + +#define fs_open_path( fs, path ) (fs)->open_path( fs, path ) +#define fs_search_rom( fs ) (fs)->search_rom( fs ) +#define fs_search_file( fs, name ) (fs)->search_file( fs, name ) +#define fs_vol_name( fs, buf, size ) (fs)->vol_name( fs, buf, size ) + +struct fs_ops { + void *fs_data; + int fd; /* owner block device */ + int type; + + void (*close_fs)( fs_ops_t *fs ); + file_desc_t *(*open_path)( fs_ops_t *fs, const char *path ); + file_desc_t *(*search_rom)( fs_ops_t *fs ); + file_desc_t *(*search_file)( fs_ops_t *fs, const char *name ); + char *(*vol_name)( fs_ops_t *fs, char *buf, int size ); + + /* file ops */ + void (*close)( file_desc_t *file ); + int (*read)( file_desc_t *file, void *buf, size_t count ); + int (*lseek)( file_desc_t *file, off_t offset, int whence ); + char *(*get_path)( file_desc_t *file, char *buf, int len ); + void (*dir)( file_desc_t *file ); + + const char *(*get_fstype)( fs_ops_t *fs ); +}; + +extern fs_ops_t *fs_open( int fs_type, int fd ); +extern void fs_close( fs_ops_t *fs ); +const char *fs_get_name( fs_ops_t *fs ); + +#ifdef CONFIG_HFSP +extern int fs_hfsp_open( int fd, fs_ops_t *fs ); +#else +static inline int fs_hfsp_open( int fd, fs_ops_t *fs ) { return -1; } +#endif + +#ifdef CONFIG_HFS +extern int fs_hfs_open( int fd, fs_ops_t *fs ); +#else +static inline int fs_hfs_open( int fd, fs_ops_t *fs ) { return -1; } +#endif + +#ifdef CONFIG_ISO9660 +extern int fs_iso9660_open( int fd, fs_ops_t *fs ); +#else +static inline int fs_iso9660_open( int fd, fs_ops_t *fs ) { return -1; } +#endif + +#ifdef CONFIG_EXT2 +extern int fs_ext2_open( int fd, fs_ops_t *fs ); +#else +static inline int fs_ext2_open( int fd, fs_ops_t *fs ) { return -1; } +#endif + +#ifdef CONFIG_GRUBFS +extern int fs_grubfs_open( int fd, fs_ops_t *fs ); +#else +static inline int fs_grubfs_open( int fd, fs_ops_t *fs ) { return -1; } +#endif + + + +/* misc */ +extern char *get_hfs_vol_name( int fd, char *buf, int size ); + + +#endif /* _H_FS */
Modified: trunk/openbios-devel/packages/misc-files.c ============================================================================== --- trunk/openbios-devel/packages/misc-files.c Sun Mar 14 15:21:02 2010 (r689) +++ trunk/openbios-devel/packages/misc-files.c Sun Mar 14 15:33:32 2010 (r690) @@ -17,7 +17,7 @@
#include "openbios/config.h" #include "openbios/bindings.h" -#include "openbios/fs.h" +#include "fs/fs.h" #include "libc/diskio.h" #include "packages.h"