[uClinux-dev] [PATCH] m68k: Merge mmu and non-mmu versions of sys_call_table

2011-04-06 Thread Geert Uytterhoeven
Impact for m68knommu:
  - The table is now stored in .data instead of .text,
  - Removed unused padding at the end of the table.

Signed-off-by: Geert Uytterhoeven ge...@linux-m68k.org
---
Not tested on m68knommu

Questions:
  - Why was it .text?
  - Was NR_syscalls ever larger than the actual number of syscalls?

 arch/m68k/kernel/Makefile_mm|2 +-
 arch/m68k/kernel/entry_mm.S |  348 ---
 arch/m68k/kernel/syscalltable.S |  205 ---
 3 files changed, 110 insertions(+), 445 deletions(-)

diff --git a/arch/m68k/kernel/Makefile_mm b/arch/m68k/kernel/Makefile_mm
index 55d5d6b..aced678 100644
--- a/arch/m68k/kernel/Makefile_mm
+++ b/arch/m68k/kernel/Makefile_mm
@@ -10,7 +10,7 @@ endif
 extra-y+= vmlinux.lds
 
 obj-y  := entry.o process.o traps.o ints.o signal.o ptrace.o module.o \
-  sys_m68k.o time.o setup.o m68k_ksyms.o devres.o
+  sys_m68k.o time.o setup.o m68k_ksyms.o devres.o syscalltable.o
 
 devres-y = ../../../kernel/irq/devres.o
 
diff --git a/arch/m68k/kernel/entry_mm.S b/arch/m68k/kernel/entry_mm.S
index 1359ee6..bd0ec05 100644
--- a/arch/m68k/kernel/entry_mm.S
+++ b/arch/m68k/kernel/entry_mm.S
@@ -407,351 +407,3 @@ resume:
 
rts
 
-.data
-ALIGN
-sys_call_table:
-   .long sys_restart_syscall   /* 0 - old setup() system call, used 
for restarting */
-   .long sys_exit
-   .long sys_fork
-   .long sys_read
-   .long sys_write
-   .long sys_open  /* 5 */
-   .long sys_close
-   .long sys_waitpid
-   .long sys_creat
-   .long sys_link
-   .long sys_unlink/* 10 */
-   .long sys_execve
-   .long sys_chdir
-   .long sys_time
-   .long sys_mknod
-   .long sys_chmod /* 15 */
-   .long sys_chown16
-   .long sys_ni_syscall/* old break syscall 
holder */
-   .long sys_stat
-   .long sys_lseek
-   .long sys_getpid/* 20 */
-   .long sys_mount
-   .long sys_oldumount
-   .long sys_setuid16
-   .long sys_getuid16
-   .long sys_stime /* 25 */
-   .long sys_ptrace
-   .long sys_alarm
-   .long sys_fstat
-   .long sys_pause
-   .long sys_utime /* 30 */
-   .long sys_ni_syscall/* old stty syscall 
holder */
-   .long sys_ni_syscall/* old gtty syscall 
holder */
-   .long sys_access
-   .long sys_nice
-   .long sys_ni_syscall/* 35 *//* old ftime syscall holder */
-   .long sys_sync
-   .long sys_kill
-   .long sys_rename
-   .long sys_mkdir
-   .long sys_rmdir /* 40 */
-   .long sys_dup
-   .long sys_pipe
-   .long sys_times
-   .long sys_ni_syscall/* old prof syscall 
holder */
-   .long sys_brk   /* 45 */
-   .long sys_setgid16
-   .long sys_getgid16
-   .long sys_signal
-   .long sys_geteuid16
-   .long sys_getegid16 /* 50 */
-   .long sys_acct
-   .long sys_umount/* recycled never used 
phys() */
-   .long sys_ni_syscall/* old lock syscall 
holder */
-   .long sys_ioctl
-   .long sys_fcntl /* 55 */
-   .long sys_ni_syscall/* old mpx syscall 
holder */
-   .long sys_setpgid
-   .long sys_ni_syscall/* old ulimit syscall 
holder */
-   .long sys_ni_syscall
-   .long sys_umask /* 60 */
-   .long sys_chroot
-   .long sys_ustat
-   .long sys_dup2
-   .long sys_getppid
-   .long sys_getpgrp   /* 65 */
-   .long sys_setsid
-   .long sys_sigaction
-   .long sys_sgetmask
-   .long sys_ssetmask
-   .long sys_setreuid16/* 70 */
-   .long sys_setregid16
-   .long sys_sigsuspend
-   .long sys_sigpending
-   .long sys_sethostname
-   .long sys_setrlimit /* 75 */
-   .long sys_old_getrlimit
-   .long sys_getrusage
-   .long sys_gettimeofday
-   .long sys_settimeofday
-   .long sys_getgroups16   /* 80 */
-   .long sys_setgroups16
-   .long sys_old_select
-   .long sys_symlink
-   .long sys_lstat
-   .long sys_readlink  /* 85 */
-   .long sys_uselib
-   .long sys_swapon
-   .long sys_reboot
-   .long sys_old_readdir
-   .long sys_old_mmap  /* 90 */
-   .long sys_munmap
-   .long sys_truncate
-   .long sys_ftruncate
-   .long sys_fchmod
-   .long sys_fchown16  /* 95 */
-   .long sys_getpriority
-   .long sys_setpriority
-   .long sys_ni_syscall/* old profil syscall 
holder */
-   .long sys_statfs
-   .long sys_fstatfs   /* 100 */
-   .long sys_ni_syscall/* ioperm for i386 */
-   .long sys_socketcall
-   .long sys_syslog
-  

