Mercurial > ecos
comparison packages/fs/rom/current/support/mk_romfs.c @ 2980:8d5bed76c596
* cdl/romfs.cdl: Add CYGFUN_FS_ROM_FLASH_BLOCK_DEVICE_LOOKUP option.
* support/mk_romfs.c: Fix Win32 build.
* src/romfs.c: Add ability to mount a flash block device by name.
| author | jld |
|---|---|
| date | Mon, 29 Nov 2010 16:29:19 +0000 |
| parents | 74dbf4c3f2e1 |
| children |
comparison
equal
deleted
inserted
replaced
| 2979:00ddfb443539 | 2980:8d5bed76c596 |
|---|---|
| 6 // | 6 // |
| 7 //========================================================================== | 7 //========================================================================== |
| 8 // ####ECOSGPLCOPYRIGHTBEGIN#### | 8 // ####ECOSGPLCOPYRIGHTBEGIN#### |
| 9 // ------------------------------------------- | 9 // ------------------------------------------- |
| 10 // This file is part of eCos, the Embedded Configurable Operating System. | 10 // This file is part of eCos, the Embedded Configurable Operating System. |
| 11 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. | 11 // Copyright (C) 1998, 1999, 2000, 2001, 2002, 2010 Free Software Foundation, Inc. |
| 12 // | 12 // |
| 13 // eCos is free software; you can redistribute it and/or modify it under | 13 // eCos is free software; you can redistribute it and/or modify it under |
| 14 // the terms of the GNU General Public License as published by the Free | 14 // the terms of the GNU General Public License as published by the Free |
| 15 // Software Foundation; either version 2 or (at your option) any later | 15 // Software Foundation; either version 2 or (at your option) any later |
| 16 // version. | 16 // version. |
| 85 // All executable files should be aligned to this sized boundary (minimum probably 32) | 85 // All executable files should be aligned to this sized boundary (minimum probably 32) |
| 86 #define EXEC_ALIGN 32 | 86 #define EXEC_ALIGN 32 |
| 87 | 87 |
| 88 // Undefine this if the host filesystem does not support lstat() | 88 // Undefine this if the host filesystem does not support lstat() |
| 89 #define HAS_LSTAT | 89 #define HAS_LSTAT |
| 90 | |
| 91 // Win32 definitions | |
| 92 #ifdef _WIN32 | |
| 93 #undef HAS_LSTAT | |
| 94 #define S_ISLNK(m) (0) | |
| 95 typedef unsigned int uid_t; | |
| 96 typedef unsigned int gid_t; | |
| 97 #endif | |
| 90 | 98 |
| 91 //========================================================================== | 99 //========================================================================== |
| 92 | 100 |
| 93 // Return (n) aligned to the next (b) byte boundary | 101 // Return (n) aligned to the next (b) byte boundary |
| 94 #define ALIGN_TO( n, b ) (( (n) + (b)-1 ) & ~((b)-1)) | 102 #define ALIGN_TO( n, b ) (( (n) + (b)-1 ) & ~((b)-1)) |
| 268 if ( S_ISFIFO(posix_mode ) ) result |= 1<<4; | 276 if ( S_ISFIFO(posix_mode ) ) result |= 1<<4; |
| 269 // We cannot create MQ, SEM, or SHM entries here | 277 // We cannot create MQ, SEM, or SHM entries here |
| 270 if ( posix_mode & S_IRUSR ) result |= 1<<16; | 278 if ( posix_mode & S_IRUSR ) result |= 1<<16; |
| 271 if ( posix_mode & S_IWUSR ) result |= 1<<17; | 279 if ( posix_mode & S_IWUSR ) result |= 1<<17; |
| 272 if ( posix_mode & S_IXUSR ) result |= 1<<18; | 280 if ( posix_mode & S_IXUSR ) result |= 1<<18; |
| 281 #ifndef _WIN32 | |
| 273 if ( posix_mode & S_IRGRP ) result |= 1<<19; | 282 if ( posix_mode & S_IRGRP ) result |= 1<<19; |
| 274 if ( posix_mode & S_IWGRP ) result |= 1<<20; | 283 if ( posix_mode & S_IWGRP ) result |= 1<<20; |
| 275 if ( posix_mode & S_IXGRP ) result |= 1<<21; | 284 if ( posix_mode & S_IXGRP ) result |= 1<<21; |
| 276 if ( posix_mode & S_IROTH ) result |= 1<<22; | 285 if ( posix_mode & S_IROTH ) result |= 1<<22; |
| 277 if ( posix_mode & S_IWOTH ) result |= 1<<23; | 286 if ( posix_mode & S_IWOTH ) result |= 1<<23; |
| 278 if ( posix_mode & S_IXOTH ) result |= 1<<24; | 287 if ( posix_mode & S_IXOTH ) result |= 1<<24; |
| 279 if ( posix_mode & S_ISUID ) result |= 1<<25; | 288 if ( posix_mode & S_ISUID ) result |= 1<<25; |
| 280 if ( posix_mode & S_ISGID ) result |= 1<<26; | 289 if ( posix_mode & S_ISGID ) result |= 1<<26; |
| 290 #endif | |
| 281 return result; | 291 return result; |
| 282 } | 292 } |
| 283 | 293 |
| 284 static const char *AddDirEntry( const char *name, node *parent_node, int node_num ) { | 294 static const char *AddDirEntry( const char *name, node *parent_node, int node_num ) { |
| 285 int this_size = ((strlen(name) + 4 + 4 + 1) + 31) & ~31; | 295 int this_size = ((strlen(name) + 4 + 4 + 1) + 31) & ~31; |
