> This is just a new symptom of the fact that m68k support has been wrong for
> a long time.  It's using the syscall table that's right for i386, and they
> are not the same any more.  An m68k hacker needs to supply a current
> syscall table for strace.

While the syscall table is indeed outdated (the lchown32/chown32 swap
isn't in there, and it just totally gets lost after around syscall 220),
the root cause is a missing __NR_exit_group declaration in defs.h.

Patch attached FYI; please note that this will generate a
linux/syscallent.h.m68k suitable for compilation; I still need to merge
the changes back into linux/syscallent.h proper, or add a linux/m68k
subdir. With these changes applied, the compilation at least progresses
beyond the earlier failure.

A point I'm not clear on: is the inclusion of __NR_exit_group or
SYS_exit as real syscall no in the defs really necessary? powerpc also
calls the same function on both exit and exit_group, but doesn't pass the
real syscall number to the strace handler function.

        Michael
--- defs.h.orig 2005-07-05 18:44:14.000000000 +0200
+++ defs.h      2005-07-05 18:44:14.000000000 +0200
@@ -343,6 +343,8 @@
 #   define __NR_exit_group 248
 #  elif defined SPARC || defined SPARC64
 #   define __NR_exit_group 188
+#  elif defined M68K
+#   define __NR_exit_group 247
 #  endif /* ALPHA et al */
 # endif        /* !__NR_exit_group */
 #endif /* LINUX */
--- linux/syscallent.h.orig     2005-06-08 01:21:24.000000000 +0200
+++ linux/syscallent.h.m68k     2005-07-05 16:13:22.000000000 +0200
@@ -44,11 +44,7 @@
        { 1,    0,      sys_time,               "time"          }, /* 13 */
        { 3,    TF,     sys_mknod,              "mknod"         }, /* 14 */
        { 2,    TF,     sys_chmod,              "chmod"         }, /* 15 */
-#ifdef M68K
        { 3,    TF,     sys_chown,              "chown"         }, /* 16 */
-#else
-       { 3,    TF,     sys_chown,              "lchown"        }, /* 16 */
-#endif
        { 0,    0,      sys_break,              "break"         }, /* 17 */
        { 2,    TF,     sys_oldstat,            "oldstat"       }, /* 18 */
        { 3,    0,      sys_lseek,              "lseek"         }, /* 19 */
@@ -155,11 +151,7 @@
        { 5,    TP,     sys_clone,              "clone", SYS_clone }, /* 120 */
        { 2,    0,      sys_setdomainname,      "setdomainname" }, /* 121 */
        { 1,    0,      sys_uname,              "uname"         }, /* 122 */
-#ifdef M68K
        { 4,    0,      sys_cacheflush,         "cacheflush"    }, /* 123 */
-#else
-       { 3,    0,      sys_modify_ldt,         "modify_ldt"    }, /* 123 */
-#endif
        { 1,    0,      sys_adjtimex,           "adjtimex"      }, /* 124 */
        { 3,    0,      sys_mprotect,           "mprotect"      }, /* 125 */
        { 3,    TS,     sys_sigprocmask,        "sigprocmask"   }, /* 126 */
@@ -202,11 +194,7 @@
        { 4,    0,      sys_mremap,             "mremap"        }, /* 163 */
        { 3,    0,      sys_setresuid,          "setresuid"     }, /* 164 */
        { 3,    0,      sys_getresuid,          "getresuid"     }, /* 165 */
-#ifdef M68K
-       { 5,    0,      printargs,              "SYS_166"       }, /* 166 */
-#else
-       { 5,    0,      printargs,              "vm86"          }, /* 166 */
-#endif
+       { 5,    0,      printargs,              "getpagesize"   }, /* 166 */
        { 5,    0,      sys_query_module,       "query_module"  }, /* 167 */
        { 3,    0,      sys_poll,               "poll"          }, /* 168 */
        { 3,    0,      printargs,              "nfsservctl"    }, /* 169 */
@@ -220,14 +208,9 @@
        { 4,    TS,     sys_rt_sigtimedwait,    "rt_sigtimedwait"}, /* 177 */
        { 3,    TS,     sys_rt_sigqueueinfo,    "rt_sigqueueinfo"}, /* 178 */
        { 2,    TS,     sys_rt_sigsuspend,      "rt_sigsuspend" }, /* 179 */
-
        { 5,    TF,     sys_pread,              "pread64", SYS_read }, /* 180 */
        { 5,    TF,     sys_pwrite,             "pwrite64", SYS_write }, /* 181 
*/
-#ifdef M68K
        { 3,    TF,     sys_chown,              "lchown"        }, /* 182 */
-#else
-       { 3,    TF,     sys_chown,              "chown"         }, /* 182 */
-#endif
        { 2,    TF,     sys_getcwd,             "getcwd"        }, /* 183 */
        { 2,    0,      sys_capget,             "capget"        }, /* 184 */
        { 2,    0,      sys_capset,             "capset"        }, /* 185 */
@@ -243,7 +226,7 @@
        { 2,    TF,     sys_stat64,             "stat64"        }, /* 195 */
        { 2,    TF,     sys_lstat64,            "lstat64"       }, /* 196 */
        { 2,    TF,     sys_fstat64,            "fstat64"       }, /* 197 */
-       { 3,    TF,     sys_chown,              "lchown32"      }, /* 198 */
+       { 3,    TF,     sys_chown,              "chown32"       }, /* 198 */
        { 0,    0,      sys_getuid,             "getuid32"      }, /* 199 */
 
        { 0,    0,      sys_getgid,             "getgid32"      }, /* 200 */
@@ -258,82 +241,88 @@
        { 3,    0,      sys_getresuid,          "getresuid32"   }, /* 209 */
        { 3,    0,      sys_setresgid,          "setresgid32"   }, /* 210 */
        { 3,    0,      sys_getresgid,          "getresgid32"   }, /* 211 */
-       { 3,    TF,     sys_chown,              "chown32"       }, /* 212 */
+       { 3,    TF,     sys_chown,              "lchown32"      }, /* 212 */
        { 1,    0,      sys_setuid,             "setuid32"      }, /* 213 */
        { 1,    0,      sys_setgid,             "setgid32"      }, /* 214 */
        { 1,    0,      sys_setfsuid,           "setfsuid32"    }, /* 215 */
        { 1,    0,      sys_setfsgid,           "setfsgid32"    }, /* 216 */
        { 2,    TF,     sys_pivotroot,          "pivot_root"    }, /* 217 */
-       { 3,    0,      sys_mincore,            "mincore"       }, /* 218 */
-       { 3,    0,      sys_madvise,            "madvise"       }, /* 219 */
+
+/* m68k sync stops here */
+
+       { 5,    0,      printargs,              "SYS_218"       }, /* 218 */
+       { 5,    0,      printargs,              "SYS_219"       }, /* 219 */
+
        { 4,    0,      sys_getdents64,         "getdents64"    }, /* 220 */
-       { 3,    0,      sys_fcntl,              "fcntl64"       }, /* 221 */
-       { 4,    0,      printargs,              "SYS_222"       }, /* 222 */
-/*TODO*/{ 5,   0,      printargs,              "security"      }, /* 223 */
-       { 0,    0,      printargs,              "gettid"        }, /* 224 */
-       { 4,    0,      sys_readahead,          "readahead"     }, /* 225 */
-       { 5,    TF,     sys_setxattr,           "setxattr"      }, /* 226 */
-       { 5,    TF,     sys_setxattr,           "lsetxattr"     }, /* 227 */
-       { 5,    0,      sys_fsetxattr,          "fsetxattr"     }, /* 228 */
-       { 4,    TF,     sys_getxattr,           "getxattr"      }, /* 229 */
-       { 4,    TF,     sys_getxattr,           "lgetxattr"     }, /* 230 */
-       { 4,    0,      sys_fgetxattr,          "fgetxattr"     }, /* 231 */
-       { 3,    TF,     sys_listxattr,          "listxattr"     }, /* 232 */
-       { 3,    TF,     sys_listxattr,          "llistxattr"    }, /* 233 */
-       { 3,    0,      sys_flistxattr,         "flistxattr"    }, /* 234 */
-       { 2,    TF,     sys_removexattr,        "removexattr"   }, /* 235 */
-       { 2,    TF,     sys_removexattr,        "lremovexattr"  }, /* 236 */
-       { 2,    0,      sys_fremovexattr,       "fremovexattr"  }, /* 237 */
-       { 2,    TS,     sys_kill,               "tkill"         }, /* 238 */
-       { 4,    TF,     sys_sendfile64,         "sendfile64"    }, /* 239 */
-       { 5,    0,      sys_futex,              "futex"         }, /* 240 */
-       { 3,    0,      sys_sched_setaffinity,  "sched_setaffinity" },/* 241 */
-       { 3,    0,      sys_sched_getaffinity,  "sched_getaffinity" },/* 242 */
-       { 1,    0,      sys_set_thread_area,    "set_thread_area" }, /* 243 */
-       { 1,    0,      sys_get_thread_area,    "get_thread_area" }, /* 244 */
-       { 2,    0,      sys_io_setup,           "io_setup"      }, /* 245 */
-       { 1,    0,      sys_io_destroy,         "io_destroy"    }, /* 246 */
-       { 5,    0,      sys_io_getevents,       "io_getevents"  }, /* 247 */
-       { 3,    0,      sys_io_submit,          "io_submit"     }, /* 248 */
-       { 3,    0,      sys_io_cancel,          "io_cancel"     }, /* 249 */
-       { 5,    TF,     sys_fadvise64,          "fadvise64"     }, /* 250 */
-       { 5,    0,      printargs,              "SYS_251"       }, /* 251 */
-       { 1,    TP,     sys_exit,               "exit_group", __NR_exit_group 
}, /* 252 */
-       { 4,    0,      printargs,              "lookup_dcookie"}, /* 253 */
-       { 1,    0,      sys_epoll_create,       "epoll_create"  }, /* 254 */
-       { 4,    0,      sys_epoll_ctl,          "epoll_ctl"     }, /* 255 */
-       { 4,    0,      sys_epoll_wait,         "epoll_wait"    }, /* 256 */
-       { 5,    0,      sys_remap_file_pages,   "remap_file_pages"}, /* 257 */
-       { 1,    0,      printargs,              "set_tid_address"}, /* 258 */
-       { 3,    0,      sys_timer_create,       "timer_create"  }, /* 259 */
-       { 4,    0,      sys_timer_settime,      "timer_settime" }, /* 260 */
-       { 2,    0,      sys_timer_gettime,      "timer_gettime" }, /* 261 */
-       { 1,    0,      sys_timer_getoverrun,   "timer_getoverrun"}, /* 262 */
-       { 1,    0,      sys_timer_delete,       "timer_delete"  }, /* 263 */
-       { 2,    0,      sys_clock_settime,      "clock_settime" }, /* 264 */
-       { 2,    0,      sys_clock_gettime,      "clock_gettime" }, /* 265 */
-       { 2,    0,      sys_clock_getres,       "clock_getres"  }, /* 266 */
-       { 4,    0,      sys_clock_nanosleep,    "clock_nanosleep"}, /* 267 */
-       { 3,    TF,     sys_statfs64,           "statfs64"      }, /* 268 */
-       { 3,    TF,     sys_fstatfs64,          "fstatfs64"     }, /* 269 */
-       { 3,    TS,     sys_tgkill,             "tgkill"        }, /* 270 */
-       { 2,    TF,     sys_utimes,             "utimes"        }, /* 271 */
-       { 6,    TF,     sys_fadvise64_64,       "fadvise64_64"  }, /* 272 */
-       { 5,    0,      printargs,              "vserver"       }, /* 273 */
-       { 6,    0,      sys_mbind,              "mbind"         }, /* 274 */
-       { 5,    0,      sys_get_mempolicy,      "get_mempolicy" }, /* 275 */
-       { 3,    0,      sys_set_mempolicy,      "set_mempolicy" }, /* 276 */
-       { 4,    0,      sys_mq_open,            "mq_open"       }, /* 277 */
-       { 1,    0,      sys_mq_unlink,          "mq_unlink"     }, /* 278 */
-       { 5,    0,      sys_mq_timedsend,       "mq_timedsend"  }, /* 279 */
-       { 5,    0,      sys_mq_timedreceive,    "mq_timedreceive" }, /* 280 */
-       { 2,    0,      sys_mq_notify,          "mq_notify"     }, /* 281 */
-       { 3,    0,      sys_mq_getsetattr,      "mq_getsetattr" }, /* 282 */
-       { 5,    0,      printargs,              "sys_kexec_load" }, /* 283 */
-       { 5,    TP,     sys_waitid,             "waitid", SYS_waitid }, /* 284 
*/
+       { 0,    0,      printargs,              "gettid"        }, /* 221 */
+       { 2,    TS,     sys_kill,               "tkill"         }, /* 222 */
+       { 5,    TF,     sys_setxattr,           "setxattr"      }, /* 223 */
+       { 5,    TF,     sys_setxattr,           "lsetxattr"     }, /* 224 */
+       { 5,    0,      sys_fsetxattr,          "fsetxattr"     }, /* 225 */
+       { 4,    TF,     sys_getxattr,           "getxattr"      }, /* 226 */
+       { 4,    TF,     sys_getxattr,           "lgetxattr"     }, /* 227 */
+       { 4,    0,      sys_fgetxattr,          "fgetxattr"     }, /* 228 */
+       { 3,    TF,     sys_listxattr,          "listxattr"     }, /* 229 */
+       { 3,    TF,     sys_listxattr,          "llistxattr"    }, /* 230 */
+       { 3,    0,      sys_flistxattr,         "flistxattr"    }, /* 231 */
+       { 2,    TF,     sys_removexattr,        "removexattr"   }, /* 232 */
+       { 2,    TF,     sys_removexattr,        "lremovexattr"  }, /* 233 */
+       { 2,    0,      sys_fremovexattr,       "fremovexattr"  }, /* 234 */
+       { 5,    0,      sys_futex,              "futex"         }, /* 235 */
+       { 4,    TF,     sys_sendfile64,         "sendfile64"    }, /* 236 */
+       { 3,    0,      sys_mincore,            "mincore"       }, /* 237 */
+       { 3,    0,      sys_madvise,            "madvise"       }, /* 238 */
+       { 3,    0,      sys_fcntl,              "fcntl64"       }, /* 239 */
+       { 4,    0,      sys_readahead,          "readahead"     }, /* 240 */
+       { 2,    0,      sys_io_setup,           "io_setup"      }, /* 241 */
+       { 1,    0,      sys_io_destroy,         "io_destroy"    }, /* 242 */
+       { 5,    0,      sys_io_getevents,       "io_getevents"  }, /* 243 */
+       { 3,    0,      sys_io_submit,          "io_submit"     }, /* 244 */
+       { 3,    0,      sys_io_cancel,          "io_cancel"     }, /* 245 */
+       { 5,    TF,     sys_fadvise64,          "fadvise64"     }, /* 246 */
+       { 1,    TP,     sys_exit,               "exit_group", __NR_exit_group 
}, /* 247 */
+       { 4,    0,      printargs,              "lookup_dcookie"}, /* 248 */
+       { 1,    0,      sys_epoll_create,       "epoll_create"  }, /* 249 */
+       { 4,    0,      sys_epoll_ctl,          "epoll_ctl"     }, /* 250 */
+       { 4,    0,      sys_epoll_wait,         "epoll_wait"    }, /* 251 */
+       { 5,    0,      sys_remap_file_pages,   "remap_file_pages"}, /* 252 */
+       { 1,    0,      printargs,              "set_tid_address"}, /* 253 */
+       { 3,    0,      sys_timer_create,       "timer_create"  }, /* 254 */
+       { 4,    0,      sys_timer_settime,      "timer_settime" }, /* 255 */
+       { 2,    0,      sys_timer_gettime,      "timer_gettime" }, /* 256 */
+       { 1,    0,      sys_timer_getoverrun,   "timer_getoverrun"}, /* 257 */
+       { 1,    0,      sys_timer_delete,       "timer_delete"  }, /* 258 */
+       { 2,    0,      sys_clock_settime,      "clock_settime" }, /* 259 */
+       { 2,    0,      sys_clock_gettime,      "clock_gettime" }, /* 260 */
+       { 2,    0,      sys_clock_getres,       "clock_getres"  }, /* 261 */
+       { 4,    0,      sys_clock_nanosleep,    "clock_nanosleep"}, /* 262 */
+       { 3,    TF,     sys_statfs64,           "statfs64"      }, /* 263 */
+       { 3,    TF,     sys_fstatfs64,          "fstatfs64"     }, /* 264 */
+       { 3,    TS,     sys_tgkill,             "tgkill"        }, /* 265 */
+       { 2,    TF,     sys_utimes,             "utimes"        }, /* 266 */
+       { 6,    TF,     sys_fadvise64_64,       "fadvise64_64"  }, /* 267 */
+       { 6,    0,      sys_mbind,              "mbind"         }, /* 268 */
+       { 5,    0,      sys_get_mempolicy,      "get_mempolicy" }, /* 269 */
+       { 3,    0,      sys_set_mempolicy,      "set_mempolicy" }, /* 270 */
+       { 4,    0,      sys_mq_open,            "mq_open"       }, /* 271 */
+       { 1,    0,      sys_mq_unlink,          "mq_unlink"     }, /* 272 */
+       { 5,    0,      sys_mq_timedsend,       "mq_timedsend"  }, /* 273 */
+       { 5,    0,      sys_mq_timedreceive,    "mq_timedreceive" }, /* 274 */
+       { 2,    0,      sys_mq_notify,          "mq_notify"     }, /* 275 */
+       { 3,    0,      sys_mq_getsetattr,      "mq_getsetattr" }, /* 276 */
+       { 5,    TP,     sys_waitid,             "waitid", SYS_waitid }, /* 277 
*/
+       { 5,    0,      printargs,              "vserver"       }, /* 278 */
+       { 5,    0,      printargs,              "add_key"       }, /* 279 */
+       { 5,    0,      printargs,              "request_key"   }, /* 280 */
+       { 5,    0,      printargs,              "keyctl"        }, /* 281 */
+
+       { 5,    0,      printargs,              "SYS_282"       }, /* 282 */
+       { 5,    0,      printargs,              "SYS_283"       }, /* 283 */
+       { 5,    0,      printargs,              "SYS_284"       }, /* 284 */
        { 5,    0,      printargs,              "SYS_285"       }, /* 285 */
        { 5,    0,      printargs,              "SYS_286"       }, /* 286 */
        { 5,    0,      printargs,              "SYS_287"       }, /* 287 */
+
        { 5,    0,      printargs,              "SYS_288"       }, /* 288 */
        { 5,    0,      printargs,              "SYS_289"       }, /* 289 */
        { 5,    0,      printargs,              "SYS_290"       }, /* 290 */
@@ -347,6 +336,20 @@
        { 5,    0,      printargs,              "SYS_298"       }, /* 298 */
        { 5,    0,      printargs,              "SYS_299"       }, /* 299 */
 
+
+/* leftover garbage */
+
+         /*{ 4,        0,      printargs,              "SYS_222"       }, */   
 /* 222 */
+/*TODO*/  /*{ 5,       0,      printargs,              "security"      }, */   
 /* 223 */
+
+         /*{ 3,        0,      sys_sched_setaffinity,  "sched_setaffinity" 
},*/ /* 241 */
+         /*{ 3,        0,      sys_sched_getaffinity,  "sched_getaffinity" 
},*/ /* 242 */
+         /*{ 1,        0,      sys_set_thread_area,    "set_thread_area" }, */ 
 /* 243 */
+         /*{ 1,        0,      sys_get_thread_area,    "get_thread_area" }, */ 
 /* 244 */
+         /*{ 5,        0,      printargs,              "SYS_251"       }, */   
 /* 251 */
+         /*{ 5,        0,      printargs,              "sys_kexec_load" }, */  
 /* 283 */
+
+
 #if SYS_socket_subcall != 300
  #error fix me
 #endif

Reply via email to