Re: [uClinux-dev] [PATCH] m68k: Merge mmu and non-mmu versions of sys_call_table

2011-04-06 Thread Philippe De Muyter
On Wed, Apr 06, 2011 at 10:33:07PM +0200, Geert Uytterhoeven wrote:
 Impact for m68knommu:
   - The table is now stored in .data instead of .text,

Do you mean .rodata ?

   - Removed unused padding at the end of the table.
 
 Signed-off-by: Geert Uytterhoeven ge...@linux-m68k.org
 ---
 Not tested on m68knommu
 
 Questions:
   - Why was it .text?

Probably because it is constanti (read-only).

Philippe

-- 
Philippe De Muyter +32 2 6101532 Macq SA rue de l'Aeronef 2 B-1140 Bruxelles
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


[uClinux-dev] Re: [PATCH] m68knommu: Remove obsolete #include linux/sys.h

2011-04-06 Thread Greg Ungerer

Hi Geert,

On 07/04/11 05:43, Geert Uytterhoeven wrote:

Signed-off-by: Geert Uytterhoevenge...@linux-m68k.org


Looks good. Compile and run tested on m68knommu (at 2.6.39-rc2).
I have added this to the m68knommu git tree.

Regards
Greg



---
Janitors: git grep linux/sys.h shows many more.

  arch/m68k/kernel/entry_no.S |1 -
  arch/m68k/kernel/syscalltable.S |1 -
  arch/m68k/platform/68328/entry.S|1 -
  arch/m68k/platform/68360/entry.S|1 -
  arch/m68k/platform/coldfire/entry.S |1 -
  arch/m68k/platform/coldfire/head.S  |1 -
  6 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/arch/m68k/kernel/entry_no.S b/arch/m68k/kernel/entry_no.S
index 2783f25..5f0f6b5 100644
--- a/arch/m68k/kernel/entry_no.S
+++ b/arch/m68k/kernel/entry_no.S
@@ -24,7 +24,6 @@
   * linux 2.4 support David McCulloughdav...@snapgear.com
   */

-#includelinux/sys.h
  #includelinux/linkage.h
  #includeasm/errno.h
  #includeasm/setup.h
diff --git a/arch/m68k/kernel/syscalltable.S b/arch/m68k/kernel/syscalltable.S
index 79b1ed1..935e10a 100644
--- a/arch/m68k/kernel/syscalltable.S
+++ b/arch/m68k/kernel/syscalltable.S
@@ -11,7 +11,6 @@
   *  Copyright (C) 1991, 1992  Linus Torvalds
   */

