public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [git-pull -tip] x86: declaration patches
@ 2009-04-10 16:33 Jaswinder Singh Rajput
  2009-04-10 16:51 ` Thomas Gleixner
  2009-04-10 17:29 ` Sam Ravnborg
  0 siblings, 2 replies; 8+ messages in thread
From: Jaswinder Singh Rajput @ 2009-04-10 16:33 UTC (permalink / raw)
  To: Ingo Molnar, x86 maintainers, LKML, Andrew Morton, Andi Kleen

Hello Ingo,

I have already send these patches for review to LKML.

Now here is pull request:
The following changes since commit 7fd61bdf06572f1ca681aa35f5c86531a821ea75:
  Ingo Molnar (1):
        Merge branch 'x86/urgent'

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/jaswinder/linux-2.6-tip.git master

Jaswinder Singh Rajput (8):
      x86: irq.c declare smp_generic_interrupt before they get used
      x86: syscalls.h update declarations due to unifications
      x86: process.c declare sys_fork and sys_vfork before they get used
      x86: tsc.c rename tsc_khz shadow variable
      x86: apic/probe_32.c declare apic_default before they get used
      x86: apic/nmi.c prev_nmi_count should be unsigned
      x86: apic/io_apic.c declare smp_irq_move_cleanup_interrupt before they get used
      x86: mm/init.c declare direct_gbpages and free_initrd_mem before they get used

 arch/x86/include/asm/apic.h       |    3 ++
 arch/x86/include/asm/hw_irq.h     |   14 +++++++++++
 arch/x86/include/asm/pgtable.h    |    2 +
 arch/x86/include/asm/pgtable_64.h |    6 -----
 arch/x86/include/asm/syscalls.h   |   45 +++++++++++++++++++-----------------
 arch/x86/kernel/apic/io_apic.c    |    6 ++++-
 arch/x86/kernel/apic/nmi.c        |    2 +-
 arch/x86/kernel/apic/probe_32.c   |    1 -
 arch/x86/kernel/irq.c             |    4 +++
 arch/x86/kernel/process.c         |    1 +
 arch/x86/kernel/tsc.c             |    8 +++---
 arch/x86/mm/init.c                |    1 +
 12 files changed, 59 insertions(+), 34 deletions(-)

Complete diff:
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index 42f2f83..5773660 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -478,6 +478,9 @@ static inline unsigned int read_apic_id(void)
 extern void default_setup_apic_routing(void);
 
 #ifdef CONFIG_X86_32
+
+extern struct apic apic_default;
+
 /*
  * Set up the logical destination ID.
  *
diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h
index 7309c0a..2f35e81 100644
--- a/arch/x86/include/asm/hw_irq.h
+++ b/arch/x86/include/asm/hw_irq.h
@@ -81,6 +81,11 @@ extern void eisa_set_level_irq(unsigned int irq);
 /* SMP */
 extern void smp_apic_timer_interrupt(struct pt_regs *);
 extern void smp_spurious_interrupt(struct pt_regs *);
+#ifdef CONFIG_X86_32
+extern void smp_generic_interrupt(struct pt_regs *);
+#else
+extern asmlinkage void smp_generic_interrupt(struct pt_regs *);
+#endif
 extern void smp_error_interrupt(struct pt_regs *);
 #ifdef CONFIG_SMP
 extern void smp_reschedule_interrupt(struct pt_regs *);
@@ -93,6 +98,15 @@ extern asmlinkage void smp_invalidate_interrupt(struct pt_regs *);
 #endif
 #endif
 
+#ifdef CONFIG_X86_IO_APIC
+#ifdef CONFIG_X86_32
+extern void smp_irq_move_cleanup_interrupt(void);
+#else
+extern asmlinkage void smp_irq_move_cleanup_interrupt(void);
+#endif
+#endif
+
+
 extern void (*__initconst interrupt[NR_VECTORS-FIRST_EXTERNAL_VECTOR])(void);
 
 typedef int vector_irq_t[NR_VECTORS];
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index 205f6a9..577485b 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -510,6 +510,8 @@ static inline int pte_hidden(pte_t pte)
 
 #ifndef __ASSEMBLY__
 
