diff mbox

[U-Boot,v3,1/6] arm: adapt asm/linkage.h from Linux

Message ID 1330005966-1444-1-git-send-email-aneesh@ti.com
State Changes Requested
Delegated to: Tom Rini
Headers show

Commit Message

Aneesh V Feb. 23, 2012, 2:06 p.m. UTC
This will add ARM specific over-rides for the defines
from linux/linkage.h

Signed-off-by: Aneesh V <aneesh@ti.com>
---
Not adding the defines for __ALIGN and __ALIGN_STR
because it's not clear why alignment is set to 0
(single byte alignment).

Creates a checkpatch error that can not be avoided

Changes in V2:
 - Newly added
---
 arch/arm/include/asm/linkage.h |   11 +++++++++++
 include/linux/linkage.h        |    5 +++++
 2 files changed, 16 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/include/asm/linkage.h

Comments

Mike Frysinger Feb. 23, 2012, 2:59 p.m. UTC | #1
On Thursday 23 February 2012 09:06:01 Aneesh V wrote:
> --- /dev/null
> +++ b/arch/arm/include/asm/linkage.h
> @@ -0,0 +1,11 @@
> +#ifndef __ASM_LINKAGE_H
> +#define __ASM_LINKAGE_H

needs copyright/license comment header

> +#define ENDPROC(name) \
> +.type name, %function; \
> +END(name)

please change linux/linkage.h instead.  % should be safe for everyone.
-mike
Tom Rini Feb. 23, 2012, 3:24 p.m. UTC | #2
On Thu, Feb 23, 2012 at 09:59:00AM -0500, Mike Frysinger wrote:
> On Thursday 23 February 2012 09:06:01 Aneesh V wrote:
> > --- /dev/null
> > +++ b/arch/arm/include/asm/linkage.h
> > @@ -0,0 +1,11 @@
> > +#ifndef __ASM_LINKAGE_H
> > +#define __ASM_LINKAGE_H
> 
> needs copyright/license comment header

This is a copy/paste from the kernel version.  I think we just need to
say what commit this is pulled from for future re-syncs.

> > +#define ENDPROC(name) \
> > +.type name, %function; \
> > +END(name)
> 
> please change linux/linkage.h instead.  % should be safe for everyone.

Do we really want to diverge from the kernel here?
Mike Frysinger Feb. 23, 2012, 4:57 p.m. UTC | #3
On Thursday 23 February 2012 10:24:36 Tom Rini wrote:
> On Thu, Feb 23, 2012 at 09:59:00AM -0500, Mike Frysinger wrote:
> > On Thursday 23 February 2012 09:06:01 Aneesh V wrote:
> > > --- /dev/null
> > > +++ b/arch/arm/include/asm/linkage.h
> > > @@ -0,0 +1,11 @@
> > > +#ifndef __ASM_LINKAGE_H
> > > +#define __ASM_LINKAGE_H
> > 
> > needs copyright/license comment header
> 
> This is a copy/paste from the kernel version.  I think we just need to
> say what commit this is pulled from for future re-syncs.
> 
> > > +#define ENDPROC(name) \
> > > +.type name, %function; \
> > > +END(name)
> > 
> > please change linux/linkage.h instead.  % should be safe for everyone.
> 
> Do we really want to diverge from the kernel here?

u-boot's linux/linkage.h already has.  prob could push this particular fix back 
to Linux ...
-mike
Aneesh V Feb. 23, 2012, 5:40 p.m. UTC | #4
On Thursday 23 February 2012 08:29 PM, Mike Frysinger wrote:
> On Thursday 23 February 2012 09:06:01 Aneesh V wrote:
>> --- /dev/null
>> +++ b/arch/arm/include/asm/linkage.h
>> @@ -0,0 +1,11 @@
>> +#ifndef __ASM_LINKAGE_H
>> +#define __ASM_LINKAGE_H
>
> needs copyright/license comment header

As Tom mentioned, I don't know whose copyright it is.

>
>> +#define ENDPROC(name) \
>> +.type name, %function; \
>> +END(name)
>
> please change linux/linkage.h instead.  % should be safe for everyone.