-#includelinux/sys.h
  #includelinux/linkage.h
  #includeasm/unistd.h

diff --git a/arch/m68k/platform/68328/entry.S b/arch/m68k/platform/68328/entry.S
index 676960c..0747318 100644
--- a/arch/m68k/platform/68328/entry.S
+++ b/arch/m68k/platform/68328/entry.S
@@ -10,7 +10,6 @@
   * Linux/m68k support by Hamish Macdonald
   */

-#includelinux/sys.h
  #includelinux/linkage.h
  #includeasm/thread_info.h
  #includeasm/unistd.h
diff --git a/arch/m68k/platform/68360/entry.S b/arch/m68k/platform/68360/entry.S
index 46c1b18..e1477f2 100644
--- a/arch/m68k/platform/68360/entry.S
+++ b/arch/m68k/platform/68360/entry.S
@@ -12,7 +12,6 @@
   * M68360 Port by SED Systems, and Lineo.
   */

-#includelinux/sys.h
  #includelinux/linkage.h
  #includeasm/thread_info.h
  #includeasm/unistd.h
diff --git a/arch/m68k/platform/coldfire/entry.S 
b/arch/m68k/platform/coldfire/entry.S
index 5837cf0..bc15bea 100644
--- a/arch/m68k/platform/coldfire/entry.S
+++ b/arch/m68k/platform/coldfire/entry.S
@@ -26,7 +26,6 @@
   * Bug, speed and maintainability fixes by Philippe De Muyterp...@macqel.be
   */

-#includelinux/sys.h
  #includelinux/linkage.h
  #includeasm/unistd.h
  #includeasm/thread_info.h
