OSDN Git Service

Add functionlity to the scripts to replace tokens in kernel headers
authorRaghu Gandham <raghu@mips.com>
Thu, 17 Jan 2013 00:42:47 +0000 (16:42 -0800)
committerRaghu Gandham <raghu@mips.com>
Thu, 17 Jan 2013 22:39:09 +0000 (14:39 -0800)
based on architecture.

libc/kernel/arch-mips/asm/fcntl.h
libc/kernel/arch-mips/asm/sn/kldir.h
libc/kernel/arch-mips/asm/stat.h
libc/kernel/tools/clean_header.py
libc/kernel/tools/defaults.py

index 73de4ad..996f996 100644 (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;
index 6c663ca..ef41013 100644 (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;
index a8fee78..0b581b2 100644 (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;
index 01569fc..1a5471a 100755 (executable)
@@ -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 )
index 6c7efd6..da02481 100644 (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__",