mirror of
https://github.com/elua/elua.git
synced 2025-01-08 20:56:17 +08:00
bd1465ca50
Conflicts: SConstruct doc/en/arch_platform.html doc/en/comunity.html doc/en/overview.html doc/en/refman.html doc/en/refman_gen.html doc/en/status.html doc/en/tut_bootstick.html doc/images/lng_pt.png doc/images/minusnode.png doc/images/next.png doc/images/node.png doc/images/nodelast.png doc/images/plusnode.png doc/images/plusnodelast.png doc/images/previous.png doc/images/showall.png doc/images/sync.png doc/images/vertline.png doc/pt/arch.html doc/pt/arch_coding.html doc/pt/arch_con_term.html doc/pt/arch_newport.html doc/pt/arch_overview.html doc/pt/arch_platform.html doc/pt/arch_tcpip.html doc/pt/building.html doc/pt/comunity.html doc/pt/dl_binaries.html doc/pt/dl_old.html doc/pt/dl_sources.html doc/pt/downloads.html doc/pt/examples.html doc/pt/faq.html doc/pt/installing_i386.html doc/pt/installing_lm3s.html doc/pt/news.html doc/pt/overview.html doc/pt/refman_dep.html doc/pt/refman_gen.html doc/pt/status.html doc/pt/tc_386.html doc/pt/toolchains.html doc/pt/tut_openocd.html doc/pt/using.html romfs/LM3S.lua romfs/led.lua romfs/morse.lua romfs/pong.lua src/lua/linit.c src/modules/auxmods.h src/platform/lm3s/platform.c src/platform/lm3s/platform_conf.h src/platform/sim/platform_conf.h
46 lines
1020 B
C
46 lines
1020 B
C
// Read-only ROM filesystem
|
|
|
|
#ifndef __FS_H__
|
|
#define __FS_H__
|
|
|
|
#include "type.h"
|
|
#include "devman.h"
|
|
// Maximum length of a filename in the filesystem
|
|
#define MAX_FNAME_LENGTH 30
|
|
|
|
/*******************************************************************************
|
|
The Read-Only "filesystem" resides in a contiguous zone of memory, with the
|
|
following structure, repeated for each file:
|
|
|
|
Filename: ASCIIZ, max length is MAX_FNAME_LENGTH defined here, empty if last file
|
|
File size: (2 bytes)
|
|
File data: (file size bytes)
|
|
|
|
*******************************************************************************/
|
|
|
|
enum
|
|
{
|
|
FS_FILE_NOT_FOUND,
|
|
FS_FILE_OK
|
|
};
|
|
|
|
// This is the function used to read a byte at the given address from the file
|
|
// system
|
|
typedef u8 ( *p_read_fs_byte )( u32 );
|
|
|
|
// A small "FILE" structure
|
|
typedef struct
|
|
{
|
|
u32 baseaddr;
|
|
u32 offset;
|
|
u16 size;
|
|
p_read_fs_byte p_read_func;
|
|
} FS;
|
|
|
|
// FS functions
|
|
DM_DEVICE* romfs_init();
|
|
u32 romfs_get_dir_entry( u32 offset, char *fname, u16 *fsize );
|
|
|
|
#endif
|
|
|