diff --git a/arch/m68k/platform/coldfire/head.S 
b/arch/m68k/platform/coldfire/head.S
index 129bff4..da21180 100644
--- a/arch/m68k/platform/coldfire/head.S
+++ b/arch/m68k/platform/coldfire/head.S
@@ -8,7 +8,6 @@

  
/*/

-#includelinux/sys.h
  #includelinux/linkage.h
  #includelinux/init.h
  #includeasm/asm-offsets.h



--

Greg Ungerer  --  Principal EngineerEMAIL: g...@snapgear.com
SnapGear Group, McAfee  PHONE:   +61 7 3435 2888
8 Gardner Close FAX: +61 7 3217 5323
Milton, QLD, 4064, AustraliaWEB: http://www.SnapGear.com
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


[uClinux-dev] Re: [PATCH] m68k: Merge mmu and non-mmu versions of sys_call_table

2011-04-06 Thread Greg Ungerer


Hi Geert,

On 07/04/11 06:33, Geert Uytterhoeven wrote:

Impact for m68knommu:
   - The table is now stored in .data instead of .text,
   - Removed unused padding at the end of the table.

Signed-off-by: Geert Uytterhoevenge...@linux-m68k.org
---
Not tested on m68knommu


Compile and run tested on m68knommu.



Questions:
   - Why was it .text?
   - Was NR_syscalls ever larger than the actual number of syscalls?


A long time ago (circa 2.4 kernels). Not even sure why then.
It may have had something to do with maintaining the same number
of syscalls as true MMU m68k had.

Certainly doesn't need to be that way now.

Acked-by: Greg Ungerer g...@uclinux.org

Are you going to be pushing this via your m68k git tree?

Regards
Greg




  arch/m68k/kernel/Makefile_mm|2 +-
  arch/m68k/kernel/entry_mm.S |  348 ---
  arch/m68k/kernel/syscalltable.S |  205 ---
  3 files changed, 110 insertions(+), 445 deletions(-)

diff --git a/arch/m68k/kernel/Makefile_mm b/arch/m68k/kernel/Makefile_mm
index 55d5d6b..aced678 100644
--- a/arch/m68k/kernel/Makefile_mm
+++ b/arch/m68k/kernel/Makefile_mm
@@ -10,7 +10,7 @@ endif
  extra-y   += vmlinux.lds

  obj-y := entry.o process.o traps.o ints.o signal.o ptrace.o module.o \
-  sys_m68k.o time.o setup.o m68k_ksyms.o devres.o
+  sys_m68k.o time.o setup.o m68k_ksyms.o devres.o syscalltable.o

  devres-y = ../../../kernel/irq/devres.o

diff --git a/arch/m68k/kernel/entry_mm.S b/arch/m68k/kernel/entry_mm.S
index 1359ee6..bd0ec05 100644
--- a/arch/m68k/kernel/entry_mm.S
+++ b/arch/m68k/kernel/entry_mm.S
@@ -407,351 +407,3 @@ resume:

rts

-.data
-ALIGN
-sys_call_table:
-   .long sys_restart_syscall   /* 0 - old setup() system call, used 
for restarting */
-   .long sys_exit
-   .long sys_fork
-   .long sys_read
-   .long sys_write
-   .long sys_open  /* 5 */
-   .long sys_close
-   .long sys_waitpid
-   .long sys_creat
-   .long sys_link
-   .long sys_unlink/* 10 */
-   .long sys_execve
-   .long sys_chdir
-   .long sys_time
-   .long sys_mknod
-   .long sys_chmod /* 15 */
-   .long sys_chown16
-   .long sys_ni_syscall/* old break syscall 
holder */
-   .long sys_stat
-   .long sys_lseek
-   .long sys_getpid/* 20 */
-   .long sys_mount
-   .long sys_oldumount
-   .long sys_setuid16
-   .long sys_getuid16
-   .long sys_stime /* 25 */
-   .long sys_ptrace
-   .long sys_alarm
-   .long sys_fstat
-   .long sys_pause
-   .long sys_utime /* 30 */
-   .long sys_ni_syscall/* old stty syscall 
holder */
-   .long sys_ni_syscall/* old gtty syscall 
holder */
-   .long sys_access
-   .long sys_nice
-   .long sys_ni_syscall/* 35 *//* old ftime syscall holder */
-   .long sys_sync
-   .long sys_kill
-   .long sys_rename
-   .long sys_mkdir
-   .long sys_rmdir /* 40 */
-   .long sys_dup
-   .long sys_pipe
-   .long sys_times
-   .long sys_ni_syscall/* old prof syscall 
holder */
-   .long sys_brk   /* 45 */
-   .long sys_setgid16
-   .long sys_getgid16
-   .long sys_signal
-   .long sys_geteuid16
-   .long sys_getegid16 /* 50 */
-   .long sys_acct
-   .long sys_umount/* recycled never used 
phys() */
-   .long sys_ni_syscall/* old lock syscall 
holder */
-   .long sys_ioctl
-   .long sys_fcntl /* 55 */
-   .long sys_ni_syscall/* old mpx syscall 
holder */
-   .long sys_setpgid
-   .long sys_ni_syscall/* old ulimit syscall 
holder */
-   .long sys_ni_syscall
-   .long sys_umask /* 60 */
-   .long sys_chroot
-   .long sys_ustat
-   .long sys_dup2
-   .long sys_getppid
-   .long sys_getpgrp   /* 65 */
-   .long sys_setsid
-   .long sys_sigaction
-   .long sys_sgetmask
-   .long sys_ssetmask
-   .long sys_setreuid16/* 70 */
-   .long sys_setregid16
-   .long sys_sigsuspend
-   .long sys_sigpending
-   .long sys_sethostname
-   .long sys_setrlimit /* 75 */
-   .long sys_old_getrlimit
-   .long sys_getrusage
-   .long sys_gettimeofday
-   .long sys_settimeofday
-   .long sys_getgroups16   /* 80 */
-   .long sys_setgroups16
-   .long sys_old_select
-   .long sys_symlink
-   .long sys_lstat
-   .long sys_readlink  /* 85 */
-   .long sys_uselib
-   .long sys_swapon
-   .long sys_reboot
-   .long sys_old_readdir
-   .long sys_old_mmap  /* 90 */
-   .long sys_munmap
-   .long sys_truncate
-   .long 

RE: [uClinux-dev] [PATCH] m68k: Merge mmu and non-mmu versions of sys_call_table

2011-04-06 Thread Gavin Lambert
Quoth Greg Ungerer:
  Impact for m68knommu:
 - The table is now stored in .data instead of .text,
 
  Do you mean .rodata ?
[...]
 Yes, I suspect that was the original thinking. It has been that way
 for a very long time (it is in .text in the 2.4 kernel patches for
 this too).
 
 I will test them on m68knommu today, I am sure moving to .data (really
 rodata) will be fine.

Doesn't that have XIP consequences?  .text (and presumably .rodata) can be
stored and executed from ROM, since they can't be changed at runtime.  .data
has to be in RAM, since it can be.


___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


Re: [uClinux-dev] [PATCH] m68k: Merge mmu and non-mmu versions of sys_call_table

2011-04-06 Thread Greg Ungerer

Hi Gavin,

On 07/04/11 12:12, Gavin Lambert wrote:

Quoth Greg Ungerer:

Impact for m68knommu:
- The table is now stored in .data instead of .text,


Do you mean .rodata ?

[...]

Yes, I suspect that was the original thinking. It has been that way
for a very long time (it is in .text in the 2.4 kernel patches for
this too).

I will test them on m68knommu today, I am sure moving to .data (really
rodata) will be fine.


Doesn't that have XIP consequences?  .text (and presumably .rodata) can be
stored and executed from ROM, since they can't be changed at runtime.  .data
has to be in RAM, since it can be.


Yes, but even in the kernel XIP case the very early startup code
moves the kernels data to RAM. Well before the system call table
will be needed.

Regards
Greg



Greg Ungerer  --  Principal EngineerEMAIL: g...@snapgear.com
SnapGear Group, McAfee  PHONE:   +61 7 3435 2888
8 Gardner Close FAX: +61 7 3217 5323
Milton, QLD, 4064, AustraliaWEB: http://www.SnapGear.com
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


RE: [uClinux-dev] [PATCH] m68k: Merge mmu and non-mmu versions of sys_call_table

2011-04-06 Thread Gavin Lambert
Quoth Greg Ungerer:
 Doesn't that have XIP consequences?  .text (and presumably .rodata) 
 can be stored and executed from ROM, since they can't be changed at 
 runtime.  .data has to be in RAM, since it can be.

 Yes, but even in the kernel XIP case the very early startup code
 moves the kernels data to RAM. Well before the system call table
 will be needed.

But presumably if the syscall table was previously in .text, it was not
subject to this.  And now it will be.

I doubt this would actually break anything (as you've already confirmed),
since it's only a tiny RAM usage increase, but unless there's some reason
for the syscall table to be read-write it seems a bit odd.

___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


Re: [uClinux-dev] [PATCH] m68k: Merge mmu and non-mmu versions of sys_call_table

2011-04-06 Thread Greg Ungerer

Hi Gavin,

On 07/04/11 13:13, Gavin Lambert wrote:

Quoth Greg Ungerer:

Doesn't that have XIP consequences?  .text (and presumably .rodata)
can be stored and executed from ROM, since they can't be changed at
runtime.  .data has to be in RAM, since it can be.


Yes, but even in the kernel XIP case the very early startup code
moves the kernels data to RAM. Well before the system call table
will be needed.


But presumably if the syscall table was previously in .text, it was not
subject to this.  And now it will be.

I doubt this would actually break anything (as you've already confirmed),
since it's only a tiny RAM usage increase, but unless there's some reason
for the syscall table to be read-write it seems a bit odd.


To be read-write yes, odd, but a data table being in the .text
section is also odd. It really belongs in the .rodata section.
And then it will be packed with the .text in our linkers script,
and wouldn't be copied out to RAM.

So Geert, can we move this to the .rodata section?

I just tried changing the .data section to

.section .rodata

It compiled and work on both m68k and m68knommu targets for me.

Regards
Greg



Greg Ungerer  --  Principal EngineerEMAIL: g...@snapgear.com
SnapGear Group, McAfee  PHONE:   +61 7 3435 2888
8 Gardner Close FAX: +61 7 3217 5323
Milton, QLD, 4064, AustraliaWEB: http://www.SnapGear.com
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev