Add functionlity to the scripts to replace tokens in kernel headers

based on architecture.
This commit is contained in:
Raghu Gandham 2013-01-16 16:42:47 -08:00
parent f3fe19459f
commit a864c2c234
5 changed files with 13 additions and 5 deletions

View File

@ -47,8 +47,8 @@ struct flock {
short l_type;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
short l_whence;
off_t l_start;
off_t l_len;
__kernel_off_t l_start;
__kernel_off_t l_len;
long l_sysid;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__kernel_pid_t l_pid;

View File

@ -79,7 +79,7 @@
#ifndef __ASSEMBLY__
typedef struct kldir_ent_s {
u64 magic;
off_t offset;
__kernel_off_t offset;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
unsigned long pointer;
size_t size;

View File

@ -34,7 +34,7 @@ struct stat {
gid_t st_gid;
unsigned st_rdev;
long st_pad2[2];
off_t st_size;
__kernel_off_t st_size;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
long st_pad3;
time_t st_atime;
@ -91,7 +91,7 @@ struct stat {
unsigned int st_rdev;
unsigned int st_pad1[3];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
off_t st_size;
__kernel_off_t st_size;
unsigned int st_atime;
unsigned int st_atime_nsec;
unsigned int st_mtime;

View File

@ -66,6 +66,9 @@ def cleanupFile( path, original_path):
if arch and arch in kernel_default_arch_macros:
macros.update(kernel_default_arch_macros[arch])
if arch and arch in kernel_arch_token_replacements:
blocks.replaceTokens( kernel_arch_token_replacements[arch] )
blocks.optimizeMacros( macros )
blocks.optimizeIf01()
blocks.removeVarsAndFuncs( statics )

View File

@ -48,6 +48,11 @@ kernel_default_arch_macros = {
"mips": {"CONFIG_32BIT":"1"},
}
kernel_arch_token_replacements = {
"arm": {},
"x86": {},
"mips": {"off_t":"__kernel_off_t"},
}
# Replace tokens in the output according to this mapping
kernel_token_replacements = {
"asm": "__asm__",