From: Stephane Eranian Reserve the system calls for the perfmon2 interface on IA-64, I386, X86-64, and PowerPC architectures. The syscalls are pointing to sys_ni() for now. (akpm: perfctr has been abandoned and all attention is now focussed upon perfmon. It's an important feature and will probably be merged into mainline. For now, we reserve the syscalls so that developers, users and distros can sanely test and ship the feature). Signed-off-by: Cc: "Luck, Tony" Cc: Andi Kleen Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Signed-off-by: Andrew Morton --- arch/i386/kernel/syscall_table.S | 12 ++++++++++++ arch/ia64/kernel/entry.S | 12 ++++++++++++ arch/powerpc/kernel/systbl.S | 12 ++++++++++++ arch/ppc/kernel/misc.S | 12 ++++++++++++ include/asm-i386/unistd.h | 14 +++++++++++++- include/asm-ia64/unistd.h | 12 ++++++++++++ include/asm-powerpc/unistd.h | 14 +++++++++++++- include/asm-x86_64/unistd.h | 26 +++++++++++++++++++++++++- kernel/sys_ni.c | 14 ++++++++++++++ 9 files changed, 125 insertions(+), 3 deletions(-) diff -puN arch/i386/kernel/syscall_table.S~perfmon2-reserve-system-calls arch/i386/kernel/syscall_table.S --- devel/arch/i386/kernel/syscall_table.S~perfmon2-reserve-system-calls 2005-11-16 23:09:29.000000000 -0800 +++ devel-akpm/arch/i386/kernel/syscall_table.S 2005-11-16 23:09:29.000000000 -0800 @@ -294,3 +294,15 @@ ENTRY(sys_call_table) .long sys_inotify_add_watch .long sys_inotify_rm_watch .long sys_migrate_pages + .long sys_pfm_create_context /* 295 */ + .long sys_pfm_write_pmcs + .long sys_pfm_write_pmds + .long sys_pfm_read_pmds + .long sys_pfm_load_context + .long sys_pfm_start /* 300 */ + .long sys_pfm_stop + .long sys_pfm_restart + .long sys_pfm_create_evtsets + .long sys_pfm_getinfo_evtsets + .long sys_pfm_delete_evtsets /* 305 */ + .long sys_pfm_unload_context diff -puN arch/ia64/kernel/entry.S~perfmon2-reserve-system-calls arch/ia64/kernel/entry.S --- devel/arch/ia64/kernel/entry.S~perfmon2-reserve-system-calls 2005-11-16 23:09:29.000000000 -0800 +++ devel-akpm/arch/ia64/kernel/entry.S 2005-11-16 23:09:29.000000000 -0800 @@ -1601,5 +1601,17 @@ sys_call_table: data8 sys_inotify_add_watch data8 sys_inotify_rm_watch data8 sys_migrate_pages // 1280 + data8 sys_pfm_create_context + data8 sys_pfm_write_pmcs + data8 sys_pfm_write_pmds + data8 sys_pfm_read_pmds + data8 sys_pfm_load_context // 1285 + data8 sys_pfm_start + data8 sys_pfm_stop + data8 sys_pfm_restart + data8 sys_pfm_create_evtsets + data8 sys_pfm_getinfo_evtsets // 1290 + data8 sys_pfm_delete_evtsets + data8 sys_pfm_unload_context .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls diff -puN arch/powerpc/kernel/systbl.S~perfmon2-reserve-system-calls arch/powerpc/kernel/systbl.S --- devel/arch/powerpc/kernel/systbl.S~perfmon2-reserve-system-calls 2005-11-16 23:09:29.000000000 -0800 +++ devel-akpm/arch/powerpc/kernel/systbl.S 2005-11-16 23:09:29.000000000 -0800 @@ -322,3 +322,15 @@ SYSCALL(inotify_rm_watch) SYSCALL(spu_run) SYSCALL(spu_create) SYSCALL(migrate_pages) +SYSCALL(pfm_create_context) +SYSCALL(pfm_write_pmcs) +SYSCALL(pfm_write_pmds) +SYSCALL(pfm_read_pmds) +SYSCALL(pfm_load_context) +SYSCALL(pfm_start) +SYSCALL(pfm_stop) +SYSCALL(pfm_restart) +SYSCALL(pfm_create_evtsets) +SYSCALL(pfm_getinfo_evtsets) +SYSCALL(pfm_delete_evtsets) +SYSCALL(pfm_unload_context) diff -puN arch/ppc/kernel/misc.S~perfmon2-reserve-system-calls arch/ppc/kernel/misc.S --- devel/arch/ppc/kernel/misc.S~perfmon2-reserve-system-calls 2005-11-16 23:09:29.000000000 -0800 +++ devel-akpm/arch/ppc/kernel/misc.S 2005-11-16 23:09:54.000000000 -0800 @@ -1406,3 +1406,15 @@ _GLOBAL(sys_call_table) .long sys_spu_run .long sys_spu_create .long sys_migrate_pages /* 280 */ + .long sys_pfm_create_context + .long sys_pfm_write_pmcs + .long sys_pfm_write_pmds + .long sys_pfm_read_pmds + .long sys_pfm_load_context /* 285 */ + .long sys_pfm_start + .long sys_pfm_stop + .long sys_pfm_restart + .long sys_pfm_create_evtsets + .long sys_pfm_getinfo_evtsets /* 290 */ + .long sys_pfm_delete_evtsets + .long sys_pfm_unload_context diff -puN include/asm-i386/unistd.h~perfmon2-reserve-system-calls include/asm-i386/unistd.h --- devel/include/asm-i386/unistd.h~perfmon2-reserve-system-calls 2005-11-16 23:09:29.000000000 -0800 +++ devel-akpm/include/asm-i386/unistd.h 2005-11-16 23:09:29.000000000 -0800 @@ -300,8 +300,20 @@ #define __NR_inotify_add_watch 292 #define __NR_inotify_rm_watch 293 #define __NR_migrate_pages 294 +#define __NR_pfm_create_context 295 +#define __NR_pfm_write_pmcs (__NR_pfm_create_context+1) +#define __NR_pfm_write_pmds (__NR_pfm_create_context+2) +#define __NR_pfm_read_pmds (__NR_pfm_create_context+3) +#define __NR_pfm_load_context (__NR_pfm_create_context+4) +#define __NR_pfm_start (__NR_pfm_create_context+5) +#define __NR_pfm_stop (__NR_pfm_create_context+6) +#define __NR_pfm_restart (__NR_pfm_create_context+7) +#define __NR_pfm_create_evtsets (__NR_pfm_create_context+8) +#define __NR_pfm_getinfo_evtsets (__NR_pfm_create_context+9) +#define __NR_pfm_delete_evtsets (__NR_pfm_create_context+10) +#define __NR_pfm_unload_context (__NR_pfm_create_context+11) -#define NR_syscalls 295 +#define NR_syscalls 307 /* * user-visible error numbers are in the range -1 - -128: see diff -puN include/asm-ia64/unistd.h~perfmon2-reserve-system-calls include/asm-ia64/unistd.h --- devel/include/asm-ia64/unistd.h~perfmon2-reserve-system-calls 2005-11-16 23:09:29.000000000 -0800 +++ devel-akpm/include/asm-ia64/unistd.h 2005-11-16 23:09:29.000000000 -0800 @@ -270,6 +270,18 @@ #define __NR_inotify_add_watch 1278 #define __NR_inotify_rm_watch 1279 #define __NR_migrate_pages 1280 +#define __NR_pfm_create_context 1281 +#define __NR_pfm_write_pmcs 1282 +#define __NR_pfm_write_pmds 1283 +#define __NR_pfm_read_pmds 1284 +#define __NR_pfm_load_context 1285 +#define __NR_pfm_start 1286 +#define __NR_pfm_stop 1287 +#define __NR_pfm_restart 1288 +#define __NR_pfm_create_evtsets 1289 +#define __NR_pfm_getinfo_evtsets 1290 +#define __NR_pfm_delete_evtsets 1291 +#define __NR_pfm_unload_context 1292 #ifdef __KERNEL__ diff -puN include/asm-powerpc/unistd.h~perfmon2-reserve-system-calls include/asm-powerpc/unistd.h --- devel/include/asm-powerpc/unistd.h~perfmon2-reserve-system-calls 2005-11-16 23:09:29.000000000 -0800 +++ devel-akpm/include/asm-powerpc/unistd.h 2005-11-16 23:09:29.000000000 -0800 @@ -299,8 +299,20 @@ #define __NR_spu_run 278 #define __NR_spu_create 279 #define __NR_migrate_pages 280 +#define __NR_pfm_create_context 281 +#define __NR_pfm_write_pmcs 282 +#define __NR_pfm_write_pmds 283 +#define __NR_pfm_read_pmds 284 +#define __NR_pfm_load_context 285 +#define __NR_pfm_start 286 +#define __NR_pfm_stop 287 +#define __NR_pfm_restart 288 +#define __NR_pfm_create_evtsets 289 +#define __NR_pfm_getinfo_evtsets 290 +#define __NR_pfm_delete_evtsets 291 +#define __NR_pfm_unload_context 292 -#define __NR_syscalls 281 +#define __NR_syscalls 293 #ifdef __KERNEL__ #define __NR__exit __NR_exit diff -puN include/asm-x86_64/unistd.h~perfmon2-reserve-system-calls include/asm-x86_64/unistd.h --- devel/include/asm-x86_64/unistd.h~perfmon2-reserve-system-calls 2005-11-16 23:09:29.000000000 -0800 +++ devel-akpm/include/asm-x86_64/unistd.h 2005-11-16 23:09:29.000000000 -0800 @@ -573,8 +573,32 @@ __SYSCALL(__NR_inotify_add_watch, sys_in __SYSCALL(__NR_inotify_rm_watch, sys_inotify_rm_watch) #define __NR_migrate_pages 256 __SYSCALL(__NR_migrate_pages, sys_migrate_pages) +#define __NR_pfm_create_context 257 +__SYSCALL(__NR_pfm_create_context, sys_pfm_create_context) +#define __NR_pfm_write_pmcs (__NR_pfm_create_context+1) +__SYSCALL(__NR_pfm_write_pmcs, sys_pfm_write_pmcs) +#define __NR_pfm_write_pmds (__NR_pfm_create_context+2) +__SYSCALL(__NR_pfm_write_pmds, sys_pfm_write_pmds) +#define __NR_pfm_read_pmds (__NR_pfm_create_context+3) +__SYSCALL(__NR_pfm_read_pmds, sys_pfm_read_pmds) +#define __NR_pfm_load_context (__NR_pfm_create_context+4) +__SYSCALL(__NR_pfm_load_context, sys_pfm_load_context) +#define __NR_pfm_start (__NR_pfm_create_context+5) +__SYSCALL(__NR_pfm_start, sys_pfm_start) +#define __NR_pfm_stop (__NR_pfm_create_context+6) +__SYSCALL(__NR_pfm_stop, sys_pfm_stop) +#define __NR_pfm_restart (__NR_pfm_create_context+7) +__SYSCALL(__NR_pfm_restart, sys_pfm_restart) +#define __NR_pfm_create_evtsets (__NR_pfm_create_context+8) +__SYSCALL(__NR_pfm_create_evtsets, sys_pfm_create_evtsets) +#define __NR_pfm_getinfo_evtsets (__NR_pfm_create_context+9) +__SYSCALL(__NR_pfm_getinfo_evtsets, sys_pfm_getinfo_evtsets) +#define __NR_pfm_delete_evtsets (__NR_pfm_create_context+10) +__SYSCALL(__NR_pfm_delete_evtsets, sys_pfm_delete_evtsets) +#define __NR_pfm_unload_context (__NR_pfm_create_context+11) +__SYSCALL(__NR_pfm_unload_context, sys_pfm_unload_context) -#define __NR_syscall_max __NR_migrate_pages +#define __NR_syscall_max __NR_pfm_unload_context #ifndef __NO_STUBS /* user-visible error numbers are in the range -1 - -4095 */ diff -puN kernel/sys_ni.c~perfmon2-reserve-system-calls kernel/sys_ni.c --- devel/kernel/sys_ni.c~perfmon2-reserve-system-calls 2005-11-16 23:09:29.000000000 -0800 +++ devel-akpm/kernel/sys_ni.c 2005-11-16 23:09:29.000000000 -0800 @@ -84,6 +84,20 @@ cond_syscall(sys_inotify_add_watch); cond_syscall(sys_inotify_rm_watch); cond_syscall(sys_migrate_pages); +/* perfmon relate system calls */ +cond_syscall(sys_pfm_create_context); +cond_syscall(sys_pfm_write_pmcs); +cond_syscall(sys_pfm_write_pmds); +cond_syscall(sys_pfm_read_pmds); +cond_syscall(sys_pfm_restart); +cond_syscall(sys_pfm_start); +cond_syscall(sys_pfm_stop); +cond_syscall(sys_pfm_load_context); +cond_syscall(sys_pfm_unload_context); +cond_syscall(sys_pfm_create_evtsets); +cond_syscall(sys_pfm_delete_evtsets); +cond_syscall(sys_pfm_getinfo_evtsets); + /* arch-specific weak syscall entries */ cond_syscall(sys_pciconfig_read); cond_syscall(sys_pciconfig_write); _