The spec says that STT_FUNC will work for all archs. How about using
that?
Mike Frysinger Feb. 23, 2012, 11:52 p.m. UTC | #5
On Thursday 23 February 2012 12:40:54 Aneesh V wrote:
> On Thursday 23 February 2012 08:29 PM, Mike Frysinger wrote:
> > On Thursday 23 February 2012 09:06:01 Aneesh V wrote:
> >> --- /dev/null
> >> +++ b/arch/arm/include/asm/linkage.h
> >> @@ -0,0 +1,11 @@
> >> +#ifndef __ASM_LINKAGE_H
> >> +#define __ASM_LINKAGE_H
> > 
> > needs copyright/license comment header
> 
> As Tom mentioned, I don't know whose copyright it is.

sorry, i assumed you were creating it from scratch

> >> +#define ENDPROC(name) \
> >> +.type name, %function; \
> >> +END(name)
> > 
> > please change linux/linkage.h instead.  % should be safe for everyone.
> 
> The spec says that STT_FUNC will work for all archs. How about using
> that?

i'd prefer to use %function in the common code, but i won't fight too hard.  
reading gas/config/obj-elf.c seems to back up your STT_FUNC claims; it's just 
that i've found @function/%function to be much more common in practice than 
using STT_FUNC.  i've only see the latter in more esoteric code ...
-mike
Aneesh V Feb. 24, 2012, 10:30 a.m. UTC | #6
On Friday 24 February 2012 05:22 AM, Mike Frysinger wrote:
> On Thursday 23 February 2012 12:40:54 Aneesh V wrote:
>> On Thursday 23 February 2012 08:29 PM, Mike Frysinger wrote:
>>> On Thursday 23 February 2012 09:06:01 Aneesh V wrote:
>>>> --- /dev/null
>>>> +++ b/arch/arm/include/asm/linkage.h
>>>> @@ -0,0 +1,11 @@
>>>> +#ifndef __ASM_LINKAGE_H
>>>> +#define __ASM_LINKAGE_H
>>>
>>> needs copyright/license comment header
>>
>> As Tom mentioned, I don't know whose copyright it is.
>
> sorry, i assumed you were creating it from scratch
>
>>>> +#define ENDPROC(name) \
>>>> +.type name, %function; \
>>>> +END(name)
>>>
>>> please change linux/linkage.h instead.  % should be safe for everyone.
>>
>> The spec says that STT_FUNC will work for all archs. How about using
>> that?
>
> i'd prefer to use %function in the common code, but i won't fight too hard.
> reading gas/config/obj-elf.c seems to back up your STT_FUNC claims; it's just
> that i've found @function/%function to be much more common in practice than
> using STT_FUNC.  i've only see the latter in more esoteric code ...

I don't have any strong preference either. I was just trying to see if
it's documented in gcc manuals that %function works for all and I
stumbled upon STT_FUNC. I agree that %function looks more natural, but
since we are hiding it in a macro, I think it doesn't matter much
anyway. I will do it with STT_FUNC.

br,
Aneesh
diff mbox

Patch

diff --git a/arch/arm/include/asm/linkage.h b/arch/arm/include/asm/linkage.h
new file mode 100644
index 0000000..bb2f937
--- /dev/null
+++ b/arch/arm/include/asm/linkage.h
@@ -0,0 +1,11 @@ 
+#ifndef __ASM_LINKAGE_H
+#define __ASM_LINKAGE_H
+
+#define __ALIGN .align 0
+#define __ALIGN_STR ".align 0"
+
+#define ENDPROC(name) \
+.type name, %function; \
+END(name)
+
+#endif
diff --git a/include/linux/linkage.h b/include/linux/linkage.h
index ed4cf6c..adf3762 100644
--- a/include/linux/linkage.h
+++ b/include/linux/linkage.h
@@ -44,8 +44,13 @@ 
 #define SYMBOL_NAME_LABEL(X)	X:
 #endif
 
+#ifndef __ALIGN
 #define __ALIGN .align		4
+#endif
+
+#ifndef __ALIGN_STR
 #define __ALIGN_STR		".align 4"
+#endif
 
 #ifdef __ASSEMBLY__