public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [Patch] cris: add missing declaration of kgdb_init() and breakpoint()
@ 2011-05-22 14:42 Américo Wang
  2011-06-01 22:16 ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: Américo Wang @ 2011-05-22 14:42 UTC (permalink / raw)
  To: linux-cris-kernel, LKML
  Cc: Geert Uytterhoeven, Mikael Starvik, Andrew Morton, Jesper Nilsson

[-- Attachment #1: Type: text/plain, Size: 460 bytes --]

This patch fixes such a build error on cris:

arch/cris/arch-v10/kernel/irq.c:239: error: implicit declaration of
function 'kgdb_init'
arch/cris/arch-v10/kernel/irq.c:240: error: implicit declaration of
function 'breakpoint'

So, just declare these two functions.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>

---

[-- Attachment #2: cris-fix-build-error-kgdb_init.diff --]
[-- Type: text/x-patch, Size: 544 bytes --]

diff --git a/arch/cris/arch-v10/kernel/irq.c b/arch/cris/arch-v10/kernel/irq.c
index 907cfb5..ba0e596 100644
--- a/arch/cris/arch-v10/kernel/irq.c
+++ b/arch/cris/arch-v10/kernel/irq.c
@@ -20,6 +20,9 @@
 #define crisv10_mask_irq(irq_nr) (*R_VECT_MASK_CLR = 1 << (irq_nr));
 #define crisv10_unmask_irq(irq_nr) (*R_VECT_MASK_SET = 1 << (irq_nr));
 
+extern void kgdb_init(void);
+extern void breakpoint(void);
+
 /* don't use set_int_vector, it bypasses the linux interrupt handlers. it is
  * global just so that the kernel gdb can use it.
  */

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

* Re: [Patch] cris: add missing declaration of kgdb_init() and breakpoint()
  2011-05-22 14:42 [Patch] cris: add missing declaration of kgdb_init() and breakpoint() Américo Wang
@ 2011-06-01 22:16 ` Andrew Morton
  2011-06-02 14:31   ` Américo Wang
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2011-06-01 22:16 UTC (permalink / raw)
  To: Américo Wang
  Cc: linux-cris-kernel, LKML, Geert Uytterhoeven, Mikael Starvik,
	Jesper Nilsson

On Sun, 22 May 2011 22:42:56 +0800
Am__rico Wang <xiyou.wangcong@gmail.com> wrote:

> --- a/arch/cris/arch-v10/kernel/irq.c
> +++ b/arch/cris/arch-v10/kernel/irq.c
> @@ -20,6 +20,9 @@
>  #define crisv10_mask_irq(irq_nr) (*R_VECT_MASK_CLR = 1 << (irq_nr));
>  #define crisv10_unmask_irq(irq_nr) (*R_VECT_MASK_SET = 1 << (irq_nr));
>  
> +extern void kgdb_init(void);
> +extern void breakpoint(void);

They should be declared in a header file, please. 
arch/cris/arch-v32/kernel/irq.c has a private declaration of
kgdb_init(), too.


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

* Re: [Patch] cris: add missing declaration of kgdb_init() and breakpoint()
  2011-06-01 22:16 ` Andrew Morton
@ 2011-06-02 14:31   ` Américo Wang
  2011-06-02 17:21     ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: Américo Wang @ 2011-06-02 14:31 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Américo Wang, linux-cris-kernel, LKML, Geert Uytterhoeven,
	Mikael Starvik, Jesper Nilsson

On Wed, Jun 01, 2011 at 03:16:18PM -0700, Andrew Morton wrote:
>On Sun, 22 May 2011 22:42:56 +0800
>Am__rico Wang <xiyou.wangcong@gmail.com> wrote:
>
>> --- a/arch/cris/arch-v10/kernel/irq.c
>> +++ b/arch/cris/arch-v10/kernel/irq.c
>> @@ -20,6 +20,9 @@
>>  #define crisv10_mask_irq(irq_nr) (*R_VECT_MASK_CLR = 1 << (irq_nr));
>>  #define crisv10_unmask_irq(irq_nr) (*R_VECT_MASK_SET = 1 << (irq_nr));
>>  
>> +extern void kgdb_init(void);
>> +extern void breakpoint(void);
>
>They should be declared in a header file, please. 
>arch/cris/arch-v32/kernel/irq.c has a private declaration of
>kgdb_init(), too.
>

Yeah, but I don't find a proper header to declare them.

Thanks.

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

* Re: [Patch] cris: add missing declaration of kgdb_init() and breakpoint()
  2011-06-02 14:31   ` Américo Wang
@ 2011-06-02 17:21     ` Andrew Morton
  2011-06-03 15:32       ` Américo Wang
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2011-06-02 17:21 UTC (permalink / raw)
  To: Américo Wang
  Cc: linux-cris-kernel, LKML, Geert Uytterhoeven, Mikael Starvik,
	Jesper Nilsson

On Thu, 2 Jun 2011 22:31:41 +0800 Am__rico Wang <xiyou.wangcong@gmail.com> wrote:

> On Wed, Jun 01, 2011 at 03:16:18PM -0700, Andrew Morton wrote:
> >On Sun, 22 May 2011 22:42:56 +0800
> >Am__rico Wang <xiyou.wangcong@gmail.com> wrote:
> >
> >> --- a/arch/cris/arch-v10/kernel/irq.c
> >> +++ b/arch/cris/arch-v10/kernel/irq.c
> >> @@ -20,6 +20,9 @@
> >>  #define crisv10_mask_irq(irq_nr) (*R_VECT_MASK_CLR = 1 << (irq_nr));
> >>  #define crisv10_unmask_irq(irq_nr) (*R_VECT_MASK_SET = 1 << (irq_nr));
> >>  
> >> +extern void kgdb_init(void);
> >> +extern void breakpoint(void);
> >
> >They should be declared in a header file, please. 
> >arch/cris/arch-v32/kernel/irq.c has a private declaration of
> >kgdb_init(), too.
> >
> 
> Yeah, but I don't find a proper header to declare them.

Don't be afraid to create a new file!  If that's the appropriate thing
to do, it's probably the correct thing to do.

z:/usr/src/25> find . -name kgdb.h
./arch/x86/include/asm/kgdb.h
./arch/blackfin/include/asm/kgdb.h
./arch/mn10300/include/asm/kgdb.h
./arch/arm/include/asm/kgdb.h
./arch/microblaze/include/asm/kgdb.h
./arch/sparc/include/asm/kgdb.h
./arch/powerpc/include/asm/kgdb.h
./arch/mips/include/asm/kgdb.h
./arch/sh/include/asm/kgdb.h
./include/config/have/arch/kgdb.h
./include/config/kgdb.h
./include/linux/kgdb.h

I'd follow the herd and create arch/cris/include/asm/kgdb.h.

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

* Re: [Patch] cris: add missing declaration of kgdb_init() and breakpoint()
  2011-06-02 17:21     ` Andrew Morton
@ 2011-06-03 15:32       ` Américo Wang
  0 siblings, 0 replies; 5+ messages in thread
From: Américo Wang @ 2011-06-03 15:32 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-cris-kernel, LKML, Geert Uytterhoeven, Mikael Starvik,
	Jesper Nilsson

On Fri, Jun 3, 2011 at 1:21 AM, Andrew Morton <akpm@linux-foundation.org> wrote:
> On Thu, 2 Jun 2011 22:31:41 +0800 Am__rico Wang <xiyou.wangcong@gmail.com> wrote:
>
>> On Wed, Jun 01, 2011 at 03:16:18PM -0700, Andrew Morton wrote:
>> >On Sun, 22 May 2011 22:42:56 +0800
>> >Am__rico Wang <xiyou.wangcong@gmail.com> wrote:
>> >
>> >> --- a/arch/cris/arch-v10/kernel/irq.c
>> >> +++ b/arch/cris/arch-v10/kernel/irq.c
>> >> @@ -20,6 +20,9 @@
>> >>  #define crisv10_mask_irq(irq_nr) (*R_VECT_MASK_CLR = 1 << (irq_nr));
>> >>  #define crisv10_unmask_irq(irq_nr) (*R_VECT_MASK_SET = 1 << (irq_nr));
>> >>
>> >> +extern void kgdb_init(void);
>> >> +extern void breakpoint(void);
>> >
>> >They should be declared in a header file, please.
>> >arch/cris/arch-v32/kernel/irq.c has a private declaration of
>> >kgdb_init(), too.
>> >
>>
>> Yeah, but I don't find a proper header to declare them.
>
> Don't be afraid to create a new file!  If that's the appropriate thing
> to do, it's probably the correct thing to do.
>

You are right...

>
> I'd follow the herd and create arch/cris/include/asm/kgdb.h.
>

Or maybe arch/cris/include/arch-v10/arch/kgdb.h is better?

Anyway, since you already took the patch, I will send a delta patch.

Thanks!

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

end of thread, other threads:[~2011-06-03 15:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-22 14:42 [Patch] cris: add missing declaration of kgdb_init() and breakpoint() Américo Wang
2011-06-01 22:16 ` Andrew Morton
2011-06-02 14:31   ` Américo Wang
2011-06-02 17:21     ` Andrew Morton
2011-06-03 15:32       ` Américo Wang

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