+extern int direct_gbpages;
+
 /* local pte updates need not use xchg for locking */
 static inline pte_t native_local_ptep_get_and_clear(pte_t *ptep)
 {
diff --git a/arch/x86/include/asm/pgtable_64.h b/arch/x86/include/asm/pgtable_64.h
index 6b87bc6..abde308 100644
--- a/arch/x86/include/asm/pgtable_64.h
+++ b/arch/x86/include/asm/pgtable_64.h
@@ -25,10 +25,6 @@ extern pgd_t init_level4_pgt[];
 
 extern void paging_init(void);
 
-#endif /* !__ASSEMBLY__ */
-
-#ifndef __ASSEMBLY__
-
 #define pte_ERROR(e)					\
 	printk("%s:%d: bad pte %p(%016lx).\n",		\
 	       __FILE__, __LINE__, &(e), pte_val(e))
@@ -135,8 +131,6 @@ static inline int pgd_large(pgd_t pgd) { return 0; }
 
 #define update_mmu_cache(vma, address, pte) do { } while (0)
 
-extern int direct_gbpages;
-
 /* Encode and de-code a swap entry */
 #if _PAGE_BIT_FILE < _PAGE_BIT_PROTNONE
 #define SWP_TYPE_BITS (_PAGE_BIT_FILE - _PAGE_BIT_PRESENT - 1)
diff --git a/arch/x86/include/asm/syscalls.h b/arch/x86/include/asm/syscalls.h
index 7043408..372b76e 100644
--- a/arch/x86/include/asm/syscalls.h
+++ b/arch/x86/include/asm/syscalls.h
@@ -1,7 +1,7 @@
 /*
  * syscalls.h - Linux syscall interfaces (arch-specific)
  *
- * Copyright (c) 2008 Jaswinder Singh
+ * Copyright (c) 2008 Jaswinder Singh Rajput
  *
  * This file is released under the GPLv2.
  * See the file COPYING for more details.
@@ -12,50 +12,55 @@
 
 #include <linux/compiler.h>
 #include <linux/linkage.h>
-#include <linux/types.h>
 #include <linux/signal.h>
+#include <linux/types.h>
 
 /* Common in X86_32 and X86_64 */
 /* kernel/ioport.c */
 asmlinkage long sys_ioperm(unsigned long, unsigned long, int);
 
+/* kernel/process.c */
+int sys_fork(struct pt_regs *);
+int sys_vfork(struct pt_regs *);
+
 /* kernel/ldt.c */
 asmlinkage int sys_modify_ldt(int, void __user *, unsigned long);
 
+/* kernel/signal.c */
+long sys_rt_sigreturn(struct pt_regs *);
+
 /* kernel/tls.c */
 asmlinkage int sys_set_thread_area(struct user_desc __user *);
 asmlinkage int sys_get_thread_area(struct user_desc __user *);
 
 /* X86_32 only */
 #ifdef CONFIG_X86_32
+/* kernel/ioport.c */
+long sys_iopl(struct pt_regs *);
+
 /* kernel/process_32.c */
-int sys_fork(struct pt_regs *);
 int sys_clone(struct pt_regs *);
-int sys_vfork(struct pt_regs *);
 int sys_execve(struct pt_regs *);
 
-/* kernel/signal_32.c */
+/* kernel/signal.c */
 asmlinkage int sys_sigsuspend(int, int, old_sigset_t);
 asmlinkage int sys_sigaction(int, const struct old_sigaction __user *,
 			     struct old_sigaction __user *);
 int sys_sigaltstack(struct pt_regs *);
 unsigned long sys_sigreturn(struct pt_regs *);
-long sys_rt_sigreturn(struct pt_regs *);
-
-/* kernel/ioport.c */
-long sys_iopl(struct pt_regs *);
 
 /* kernel/sys_i386_32.c */
+struct mmap_arg_struct;
+struct sel_arg_struct;
+struct oldold_utsname;
+struct old_utsname;
+
 asmlinkage long sys_mmap2(unsigned long, unsigned long, unsigned long,
 			  unsigned long, unsigned long, unsigned long);
-struct mmap_arg_struct;
 asmlinkage int old_mmap(struct mmap_arg_struct __user *);
-struct sel_arg_struct;
 asmlinkage int old_select(struct sel_arg_struct __user *);
 asmlinkage int sys_ipc(uint, int, int, int, void __user *, long);
-struct old_utsname;
 asmlinkage int sys_uname(struct old_utsname __user *);
-struct oldold_utsname;
 asmlinkage int sys_olduname(struct oldold_utsname __user *);
 
 /* kernel/vm86_32.c */
@@ -65,29 +70,27 @@ int sys_vm86(struct pt_regs *);
 #else /* CONFIG_X86_32 */
 
 /* X86_64 only */
+/* kernel/ioport.c */
+asmlinkage long sys_iopl(unsigned int, struct pt_regs *);
+
 /* kernel/process_64.c */
-asmlinkage long sys_fork(struct pt_regs *);
 asmlinkage long sys_clone(unsigned long, unsigned long,
 			  void __user *, void __user *,
 			  struct pt_regs *);
-asmlinkage long sys_vfork(struct pt_regs *);
 asmlinkage long sys_execve(char __user *, char __user * __user *,
 			   char __user * __user *,
 			   struct pt_regs *);
 long sys_arch_prctl(int, unsigned long);
 
-/* kernel/ioport.c */
-asmlinkage long sys_iopl(unsigned int, struct pt_regs *);
-
-/* kernel/signal_64.c */
+/* kernel/signal.c */
 asmlinkage long sys_sigaltstack(const stack_t __user *, stack_t __user *,
 				struct pt_regs *);
-long sys_rt_sigreturn(struct pt_regs *);
 
 /* kernel/sys_x86_64.c */
+struct new_utsname;
+
 asmlinkage long sys_mmap(unsigned long, unsigned long, unsigned long,
 			 unsigned long, unsigned long, unsigned long);
-struct new_utsname;
 asmlinkage long sys_uname(struct new_utsname __user *);
 
 #endif /* CONFIG_X86_32 */
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 8499000..d1bac67 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -59,6 +59,7 @@
 #include <asm/setup.h>
 #include <asm/irq_remapping.h>
 #include <asm/hpet.h>
+#include <asm/hw_irq.h>		/* smp_irq_move_cleanup_interrupt */
 #include <asm/uv/uv_hub.h>
 #include <asm/uv/uv_irq.h>
 
@@ -2428,7 +2429,10 @@ static inline void set_ir_ioapic_affinity_irq_desc(struct irq_desc *desc,
 }
 #endif
 
-asmlinkage void smp_irq_move_cleanup_interrupt(void)
+#ifdef CONFIG_X86_64
+asmlinkage
+#endif
+void smp_irq_move_cleanup_interrupt(void)
 {
 	unsigned vector, me;
 
diff --git a/arch/x86/kernel/apic/nmi.c b/arch/x86/kernel/apic/nmi.c
index d6bd624..0205631 100644
--- a/arch/x86/kernel/apic/nmi.c
+++ b/arch/x86/kernel/apic/nmi.c
@@ -104,7 +104,7 @@ static __init void nmi_cpu_busy(void *data)
 }
 #endif
 
-static void report_broken_nmi(int cpu, int *prev_nmi_count)
+static void report_broken_nmi(int cpu, unsigned int *prev_nmi_count)
 {
 	printk(KERN_CONT "\n");
 
diff --git a/arch/x86/kernel/apic/probe_32.c b/arch/x86/kernel/apic/probe_32.c
index 01eda2a..440a8bc 100644
--- a/arch/x86/kernel/apic/probe_32.c
+++ b/arch/x86/kernel/apic/probe_32.c
@@ -160,7 +160,6 @@ extern struct apic apic_summit;
 extern struct apic apic_bigsmp;
 extern struct apic apic_es7000;
 extern struct apic apic_es7000_cluster;
-extern struct apic apic_default;
 
 struct apic *apic = &apic_default;
 EXPORT_SYMBOL_GPL(apic);
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
index 9be593f..8370125 100644
--- a/arch/x86/kernel/irq.c
+++ b/arch/x86/kernel/irq.c
@@ -12,6 +12,7 @@
 #include <asm/io_apic.h>
 #include <asm/irq.h>
 #include <asm/idle.h>
+#include <asm/hw_irq.h>			/* smp_generic_interrupt */
 
 atomic_t irq_err_count;
 
@@ -242,6 +243,9 @@ unsigned int __irq_entry do_IRQ(struct pt_regs *regs)
 /*
  * Handler for GENERIC_INTERRUPT_VECTOR.
  */
+#ifdef CONFIG_X86_64
+asmlinkage
+#endif
 void smp_generic_interrupt(struct pt_regs *regs)
 {
 	struct pt_regs *old_regs = set_irq_regs(regs);
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index 1d71442..4d397ce 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -15,6 +15,7 @@
 #include <asm/uaccess.h>
 #include <asm/i387.h>
 #include <asm/ds.h>
+#include <asm/syscalls.h>		/* sys_fork, sys_vfork */
 
 unsigned long idle_halt;
 EXPORT_SYMBOL(idle_halt);
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 7a567eb..a8dc0d0 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -384,13 +384,13 @@ unsigned long native_calibrate_tsc(void)
 {
 	u64 tsc1, tsc2, delta, ref1, ref2;
 	unsigned long tsc_pit_min = ULONG_MAX, tsc_ref_min = ULONG_MAX;
-	unsigned long flags, latch, ms, fast_calibrate, tsc_khz;
+	unsigned long flags, latch, ms, fast_calibrate, hv_tsc_khz;
 	int hpet = is_hpet_enabled(), i, loopmin;
 
-	tsc_khz = get_hypervisor_tsc_freq();
-	if (tsc_khz) {
+	hv_tsc_khz = get_hypervisor_tsc_freq();
+	if (hv_tsc_khz) {
 		printk(KERN_INFO "TSC: Frequency read from the hypervisor\n");
-		return tsc_khz;
+		return hv_tsc_khz;
 	}
 
 	local_irq_save(flags);
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index 51ae5ea..688c008 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -1,3 +1,4 @@
+#include <linux/initrd.h>	/* free_initrd_mem */
 #include <linux/ioport.h>
 #include <linux/swap.h>
 



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [git-pull -tip] x86: declaration patches
  2009-04-10 16:33 [git-pull -tip] x86: declaration patches Jaswinder Singh Rajput
@ 2009-04-10 16:51 ` Thomas Gleixner
  2009-04-10 17:21   ` Jaswinder Singh Rajput
  2009-04-10 17:29 ` Sam Ravnborg
  1 sibling, 1 reply; 8+ messages in thread
From: Thomas Gleixner @ 2009-04-10 16:51 UTC (permalink / raw)
  To: Jaswinder Singh Rajput
  Cc: Ingo Molnar, x86 maintainers, LKML, Andrew Morton, Andi Kleen

On Fri, 10 Apr 2009, Jaswinder Singh Rajput wrote:
>  #endif /* CONFIG_X86_32 */
> diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
> index 8499000..d1bac67 100644
> --- a/arch/x86/kernel/apic/io_apic.c
> +++ b/arch/x86/kernel/apic/io_apic.c
> @@ -59,6 +59,7 @@
>  #include <asm/setup.h>
>  #include <asm/irq_remapping.h>
>  #include <asm/hpet.h>
> +#include <asm/hw_irq.h>		/* smp_irq_move_cleanup_interrupt */

  Can we please avoid these useless comments all over the place ?

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [git-pull -tip] x86: declaration patches
  2009-04-10 16:51 ` Thomas Gleixner
@ 2009-04-10 17:21   ` Jaswinder Singh Rajput
  2009-04-10 18:11     ` Thomas Gleixner
  0 siblings, 1 reply; 8+ messages in thread
From: Jaswinder Singh Rajput @ 2009-04-10 17:21 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Ingo Molnar, x86 maintainers, LKML, Andrew Morton, Andi Kleen

On Fri, 2009-04-10 at 18:51 +0200, Thomas Gleixner wrote:
> On Fri, 10 Apr 2009, Jaswinder Singh Rajput wrote:
> >  #endif /* CONFIG_X86_32 */
> > diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
> > index 8499000..d1bac67 100644
> > --- a/arch/x86/kernel/apic/io_apic.c
> > +++ b/arch/x86/kernel/apic/io_apic.c
> > @@ -59,6 +59,7 @@
> >  #include <asm/setup.h>
> >  #include <asm/irq_remapping.h>
> >  #include <asm/hpet.h>
> > +#include <asm/hw_irq.h>		/* smp_irq_move_cleanup_interrupt */
> 
>   Can we please avoid these useless comments all over the place ?
> 

I kept these intentionally because few of these declarations I have
already fixed earlier.
For example during process.c unification work developers forget to
include and fix syscalls.h :

http://git.kernel.org/?p=linux/kernel/git/x86/linux-2.6-tip.git;a=commit;h=389d1fb11e5f2a16b5e34c547756f0c4dec641f7

Thats why I did:

diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index 1d71442..4d397ce 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -15,6 +15,7 @@
 #include <asm/uaccess.h>
 #include <asm/i387.h>
 #include <asm/ds.h>
+#include <asm/syscalls.h>              /* sys_fork, sys_vfork */
 
 unsigned long idle_halt;
 EXPORT_SYMBOL(idle_halt);

Ingo, do you also think we need to remove these comments.

--
JSR



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [git-pull -tip] x86: declaration patches
  2009-04-10 16:33 [git-pull -tip] x86: declaration patches Jaswinder Singh Rajput
  2009-04-10 16:51 ` Thomas Gleixner
@ 2009-04-10 17:29 ` Sam Ravnborg
  2009-04-10 17:45   ` Cyrill Gorcunov
  2009-04-10 18:33   ` Jaswinder Singh Rajput
  1 sibling, 2 replies; 8+ messages in thread
From: Sam Ravnborg @ 2009-04-10 17:29 UTC (permalink / raw)
  To: Jaswinder Singh Rajput
  Cc: Ingo Molnar, x86 maintainers, LKML, Andrew Morton, Andi Kleen

Hi Jaswinder.

> diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h
> index 7309c0a..2f35e81 100644
> --- a/arch/x86/include/asm/hw_irq.h
> +++ b/arch/x86/include/asm/hw_irq.h
> @@ -81,6 +81,11 @@ extern void eisa_set_level_irq(unsigned int irq);
>  /* SMP */
>  extern void smp_apic_timer_interrupt(struct pt_regs *);
>  extern void smp_spurious_interrupt(struct pt_regs *);
> +#ifdef CONFIG_X86_32
> +extern void smp_generic_interrupt(struct pt_regs *);
> +#else
> +extern asmlinkage void smp_generic_interrupt(struct pt_regs *);
> +#endif
>  extern void smp_error_interrupt(struct pt_regs *);
>  #ifdef CONFIG_SMP
>  extern void smp_reschedule_interrupt(struct pt_regs *);
> @@ -93,6 +98,15 @@ extern asmlinkage void smp_invalidate_interrupt(struct pt_regs *);
>  #endif
>  #endif
>  
> +#ifdef CONFIG_X86_IO_APIC
> +#ifdef CONFIG_X86_32
> +extern void smp_irq_move_cleanup_interrupt(void);
> +#else
> +extern asmlinkage void smp_irq_move_cleanup_interrupt(void);
> +#endif
> +#endif

The above is a lot ifdefs just to:
1) use asmlinkage only on 64 bit
2) hide the prototype if do not implement the function

Is there any relevant cost associated with asmlinkage or could we just make it
always asmlinkage?

> +#ifdef CONFIG_X86_64
> +asmlinkage
> +#endif
> +void smp_irq_move_cleanup_interrupt(void)
>  {
>  	unsigned vector, me;
> 


 
>  /*
>   * Handler for GENERIC_INTERRUPT_VECTOR.
>   */
> +#ifdef CONFIG_X86_64
> +asmlinkage
> +#endif
>  void smp_generic_interrupt(struct pt_regs *regs)
>  {

Another one.


	Sam

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [git-pull -tip] x86: declaration patches
  2009-04-10 17:29 ` Sam Ravnborg
@ 2009-04-10 17:45   ` Cyrill Gorcunov
  2009-04-10 18:33   ` Jaswinder Singh Rajput
  1 sibling, 0 replies; 8+ messages in thread
From: Cyrill Gorcunov @ 2009-04-10 17:45 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Jaswinder Singh Rajput, Ingo Molnar, x86 maintainers, LKML,
	Andrew Morton, Andi Kleen

[Sam Ravnborg - Fri, Apr 10, 2009 at 07:29:25PM +0200]
| Hi Jaswinder.
| 
| > diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h
| > index 7309c0a..2f35e81 100644
| > --- a/arch/x86/include/asm/hw_irq.h
| > +++ b/arch/x86/include/asm/hw_irq.h
| > @@ -81,6 +81,11 @@ extern void eisa_set_level_irq(unsigned int irq);
| >  /* SMP */
| >  extern void smp_apic_timer_interrupt(struct pt_regs *);
| >  extern void smp_spurious_interrupt(struct pt_regs *);
| > +#ifdef CONFIG_X86_32
| > +extern void smp_generic_interrupt(struct pt_regs *);
| > +#else
| > +extern asmlinkage void smp_generic_interrupt(struct pt_regs *);
| > +#endif
| >  extern void smp_error_interrupt(struct pt_regs *);
| >  #ifdef CONFIG_SMP
| >  extern void smp_reschedule_interrupt(struct pt_regs *);
| > @@ -93,6 +98,15 @@ extern asmlinkage void smp_invalidate_interrupt(struct pt_regs *);
| >  #endif
| >  #endif
| >  
| > +#ifdef CONFIG_X86_IO_APIC
| > +#ifdef CONFIG_X86_32
| > +extern void smp_irq_move_cleanup_interrupt(void);
| > +#else
| > +extern asmlinkage void smp_irq_move_cleanup_interrupt(void);
| > +#endif
| > +#endif
| 
| The above is a lot ifdefs just to:
| 1) use asmlinkage only on 64 bit
| 2) hide the prototype if do not implement the function
| 
| Is there any relevant cost associated with asmlinkage or could we just make it
| always asmlinkage?

Hi,

as far as I see asmlinkage is just (on X86-64 after
all substitution) nothing, ie:

#define asmlinkage

(until we pass __cplusplus, do we ever?)

Which means we could safely pass asmlinkage on X86-64
in case if X86-32 requires it.

Like

| > +#ifdef CONFIG_X86_32
| > +extern void smp_generic_interrupt(struct pt_regs *);
| > +#else
| > +extern asmlinkage void smp_generic_interrupt(struct pt_regs *);
| > +#endif

could be just written as
	extern void smp_generic_interrupt(struct pt_regs *);
for both.

        Cyrill

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [git-pull -tip] x86: declaration patches
  2009-04-10 17:21   ` Jaswinder Singh Rajput
@ 2009-04-10 18:11     ` Thomas Gleixner
  0 siblings, 0 replies; 8+ messages in thread
From: Thomas Gleixner @ 2009-04-10 18:11 UTC (permalink / raw)
  To: Jaswinder Singh Rajput
  Cc: Ingo Molnar, x86 maintainers, LKML, Andrew Morton, Andi Kleen

On Fri, 10 Apr 2009, Jaswinder Singh Rajput wrote:

> On Fri, 2009-04-10 at 18:51 +0200, Thomas Gleixner wrote:
> > On Fri, 10 Apr 2009, Jaswinder Singh Rajput wrote:
> > >  #endif /* CONFIG_X86_32 */
> > > diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
> > > index 8499000..d1bac67 100644
> > > --- a/arch/x86/kernel/apic/io_apic.c
> > > +++ b/arch/x86/kernel/apic/io_apic.c
> > > @@ -59,6 +59,7 @@
> > >  #include <asm/setup.h>
> > >  #include <asm/irq_remapping.h>
> > >  #include <asm/hpet.h>
> > > +#include <asm/hw_irq.h>		/* smp_irq_move_cleanup_interrupt */
> > 
> >   Can we please avoid these useless comments all over the place ?
> > 
> 
> I kept these intentionally because few of these declarations I have
> already fixed earlier.
> For example during process.c unification work developers forget to
> include and fix syscalls.h :

And how does such a comment help not to forget anything ? It's useless
information and just irritating to read like all end of line comments.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [git-pull -tip] x86: declaration patches
  2009-04-10 17:29 ` Sam Ravnborg
  2009-04-10 17:45   ` Cyrill Gorcunov
@ 2009-04-10 18:33   ` Jaswinder Singh Rajput
  2009-04-12 13:21     ` Ingo Molnar
  1 sibling, 1 reply; 8+ messages in thread
From: Jaswinder Singh Rajput @ 2009-04-10 18:33 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Ingo Molnar, x86 maintainers, LKML, Andrew Morton, Andi Kleen,
	Thomas Gleixner

On Fri, 2009-04-10 at 19:29 +0200, Sam Ravnborg wrote:

> The above is a lot ifdefs just to:
> 1) use asmlinkage only on 64 bit
> 2) hide the prototype if do not implement the function
> 
> Is there any relevant cost associated with asmlinkage or could we just make it
> always asmlinkage?
> 

Ok fixed asmlinkage issue.

and also fixed thomas's comment issue.

So here is new pull request:
The following changes since commit 7fd61bdf06572f1ca681aa35f5c86531a821ea75:
  Ingo Molnar (1):
        Merge branch 'x86/urgent'

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/jaswinder/linux-2.6-tip.git master

Jaswinder Singh Rajput (8):
      x86: irq.c declare smp_generic_interrupt before they get used
      x86: syscalls.h update declarations due to unifications
      x86: process.c declare sys_fork and sys_vfork before they get used
      x86: tsc.c rename tsc_khz shadow variable
      x86: apic/probe_32.c declare apic_default before they get used
      x86: apic/nmi.c prev_nmi_count should be unsigned
      x86: apic/io_apic.c declare smp_irq_move_cleanup_interrupt before they get used
      x86: mm/init.c declare direct_gbpages and free_initrd_mem before they get used

 arch/x86/include/asm/apic.h       |    3 ++
 arch/x86/include/asm/hw_irq.h     |    4 +++
 arch/x86/include/asm/pgtable.h    |    2 +
 arch/x86/include/asm/pgtable_64.h |    6 -----
 arch/x86/include/asm/syscalls.h   |   45 +++++++++++++++++++-----------------
 arch/x86/kernel/apic/io_apic.c    |    1 +
 arch/x86/kernel/apic/nmi.c        |    2 +-
 arch/x86/kernel/apic/probe_32.c   |    1 -
 arch/x86/kernel/irq.c             |    1 +
 arch/x86/kernel/process.c         |    1 +
 arch/x86/kernel/tsc.c             |    8 +++---
 arch/x86/mm/init.c                |    1 +
 12 files changed, 42 insertions(+), 33 deletions(-)

Complete diff:
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index 42f2f83..5773660 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -478,6 +478,9 @@ static inline unsigned int read_apic_id(void)
 extern void default_setup_apic_routing(void);
 
 #ifdef CONFIG_X86_32
+
+extern struct apic apic_default;
+
 /*
  * Set up the logical destination ID.
  *
diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h
index 7309c0a..beeb208 100644
--- a/arch/x86/include/asm/hw_irq.h
+++ b/arch/x86/include/asm/hw_irq.h
@@ -81,7 +81,11 @@ extern void eisa_set_level_irq(unsigned int irq);
 /* SMP */
 extern void smp_apic_timer_interrupt(struct pt_regs *);
 extern void smp_spurious_interrupt(struct pt_regs *);
+extern void smp_generic_interrupt(struct pt_regs *);
 extern void smp_error_interrupt(struct pt_regs *);
+#ifdef CONFIG_X86_IO_APIC
+extern asmlinkage void smp_irq_move_cleanup_interrupt(void);
+#endif
 #ifdef CONFIG_SMP
 extern void smp_reschedule_interrupt(struct pt_regs *);
 extern void smp_call_function_interrupt(struct pt_regs *);
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index 205f6a9..577485b 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -510,6 +510,8 @@ static inline int pte_hidden(pte_t pte)
 
 #ifndef __ASSEMBLY__
 
+extern int direct_gbpages;
+
 /* local pte updates need not use xchg for locking */
 static inline pte_t native_local_ptep_get_and_clear(pte_t *ptep)
 {
diff --git a/arch/x86/include/asm/pgtable_64.h b/arch/x86/include/asm/pgtable_64.h
index 6b87bc6..abde308 100644
--- a/arch/x86/include/asm/pgtable_64.h
+++ b/arch/x86/include/asm/pgtable_64.h
@@ -25,10 +25,6 @@ extern pgd_t init_level4_pgt[];
 
 extern void paging_init(void);
 
-#endif /* !__ASSEMBLY__ */
-
-#ifndef __ASSEMBLY__
-
 #define pte_ERROR(e)					\
 	printk("%s:%d: bad pte %p(%016lx).\n",		\
 	       __FILE__, __LINE__, &(e), pte_val(e))
@@ -135,8 +131,6 @@ static inline int pgd_large(pgd_t pgd) { return 0; }
 
 #define update_mmu_cache(vma, address, pte) do { } while (0)
 
-extern int direct_gbpages;
-
 /* Encode and de-code a swap entry */
 #if _PAGE_BIT_FILE < _PAGE_BIT_PROTNONE
 #define SWP_TYPE_BITS (_PAGE_BIT_FILE - _PAGE_BIT_PRESENT - 1)
diff --git a/arch/x86/include/asm/syscalls.h b/arch/x86/include/asm/syscalls.h
index 7043408..372b76e 100644
--- a/arch/x86/include/asm/syscalls.h
+++ b/arch/x86/include/asm/syscalls.h
@@ -1,7 +1,7 @@
 /*
  * syscalls.h - Linux syscall interfaces (arch-specific)
  *
- * Copyright (c) 2008 Jaswinder Singh
+ * Copyright (c) 2008 Jaswinder Singh Rajput
  *
  * This file is released under the GPLv2.
  * See the file COPYING for more details.
@@ -12,50 +12,55 @@
 
 #include <linux/compiler.h>
 #include <linux/linkage.h>
-#include <linux/types.h>
 #include <linux/signal.h>
+#include <linux/types.h>
 
 /* Common in X86_32 and X86_64 */
 /* kernel/ioport.c */
 asmlinkage long sys_ioperm(unsigned long, unsigned long, int);
 
+/* kernel/process.c */
+int sys_fork(struct pt_regs *);
+int sys_vfork(struct pt_regs *);
+
 /* kernel/ldt.c */
 asmlinkage int sys_modify_ldt(int, void __user *, unsigned long);
 
+/* kernel/signal.c */
+long sys_rt_sigreturn(struct pt_regs *);
+
 /* kernel/tls.c */
 asmlinkage int sys_set_thread_area(struct user_desc __user *);
 asmlinkage int sys_get_thread_area(struct user_desc __user *);
 
 /* X86_32 only */
 #ifdef CONFIG_X86_32
+/* kernel/ioport.c */
+long sys_iopl(struct pt_regs *);
+
 /* kernel/process_32.c */
-int sys_fork(struct pt_regs *);
 int sys_clone(struct pt_regs *);
-int sys_vfork(struct pt_regs *);
 int sys_execve(struct pt_regs *);
 
-/* kernel/signal_32.c */
+/* kernel/signal.c */
 asmlinkage int sys_sigsuspend(int, int, old_sigset_t);
 asmlinkage int sys_sigaction(int, const struct old_sigaction __user *,
 			     struct old_sigaction __user *);
 int sys_sigaltstack(struct pt_regs *);
 unsigned long sys_sigreturn(struct pt_regs *);
-long sys_rt_sigreturn(struct pt_regs *);
-
-/* kernel/ioport.c */
-long sys_iopl(struct pt_regs *);
 
 /* kernel/sys_i386_32.c */
+struct mmap_arg_struct;
+struct sel_arg_struct;
+struct oldold_utsname;
+struct old_utsname;
+
 asmlinkage long sys_mmap2(unsigned long, unsigned long, unsigned long,
 			  unsigned long, unsigned long, unsigned long);
-struct mmap_arg_struct;
 asmlinkage int old_mmap(struct mmap_arg_struct __user *);
-struct sel_arg_struct;
 asmlinkage int old_select(struct sel_arg_struct __user *);
 asmlinkage int sys_ipc(uint, int, int, int, void __user *, long);
-struct old_utsname;
 asmlinkage int sys_uname(struct old_utsname __user *);
-struct oldold_utsname;
 asmlinkage int sys_olduname(struct oldold_utsname __user *);
 
 /* kernel/vm86_32.c */
@@ -65,29 +70,27 @@ int sys_vm86(struct pt_regs *);
 #else /* CONFIG_X86_32 */
 
 /* X86_64 only */
+/* kernel/ioport.c */
+asmlinkage long sys_iopl(unsigned int, struct pt_regs *);
+
 /* kernel/process_64.c */
-asmlinkage long sys_fork(struct pt_regs *);
 asmlinkage long sys_clone(unsigned long, unsigned long,
 			  void __user *, void __user *,
 			  struct pt_regs *);
-asmlinkage long sys_vfork(struct pt_regs *);
 asmlinkage long sys_execve(char __user *, char __user * __user *,
 			   char __user * __user *,
 			   struct pt_regs *);
 long sys_arch_prctl(int, unsigned long);
 
-/* kernel/ioport.c */
-asmlinkage long sys_iopl(unsigned int, struct pt_regs *);
-
-/* kernel/signal_64.c */
+/* kernel/signal.c */
 asmlinkage long sys_sigaltstack(const stack_t __user *, stack_t __user *,
 				struct pt_regs *);
-long sys_rt_sigreturn(struct pt_regs *);
 
 /* kernel/sys_x86_64.c */
+struct new_utsname;
+
 asmlinkage long sys_mmap(unsigned long, unsigned long, unsigned long,
 			 unsigned long, unsigned long, unsigned long);
-struct new_utsname;
 asmlinkage long sys_uname(struct new_utsname __user *);
 
 #endif /* CONFIG_X86_32 */
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 8499000..156ae14 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -59,6 +59,7 @@
 #include <asm/setup.h>
 #include <asm/irq_remapping.h>
 #include <asm/hpet.h>
+#include <asm/hw_irq.h>
 #include <asm/uv/uv_hub.h>
 #include <asm/uv/uv_irq.h>
 
diff --git a/arch/x86/kernel/apic/nmi.c b/arch/x86/kernel/apic/nmi.c
index d6bd624..0205631 100644
--- a/arch/x86/kernel/apic/nmi.c
+++ b/arch/x86/kernel/apic/nmi.c
@@ -104,7 +104,7 @@ static __init void nmi_cpu_busy(void *data)
 }
 #endif
 
-static void report_broken_nmi(int cpu, int *prev_nmi_count)
+static void report_broken_nmi(int cpu, unsigned int *prev_nmi_count)
 {
 	printk(KERN_CONT "\n");
 
diff --git a/arch/x86/kernel/apic/probe_32.c b/arch/x86/kernel/apic/probe_32.c
index 01eda2a..440a8bc 100644
--- a/arch/x86/kernel/apic/probe_32.c
+++ b/arch/x86/kernel/apic/probe_32.c
@@ -160,7 +160,6 @@ extern struct apic apic_summit;
 extern struct apic apic_bigsmp;
 extern struct apic apic_es7000;
 extern struct apic apic_es7000_cluster;
-extern struct apic apic_default;
 
 struct apic *apic = &apic_default;
 EXPORT_SYMBOL_GPL(apic);
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
index 9be593f..74fcb3b 100644
--- a/arch/x86/kernel/irq.c
+++ b/arch/x86/kernel/irq.c
@@ -12,6 +12,7 @@
 #include <asm/io_apic.h>
 #include <asm/irq.h>
 #include <asm/idle.h>
+#include <asm/hw_irq.h>
 
 atomic_t irq_err_count;
 
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index 1d71442..e915045 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -15,6 +15,7 @@
 #include <asm/uaccess.h>
 #include <asm/i387.h>
 #include <asm/ds.h>
+#include <asm/syscalls.h>
 
 unsigned long idle_halt;
 EXPORT_SYMBOL(idle_halt);
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 7a567eb..a8dc0d0 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -384,13 +384,13 @@ unsigned long native_calibrate_tsc(void)
 {
 	u64 tsc1, tsc2, delta, ref1, ref2;
 	unsigned long tsc_pit_min = ULONG_MAX, tsc_ref_min = ULONG_MAX;
-	unsigned long flags, latch, ms, fast_calibrate, tsc_khz;
+	unsigned long flags, latch, ms, fast_calibrate, hv_tsc_khz;
 	int hpet = is_hpet_enabled(), i, loopmin;
 
-	tsc_khz = get_hypervisor_tsc_freq();
-	if (tsc_khz) {
+	hv_tsc_khz = get_hypervisor_tsc_freq();
+	if (hv_tsc_khz) {
 		printk(KERN_INFO "TSC: Frequency read from the hypervisor\n");
-		return tsc_khz;
+		return hv_tsc_khz;
 	}
 
 	local_irq_save(flags);
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index 51ae5ea..4e49613 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -1,3 +1,4 @@
+#include <linux/initrd.h>
 #include <linux/ioport.h>
 #include <linux/swap.h>
 



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [git-pull -tip] x86: declaration patches
  2009-04-10 18:33   ` Jaswinder Singh Rajput
@ 2009-04-12 13:21     ` Ingo Molnar
  0 siblings, 0 replies; 8+ messages in thread
From: Ingo Molnar @ 2009-04-12 13:21 UTC (permalink / raw)
  To: Jaswinder Singh Rajput
  Cc: Sam Ravnborg, x86 maintainers, LKML, Andrew Morton, Andi Kleen,
	Thomas Gleixner


* Jaswinder Singh Rajput <jaswinder@kernel.org> wrote:

> On Fri, 2009-04-10 at 19:29 +0200, Sam Ravnborg wrote:
> 
> > The above is a lot ifdefs just to:
> > 1) use asmlinkage only on 64 bit
> > 2) hide the prototype if do not implement the function
> > 
> > Is there any relevant cost associated with asmlinkage or could we just make it
> > always asmlinkage?
> > 
> 
> Ok fixed asmlinkage issue.
> 
> and also fixed thomas's comment issue.
> 
> So here is new pull request:
> The following changes since commit 7fd61bdf06572f1ca681aa35f5c86531a821ea75:
>   Ingo Molnar (1):
>         Merge branch 'x86/urgent'

Looks good - i've applied this as a single patch to tip:x86/cleanups 
because it's now all simple enough, and because i had to fix a few 
details in the individual subject lines. So it was easier to do it 
in one bunch based on the shortlog.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-04-12 13:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-10 16:33 [git-pull -tip] x86: declaration patches Jaswinder Singh Rajput
2009-04-10 16:51 ` Thomas Gleixner
2009-04-10 17:21   ` Jaswinder Singh Rajput
2009-04-10 18:11     ` Thomas Gleixner
2009-04-10 17:29 ` Sam Ravnborg
2009-04-10 17:45   ` Cyrill Gorcunov
2009-04-10 18:33   ` Jaswinder Singh Rajput
2009-04-12 13:21     ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox