Dump Management

2008-07-01 Thread Marco Stornelli

Hi,

what's the standard way to manage the core dump and therefore the 
post-mortem debug? For my experience it could be useful to have a 
mechanism to have little dump image (only some information) to store it 
in flash and maybe to have an hook (or something like this) for each 
application to customize the dump information. What do you think about it?


Regards,
--
Marco Stornelli
Embedded Software Engineer
CoRiTeL - Consorzio di Ricerca sulle Telecomunicazioni
http://www.coritel.it

[EMAIL PROTECTED]
+39 06 72582838
--
To unsubscribe from this list: send the line unsubscribe linux-embedded in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH v4 1/6] dmaengine: Add dma_client parameter to device_alloc_chan_resources

2008-07-01 Thread Sosnowski, Maciej
 -- Original message --
 From: Haavard Skinnemoen [EMAIL PROTECTED]
 Date: Jun 26, 2008 3:23 PM
 Subject: [PATCH v4 1/6] dmaengine: Add dma_client parameter to
 device_alloc_chan_resources
 To: Dan Williams [EMAIL PROTECTED], Pierre Ossman
 [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED], linux-embedded@vger.kernel.org,
 [EMAIL PROTECTED], [EMAIL PROTECTED], David Brownell
 [EMAIL PROTECTED], Haavard Skinnemoen
 [EMAIL PROTECTED]
 
 
 A DMA controller capable of doing slave transfers may need to know a
 few things about the slave when preparing the channel. We don't want
 to add this information to struct dma_channel since the channel hasn't
 yet been bound to a client at this point.
 
 Instead, pass a reference to the client requesting the channel to the
 driver's device_alloc_chan_resources hook so that it can pick the
 necessary information from the dma_client struct by itself.
 
 Signed-off-by: Haavard Skinnemoen [EMAIL PROTECTED]
 ---
  drivers/dma/dmaengine.c   |3 ++-
  drivers/dma/ioat_dma.c|5 +++--
  drivers/dma/iop-adma.c|7 ---
  include/linux/dmaengine.h |3 ++-
  4 files changed, 11 insertions(+), 7 deletions(-)
 
 diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
 index 99c22b4..a57c337 100644
 --- a/drivers/dma/dmaengine.c
 +++ b/drivers/dma/dmaengine.c
 @@ -174,7 +174,8 @@ static void dma_client_chan_alloc(struct
dma_client
*client) if (!dma_chan_satisfies_mask(chan,
client-cap_mask)) continue;
 
 -   desc =
 chan-device-device_alloc_chan_resources(chan); +
desc
 = chan-device-device_alloc_chan_resources( +

chan, client); if (desc = 0) {
ack = client-event_callback(client,
chan,
 diff --git a/drivers/dma/ioat_dma.c b/drivers/dma/ioat_dma.c
 index 318e8a2..90e5b0a 100644
 --- a/drivers/dma/ioat_dma.c
 +++ b/drivers/dma/ioat_dma.c
 @@ -452,7 +452,8 @@ static void ioat2_dma_massage_chan_desc(struct
 ioat_dma_chan *ioat_chan)
  * ioat_dma_alloc_chan_resources - returns the number of allocated
descriptors
  * @chan: the channel to be filled out
  */
 -static int ioat_dma_alloc_chan_resources(struct dma_chan *chan)
 +static int ioat_dma_alloc_chan_resources(struct dma_chan *chan,
 +struct dma_client *client)
  {
struct ioat_dma_chan *ioat_chan = to_ioat_chan(chan);
struct ioat_desc_sw *desc;
 @@ -1049,7 +1050,7 @@ static int ioat_dma_self_test(struct
 ioatdma_device *device)
dma_chan = container_of(device-common.channels.next,
struct dma_chan,
device_node);
 -   if (device-common.device_alloc_chan_resources(dma_chan)  1)
{
 +   if (device-common.device_alloc_chan_resources(dma_chan, NULL)
 1) {
dev_err(device-pdev-dev,
selftest cannot allocate chan resource\n);
err = -ENODEV;
 diff --git a/drivers/dma/iop-adma.c b/drivers/dma/iop-adma.c
 index 0ec0f43..2664ea5 100644
 --- a/drivers/dma/iop-adma.c
 +++ b/drivers/dma/iop-adma.c
 @@ -444,7 +444,8 @@ static void iop_chan_start_null_memcpy(struct
 iop_adma_chan *iop_chan);
  static void iop_chan_start_null_xor(struct iop_adma_chan *iop_chan);
 
  /* returns the number of allocated descriptors */
 -static int iop_adma_alloc_chan_resources(struct dma_chan *chan)
 +static int iop_adma_alloc_chan_resources(struct dma_chan *chan,
 +struct dma_client *client)
  {
char *hw_desc;
int idx;
 @@ -838,7 +839,7 @@ static int __devinit
 iop_adma_memcpy_self_test(struct iop_adma_device *device)
dma_chan = container_of(device-common.channels.next,
struct dma_chan,
device_node);
 -   if (iop_adma_alloc_chan_resources(dma_chan)  1) {
 +   if (iop_adma_alloc_chan_resources(dma_chan, NULL)  1) {
err = -ENODEV;
goto out;
}
 @@ -936,7 +937,7 @@ iop_adma_xor_zero_sum_self_test(struct
 iop_adma_device *device)
dma_chan = container_of(device-common.channels.next,
struct dma_chan,
device_node);
 -   if (iop_adma_alloc_chan_resources(dma_chan)  1) {
 +   if (iop_adma_alloc_chan_resources(dma_chan, NULL)  1) {
err = -ENODEV;
goto out;
}
 diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
 index d08a5c5..cffb95f 100644
 --- a/include/linux/dmaengine.h
 +++ b/include/linux/dmaengine.h
 @@ -279,7 +279,8 @@ struct dma_device {
int dev_id;
struct device *dev;
 
 -   int (*device_alloc_chan_resources)(struct dma_chan *chan);
 +   int (*device_alloc_chan_resources)(struct dma_chan *chan,
 +   struct dma_client *client);

RE: [PATCH v4 2/6] dmaengine: Add dma_chan_is_in_use() function

2008-07-01 Thread Sosnowski, Maciej
 -- Original message --
 From: Haavard Skinnemoen [EMAIL PROTECTED]
 Date: Jun 26, 2008 3:23 PM
 Subject: [PATCH v4 2/6] dmaengine: Add dma_chan_is_in_use() function
 To: Dan Williams [EMAIL PROTECTED], Pierre Ossman
 [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED], linux-embedded@vger.kernel.org,
 [EMAIL PROTECTED], [EMAIL PROTECTED], David Brownell
 [EMAIL PROTECTED], Haavard Skinnemoen
 [EMAIL PROTECTED]
 
 
 This moves the code checking if a DMA channel is in use from
 show_in_use() into an inline helper function, dma_is_in_use(). DMA
 controllers can use this in order to give clients exclusive access to
 channels (usually necessary when setting up slave DMA.)
 
 I have to admit that I don't really understand the channel refcounting
 logic at all... dma_chan_get() simply increments a per-cpu value. How
 can we be sure that whatever CPU calls dma_chan_is_in_use() sees the
 same value?
 
 Signed-off-by: Haavard Skinnemoen [EMAIL PROTECTED]
 ---
  drivers/dma/dmaengine.c   |   12 +---
  include/linux/dmaengine.h |   17 +
  2 files changed, 18 insertions(+), 11 deletions(-)
 
 diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
 index a57c337..ad8d811 100644
 --- a/drivers/dma/dmaengine.c
 +++ b/drivers/dma/dmaengine.c
 @@ -105,17 +105,7 @@ static ssize_t show_bytes_transferred(struct
 device *dev, struct device_attribut
  static ssize_t show_in_use(struct device *dev, struct
 device_attribute *attr, char *buf)
  {
struct dma_chan *chan = to_dma_chan(dev);
 -   int in_use = 0;
 -
 -   if (unlikely(chan-slow_ref) 
 -   atomic_read(chan-refcount.refcount)  1)
 -   in_use = 1;
 -   else {
 -   if (local_read((per_cpu_ptr(chan-local,
 -   get_cpu())-refcount))  0)
 -   in_use = 1;
 -   put_cpu();
 -   }
 +   int in_use = dma_chan_is_in_use(chan);
 
return sprintf(buf, %d\n, in_use);
  }
 diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
 index cffb95f..4b602d3 100644
 --- a/include/linux/dmaengine.h
 +++ b/include/linux/dmaengine.h
 @@ -180,6 +180,23 @@ static inline void dma_chan_put(struct dma_chan
*chan)
}
  }
 
 +static inline bool dma_chan_is_in_use(struct dma_chan *chan)
 +{
 +   bool in_use = false;
 +
 +   if (unlikely(chan-slow_ref) 
 +   atomic_read(chan-refcount.refcount)  1)
 +   in_use = true;
 +   else {
 +   if (local_read((per_cpu_ptr(chan-local,
 +   get_cpu())-refcount))  0)
 +   in_use = true;
 +   put_cpu();
 +   }
 +
 +   return in_use;
 +}
 +
  /*
  * typedef dma_event_callback - function pointer to a DMA event
callback
  * For each channel added to the system this routine is called for
each
 client. --
 1.5.5.4

Acked-by: Maciej Sosnowski [EMAIL PROTECTED]

Regards,
Maciej
--
To unsubscribe from this list: send the line unsubscribe linux-embedded in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Dump Management

2008-07-01 Thread Gilad Ben-Yossef

hI,


Marco Stornelli wrote:

what's the standard way to manage the core dump and therefore the 
post-mortem debug? 
For most embedded systems I know, core dumps are useful on the developer 
desk and in the testing lab. For analyzing field post-mortem (where it 
is feasible), use a custom fault signal hander in your app to catch the 
relevant information and save it.


If you're interested in a tutorial in doing this, I'm giving one at this 
year OLS. Or you can just check out the slides and example code here:


http://tuxology.net/lectures/crash-and-burn-writing-linux-application-fault-handlers/ 

For my experience it could be useful to have a mechanism to have 
little dump image (only some information) to store it in flash and 
maybe to have an hook (or something like this) for each application to 
customize the dump information. What do you think about it?



That's exactly what a custom fault signal handler does :-)

Cheers,
Gilad

--
Gilad Ben-Yossef 
Chief Coffee Drinker


Codefidence Ltd.
The code is free, your time isn't.(TM)

Web:http://codefidence.com
Email:  [EMAIL PROTECTED]
Office: +972-8-9316883 ext. 201
Fax:+972-8-9316885
Mobile: +972-52-8260388

Q: How many NSA agents does it take to replace a lightbulb?
A: dSva7DrYiY24yeTItKyyogFXD5gRuoRqPNQ9v6WCLLywZPINlu!


--
To unsubscribe from this list: send the line unsubscribe linux-embedded in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Recommendation for activating a deferred module init in the kernel

2008-07-01 Thread Gilad Ben-Yossef

Tim Bird wrote:


Gilad Ben-Yossef wrote:
  

Tim Bird wrote:


I agree.  When you say have the application call modprobe directly,
I'm not sure I understand what you mean.
  

I simply meant that you can fork and exec modprobe itself (or use
system() but that
would require a working shell). This would save the need for a
separate script and a shell.



Well, this would explain why I didn't follow your original
point.  I thought you were using the word modprobe as a placeholder
for some other module-installation-related concept.  


Well, modprobe could just as well be insmod, but the basic idea is still 
the same.
  

The only downside I see of calling the sys_init_module syscall directly
is that it
doesn't do any of the dependency tracking that modprobe does, so it's more
a insmod replacement then a modprobe one, but I doubt this matters at
all in an
embedded system anyway.


It may just be my own blind spot, but I can't think of a good
reason to do such dependency tracking in an embedded device.
It is a sad state of affairs if the product developers don't
know the module dependencies for their own products.
  
For custom built modules written in house , I agree - but think of one 
of those devices that has an OTG USB port, the kind that you can one day 
connect it to a computer to play the part of a USB storage gadget and 
the next day hook a  it to up to a serial USB connected GSM modem.


It's crazy to have all that functionality loaded into the device RAM at 
all times and the using modprobe to track the dependencies of the module 
makes just as much sense as it does for your laptop.


I guess the term embedded gets kind of blurry with these things, but I 
also think Linux adoption in the embedded world is driven by this trend.



Cheers,
Gilad

--
Gilad Ben-Yossef 
Chief Coffee Drinker


Codefidence Ltd.
The code is free, your time isn't.(TM)

Web:http://codefidence.com
Email:  [EMAIL PROTECTED]
Office: +972-8-9316883 ext. 201
Fax:+972-8-9316885
Mobile: +972-52-8260388

Q: How many NSA agents does it take to replace a lightbulb?
A: dSva7DrYiY24yeTItKyyogFXD5gRuoRqPNQ9v6WCLLywZPINlu!


--
To unsubscribe from this list: send the line unsubscribe linux-embedded in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Atmel AT91SAM7S and AT91SAM7A3

2008-07-01 Thread Michelle Konzack
Hello Ben,

Am 2008-06-28 18:36:24, schrieb Ben Nizette:
 I would recommend posting this to a forum at http://www.at91.com.  This
 is a list more for discussion of embedded issues in the kernel than SoC
 end-user support :-)

I was already on http://www.at91.com/ but where  I  live,  I  can  not
access the Web-Forum.  I need a mailinglist.

Also I realy do not knoe whether accessing the AD-Converters in a Micro-
controller is a user space issue or a Kernel one, since  I  need  Kernel
modules or not?

I realy do not know, how to begin this stuff...

Thanks, Greetings and nice Day/Evening
Michelle Konzack
Systemadministrator
24V Electronic Engineer
Tamay Dogan Network
Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
# Debian GNU/Linux Consultant #
Michelle Konzack   Apt. 917  ICQ #328449886
+49/177/935194750, rue de Soultz MSN LinuxMichi
+33/6/61925193 67100 Strasbourg/France   IRC #Debian (irc.icq.com)


signature.pgp
Description: Digital signature


[PATCH 2/23] make section names compatible with -ffunction-sections -fdata-sections: alpha

2008-07-01 Thread Denys Vlasenko
The purpose of this patch is to make kernel buildable
with gcc -ffunction-sections -fdata-sections.
This patch fixes alpha architecture.

Signed-off-by: Denys Vlasenko [EMAIL PROTECTED]
--
vda


--- 0.org/arch/alpha/kernel/head.S  Wed Jul  2 00:40:39 2008
+++ 1.fixname/arch/alpha/kernel/head.S  Wed Jul  2 00:44:22 2008
@@ -10,7 +10,7 @@
 #include asm/system.h
 #include asm/asm-offsets.h
 
-.section .text.head, ax
+.section .head.text, ax
 .globl swapper_pg_dir
 .globl _stext
 swapper_pg_dir=SWAPPER_PGD
--- 0.org/arch/alpha/kernel/init_task.c Wed Jul  2 00:40:39 2008
+++ 1.fixname/arch/alpha/kernel/init_task.c Wed Jul  2 00:45:57 2008
@@ -18,5 +18,5 @@
 EXPORT_SYMBOL(init_task);
 
 union thread_union init_thread_union
-   __attribute__((section(.data.init_thread)))
+   __attribute__((section(.init_thread.data)))
= { INIT_THREAD_INFO(init_task) };
--- 0.org/arch/alpha/kernel/vmlinux.lds.S   Wed Jul  2 00:40:39 2008
+++ 1.fixname/arch/alpha/kernel/vmlinux.lds.S   Wed Jul  2 00:46:09 2008
@@ -16,7 +16,7 @@
 
_text = .;  /* Text and read-only data */
.text : {
-   *(.text.head)
+   *(.head.text)
TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
@@ -93,18 +93,18 @@
/* Freed after init ends here */
 
/* Note 2 page alignment above.  */
-   .data.init_thread : {
-   *(.data.init_thread)
+   .init_thread.data : {
+   *(.init_thread.data)
}
 
. = ALIGN(PAGE_SIZE);
-   .data.page_aligned : {
-   *(.data.page_aligned)
+   .page_aligned.data : {
+   *(.page_aligned.data)
}
 
. = ALIGN(64);
-   .data.cacheline_aligned : {
-   *(.data.cacheline_aligned)
+   .cacheline_aligned.data : {
+   *(.cacheline_aligned.data)
}
 
_data = .;
--
To unsubscribe from this list: send the line unsubscribe linux-embedded in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/23] make section names compatible with -ffunction-sections -fdata-sections: arm

2008-07-01 Thread Denys Vlasenko
The purpose of this patch is to make kernel buildable
with gcc -ffunction-sections -fdata-sections.
This patch fixes arm architecture.

Signed-off-by: Denys Vlasenko [EMAIL PROTECTED]
--
vda


--- 0.org/arch/arm/kernel/head-nommu.S  Wed Jul  2 00:40:39 2008
+++ 1.fixname/arch/arm/kernel/head-nommu.S  Wed Jul  2 00:44:22 2008
@@ -33,7 +33,7 @@
  * numbers for r1.
  *
  */
-   .section .text.head, ax
+   .section .head.text, ax
.type   stext, %function
 ENTRY(stext)
msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode
--- 0.org/arch/arm/kernel/head.SWed Jul  2 00:40:39 2008
+++ 1.fixname/arch/arm/kernel/head.SWed Jul  2 00:44:22 2008
@@ -74,7 +74,7 @@
  * crap here - that's what the boot loader (or in extreme, well justified
  * circumstances, zImage) is for.
  */
-   .section .text.head, ax
+   .section .head.text, ax
.type   stext, %function
 ENTRY(stext)
msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode
--- 0.org/arch/arm/kernel/init_task.c   Wed Jul  2 00:40:39 2008
+++ 1.fixname/arch/arm/kernel/init_task.c   Wed Jul  2 00:45:57 2008
@@ -30,7 +30,7 @@
  * The things we do for performance..
  */
 union thread_union init_thread_union
-   __attribute__((__section__(.data.init_task))) =
+   __attribute__((__section__(.init_task.data))) =
{ INIT_THREAD_INFO(init_task) };
 
 /*
--- 0.org/arch/arm/kernel/vmlinux.lds.S Wed Jul  2 00:40:39 2008
+++ 1.fixname/arch/arm/kernel/vmlinux.lds.S Wed Jul  2 00:46:03 2008
@@ -23,10 +23,10 @@
 #else
. = PAGE_OFFSET + TEXT_OFFSET;
 #endif
-   .text.head : {
+   .head.text : {
_stext = .;
_sinittext = .;
-   *(.text.head)
+   *(.head.text)
}
 
.init : {   /* Init code and data   */
@@ -65,8 +65,8 @@
 #endif
. = ALIGN(4096);
__per_cpu_start = .;
-   *(.data.percpu)
-   *(.data.percpu.shared_aligned)
+   *(.percpu.data)
+   *(.percpu.shared_aligned.data)
__per_cpu_end = .;
 #ifndef CONFIG_XIP_KERNEL
__init_begin = _stext;
@@ -125,7 +125,7 @@
 * first, the init task union, aligned
 * to an 8192 byte boundary.
 */
-   *(.data.init_task)
+   *(.init_task.data)
 
 #ifdef CONFIG_XIP_KERNEL
. = ALIGN(4096);
@@ -137,7 +137,7 @@
 
. = ALIGN(4096);
__nosave_begin = .;
-   *(.data.nosave)
+   *(.nosave.data)
. = ALIGN(4096);
__nosave_end = .;
 
@@ -145,7 +145,7 @@
 * then the cacheline aligned data
 */
. = ALIGN(32);
-   *(.data.cacheline_aligned)
+   *(.cacheline_aligned.data)
 
/*
 * The exception fixup table (might need resorting at runtime)
--- 0.org/arch/arm/mm/proc-v6.S Wed Jul  2 00:40:40 2008
+++ 1.fixname/arch/arm/mm/proc-v6.S Wed Jul  2 00:44:28 2008
@@ -164,7 +164,7 @@
.asciz  ARMv6-compatible processor
.align
 
-   .section .text.init, #alloc, #execinstr
+   .section .init.text, #alloc, #execinstr
 
 /*
  * __v6_setup
--- 0.org/arch/arm/mm/proc-v7.S Wed Jul  2 00:40:40 2008
+++ 1.fixname/arch/arm/mm/proc-v7.S Wed Jul  2 00:44:28 2008
@@ -146,7 +146,7 @@
.ascii  ARMv7 Processor
.align
 
-   .section .text.init, #alloc, #execinstr
+   .section .init.text, #alloc, #execinstr
 
 /*
  * __v7_setup
--- 0.org/arch/arm/mm/tlb-v6.S  Wed Jul  2 00:40:40 2008
+++ 1.fixname/arch/arm/mm/tlb-v6.S  Wed Jul  2 00:44:28 2008
@@ -87,7 +87,7 @@
mcr p15, 0, r2, c7, c5, 4   @ prefetch flush
mov pc, lr
 
-   .section .text.init, #alloc, #execinstr
+   .section .init.text, #alloc, #execinstr
 
.type   v6wbi_tlb_fns, #object
 ENTRY(v6wbi_tlb_fns)
--- 0.org/arch/arm/mm/tlb-v7.S  Wed Jul  2 00:40:40 2008
+++ 1.fixname/arch/arm/mm/tlb-v7.S  Wed Jul  2 00:44:28 2008
@@ -78,7 +78,7 @@
isb
mov pc, lr
 
-   .section .text.init, #alloc, #execinstr
+   .section .init.text, #alloc, #execinstr
 
.type   v7wbi_tlb_fns, #object
 ENTRY(v7wbi_tlb_fns)
--
To unsubscribe from this list: send the line unsubscribe linux-embedded in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/23] make section names compatible with -ffunction-sections -fdata-sections: avr

2008-07-01 Thread Denys Vlasenko
The purpose of this patch is to make kernel buildable
with gcc -ffunction-sections -fdata-sections.
This patch fixes avr architecture.

Signed-off-by: Denys Vlasenko [EMAIL PROTECTED]
--
vda


--- 0.org/arch/avr32/kernel/init_task.c Wed Jul  2 00:40:40 2008
+++ 1.fixname/arch/avr32/kernel/init_task.c Wed Jul  2 00:45:57 2008
@@ -24,7 +24,7 @@
  * Initial thread structure. Must be aligned on an 8192-byte boundary.
  */
 union thread_union init_thread_union
-   __attribute__((__section__(.data.init_task))) =
+   __attribute__((__section__(.init_task.data))) =
{ INIT_THREAD_INFO(init_task) };
 
 /*
--- 0.org/arch/avr32/kernel/vmlinux.lds.S   Wed Jul  2 00:40:40 2008
+++ 1.fixname/arch/avr32/kernel/vmlinux.lds.S   Wed Jul  2 00:45:57 2008
@@ -105,11 +105,11 @@
/*
 * First, the init task union, aligned to an 8K boundary.
 */
-   *(.data.init_task)
+   *(.init_task.data)
 
/* Then, the cacheline aligned data */
. = ALIGN(L1_CACHE_BYTES);
-   *(.data.cacheline_aligned)
+   *(.cacheline_aligned.data)
 
/* And the rest... */
*(.data.rel*)
--
To unsubscribe from this list: send the line unsubscribe linux-embedded in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 5/23] make section names compatible with -ffunction-sections -fdata-sections: blackfin

2008-07-01 Thread Denys Vlasenko
The purpose of this patch is to make kernel buildable
with gcc -ffunction-sections -fdata-sections.
This patch fixes blackfin architecture.

Signed-off-by: Denys Vlasenko [EMAIL PROTECTED]
--
vda


--- 0.org/arch/blackfin/kernel/vmlinux.lds.SWed Jul  2 00:40:40 2008
+++ 1.fixname/arch/blackfin/kernel/vmlinux.lds.SWed Jul  2 00:45:51 2008
@@ -91,7 +91,7 @@
__sdata = .;
/* This gets done first, so the glob doesn't suck it in */
. = ALIGN(32);
-   *(.data.cacheline_aligned)
+   *(.cacheline_aligned.data)
 
 #if !L1_DATA_A_LENGTH
. = ALIGN(32);
--
To unsubscribe from this list: send the line unsubscribe linux-embedded in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 6/23] make section names compatible with -ffunction-sections -fdata-sections: cris

2008-07-01 Thread Denys Vlasenko
The purpose of this patch is to make kernel buildable
with gcc -ffunction-sections -fdata-sections.
This patch fixes cris architecture.

Signed-off-by: Denys Vlasenko [EMAIL PROTECTED]
--
vda


--- 0.org/arch/cris/arch-v10/vmlinux.lds.S  Wed Jul  2 00:40:40 2008
+++ 1.fixname/arch/cris/arch-v10/vmlinux.lds.S  Wed Jul  2 00:45:57 2008
@@ -51,7 +51,7 @@
_edata = . ;
 
. = ALIGN(PAGE_SIZE);   /* init_task and stack, must be aligned */
-   .data.init_task : { *(.data.init_task) }
+   .init_task.data : { *(.init_task.data) }
 
. = ALIGN(PAGE_SIZE);   /* Init code and data */
__init_begin = .;
--- 0.org/arch/cris/arch-v32/vmlinux.lds.S  Wed Jul  2 00:40:40 2008
+++ 1.fixname/arch/cris/arch-v32/vmlinux.lds.S  Wed Jul  2 00:45:57 2008
@@ -63,7 +63,7 @@
_edata = . ;
 
. = ALIGN(PAGE_SIZE);   /* init_task and stack, must be aligned. */
-   .data.init_task : { *(.data.init_task) }
+   .init_task.data : { *(.init_task.data) }
 
. = ALIGN(PAGE_SIZE);   /* Init code and data. */
__init_begin = .;
--- 0.org/arch/cris/kernel/process.cWed Jul  2 00:40:40 2008
+++ 1.fixname/arch/cris/kernel/process.cWed Jul  2 00:45:57 2008
@@ -52,7 +52,7 @@
  * init_task linker map entry..
  */
 union thread_union init_thread_union 
-   __attribute__((__section__(.data.init_task))) =
+   __attribute__((__section__(.init_task.data))) =
{ INIT_THREAD_INFO(init_task) };
 
 /*
--
To unsubscribe from this list: send the line unsubscribe linux-embedded in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 8/23] make section names compatible with -ffunction-sections -fdata-sections: h8300

2008-07-01 Thread Denys Vlasenko
The purpose of this patch is to make kernel buildable
with gcc -ffunction-sections -fdata-sections.
This patch fixes h8300 architecture.

Signed-off-by: Denys Vlasenko [EMAIL PROTECTED]
--
vda


--- 0.org/arch/h8300/boot/compressed/head.S Wed Jul  2 00:40:40 2008
+++ 1.fixname/arch/h8300/boot/compressed/head.S Wed Jul  2 00:44:34 2008
@@ -9,7 +9,7 @@
 
 #define SRAM_START 0xff4000
 
-   .section.text.startup
+   .section.startup.text
.global startup
 startup:
mov.l   #SRAM_START+0x8000, sp
--- 0.org/arch/h8300/boot/compressed/vmlinux.ldsWed Jul  2 00:40:40 2008
+++ 1.fixname/arch/h8300/boot/compressed/vmlinux.ldsWed Jul  2 00:44:34 2008
@@ -4,7 +4,7 @@
 {
 __stext = . ;
__text = .;
-  *(.text.startup)
+  *(.startup.text)
   *(.text)
 __etext = . ;
 }
--- 0.org/arch/h8300/kernel/init_task.c Wed Jul  2 00:40:40 2008
+++ 1.fixname/arch/h8300/kernel/init_task.c Wed Jul  2 00:45:57 2008
@@ -37,6 +37,6 @@
  * init_task linker map entry..
  */
 union thread_union init_thread_union
-   __attribute__((__section__(.data.init_task))) =
+   __attribute__((__section__(.init_task.data))) =
{ INIT_THREAD_INFO(init_task) };
 
--- 0.org/arch/h8300/kernel/vmlinux.lds.S   Wed Jul  2 00:40:40 2008
+++ 1.fixname/arch/h8300/kernel/vmlinux.lds.S   Wed Jul  2 00:45:57 2008
@@ -101,7 +101,7 @@
___data_start = . ;
 
. = ALIGN(0x2000) ;
-   *(.data.init_task)
+   *(.init_task.data)
. = ALIGN(0x4) ;
DATA_DATA
. = ALIGN(0x4) ;
--
To unsubscribe from this list: send the line unsubscribe linux-embedded in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 9/23] make section names compatible with -ffunction-sections -fdata-sections: ia64

2008-07-01 Thread Denys Vlasenko
The purpose of this patch is to make kernel buildable
with gcc -ffunction-sections -fdata-sections.
This patch fixes ia64 architecture.

Signed-off-by: Denys Vlasenko [EMAIL PROTECTED]
--
vda


--- 0.org/arch/ia64/kernel/Makefile Wed Jul  2 00:40:40 2008
+++ 1.fixname/arch/ia64/kernel/Makefile Wed Jul  2 00:46:44 2008
@@ -66,7 +66,7 @@
 $(obj)/gate-syms.o: $(obj)/gate.lds $(obj)/gate.o FORCE
$(call if_changed,gate)
 
-# gate-data.o contains the gate DSO image as data in section .data.gate.
+# gate-data.o contains the gate DSO image as data in section .gate..data
 # We must build gate.so before we can assemble it.
 # Note: kbuild does not track this dependency due to usage of .incbin
 $(obj)/gate-data.o: $(obj)/gate.so
--- 0.org/arch/ia64/kernel/gate-data.S  Wed Jul  2 00:40:40 2008
+++ 1.fixname/arch/ia64/kernel/gate-data.S  Wed Jul  2 00:46:44 2008
@@ -1,3 +1,3 @@
-   .section .data.gate, aw
+   .section .gate.data, aw
 
.incbin arch/ia64/kernel/gate.so
--- 0.org/arch/ia64/kernel/gate.S   Wed Jul  2 00:40:40 2008
+++ 1.fixname/arch/ia64/kernel/gate.S   Wed Jul  2 00:46:20 2008
@@ -20,18 +20,18 @@
  * to targets outside the shared object) and to avoid multi-phase kernel 
builds, we
  * simply create minimalistic patch lists in special ELF sections.
  */
-   .section .data.patch.fsyscall_table, a
+   .section .patch.fsyscall_table.data, a
.previous
 #define LOAD_FSYSCALL_TABLE(reg)   \
 [1:]   movl reg=0; \
-   .xdata4 .data.patch.fsyscall_table, 1b-.
+   .xdata4 .patch.fsyscall_table.data, 1b-.
 
-   .section .data.patch.brl_fsys_bubble_down, a
+   .section .patch.brl_fsys_bubble_down.data, a
.previous
 #define BRL_COND_FSYS_BUBBLE_DOWN(pr)  \
 [1:](pr)brl.cond.sptk 0;   \
;;  \
-   .xdata4 .data.patch.brl_fsys_bubble_down, 1b-.
+   .xdata4 .patch.brl_fsys_bubble_down.data, 1b-.
 
 GLOBAL_ENTRY(__kernel_syscall_via_break)
.prologue
--- 0.org/arch/ia64/kernel/gate.lds.S   Wed Jul  2 00:40:40 2008
+++ 1.fixname/arch/ia64/kernel/gate.lds.S   Wed Jul  2 00:46:20 2008
@@ -32,21 +32,21 @@
 */
. = GATE_ADDR + 0x600;
 
-   .data.patch : {
+   .patch.data : {
__start_gate_mckinley_e9_patchlist = .;
-   *(.data.patch.mckinley_e9)
+   *(.patch.mckinley_e9.data)
__end_gate_mckinley_e9_patchlist = .;
 
__start_gate_vtop_patchlist = .;
-   *(.data.patch.vtop)
+   *(.patch.vtop.data)
__end_gate_vtop_patchlist = .;
 
__start_gate_fsyscall_patchlist = .;
-   *(.data.patch.fsyscall_table)
+   *(.patch.fsyscall_table.data)
__end_gate_fsyscall_patchlist = .;
 
__start_gate_brl_fsys_bubble_down_patchlist = .;
-   *(.data.patch.brl_fsys_bubble_down)
+   *(.patch.brl_fsys_bubble_down.data)
__end_gate_brl_fsys_bubble_down_patchlist = .;
}   :readable
 
--- 0.org/arch/ia64/kernel/head.S   Wed Jul  2 00:40:40 2008
+++ 1.fixname/arch/ia64/kernel/head.S   Wed Jul  2 00:44:22 2008
@@ -178,7 +178,7 @@
 halt_msg:
stringz Halting kernel\n
 
-   .section .text.head,ax
+   .section .head.text,ax
 
.global start_ap
 
--- 0.org/arch/ia64/kernel/init_task.c  Wed Jul  2 00:40:40 2008
+++ 1.fixname/arch/ia64/kernel/init_task.c  Wed Jul  2 00:45:57 2008
@@ -28,7 +28,7 @@
  * Initial task structure.
  *
  * We need to make sure that this is properly aligned due to the way process 
stacks are
- * handled. This is done by having a special .data.init_task section...
+ * handled. This is done by having a special .init_task.data section...
  */
 #define init_thread_info   init_task_mem.s.thread_info
 
@@ -38,7 +38,7 @@
struct thread_info thread_info;
} s;
unsigned long stack[KERNEL_STACK_SIZE/sizeof (unsigned long)];
-} init_task_mem asm (init_task) __attribute__((section(.data.init_task))) 
= {{
+} init_task_mem asm (init_task) __attribute__((section(.init_task.data))) 
= {{
.task = INIT_TASK(init_task_mem.s.task),
.thread_info =  INIT_THREAD_INFO(init_task_mem.s.task)
 }};
--- 0.org/arch/ia64/kernel/ivt.SWed Jul  2 00:40:40 2008
+++ 1.fixname/arch/ia64/kernel/ivt.SWed Jul  2 00:45:33 2008
@@ -75,7 +75,7 @@
mov r19=n;; /* prepare to save predicates */
\
br.sptk.many dispatch_to_fault_handler
 
-   .section .text.ivt,ax
+   .section .ivt.text,ax
 
.align 32768// align on 32KB boundary
.global ia64_ivt
--- 0.org/arch/ia64/kernel/minstate.h   Wed Jul  2 00:40:40 2008
+++ 1.fixname/arch/ia64/kernel/minstate.h

[PATCH 13/23] make section names compatible with -ffunction-sections -fdata-sections: mn10300

2008-07-01 Thread Denys Vlasenko
The purpose of this patch is to make kernel buildable
with gcc -ffunction-sections -fdata-sections.
This patch fixes mn10300 architecture.

Signed-off-by: Denys Vlasenko [EMAIL PROTECTED]
--
vda


--- 0.org/arch/mn10300/kernel/head.SWed Jul  2 00:40:41 2008
+++ 1.fixname/arch/mn10300/kernel/head.SWed Jul  2 00:44:22 2008
@@ -19,7 +19,7 @@
 #include asm/param.h
 #include asm/unit/serial.h
 
-   .section .text.head,ax
+   .section .head.text,ax
 
 ###
 #
--- 0.org/arch/mn10300/kernel/init_task.c   Wed Jul  2 00:40:41 2008
+++ 1.fixname/arch/mn10300/kernel/init_task.c   Wed Jul  2 00:45:57 2008
@@ -32,7 +32,7 @@
  * init_task linker map entry..
  */
 union thread_union init_thread_union
-   __attribute__((__section__(.data.init_task))) =
+   __attribute__((__section__(.init_task.data))) =
{ INIT_THREAD_INFO(init_task) };
 
 /*
--- 0.org/arch/mn10300/kernel/vmlinux.lds.S Wed Jul  2 00:40:41 2008
+++ 1.fixname/arch/mn10300/kernel/vmlinux.lds.S Wed Jul  2 00:47:00 2008
@@ -27,7 +27,7 @@
   _text = .;   /* Text and read-only data */
   .text : {
*(
-   .text.head
+   .head.text
.text
)
TEXT_TEXT
@@ -57,25 +57,25 @@
 
   . = ALIGN(4096);
   __nosave_begin = .;
-  .data_nosave : { *(.data.nosave) }
+  .data_nosave : { *(.nosave.data) }
   . = ALIGN(4096);
   __nosave_end = .;
 
   . = ALIGN(4096);
-  .data.page_aligned : { *(.data.idt) }
+  .page_aligned.data : { *(.idt.data) }
 
   . = ALIGN(32);
-  .data.cacheline_aligned : { *(.data.cacheline_aligned) }
+  .cacheline_aligned.data : { *(.cacheline_aligned.data) }
 
   /* rarely changed data like cpu maps */
   . = ALIGN(32);
-  .data.read_mostly : AT(ADDR(.data.read_mostly)) {
-   *(.data.read_mostly)
+  .read_mostly.data : AT(ADDR(.read_mostly.data)) {
+   *(.read_mostly.data)
_edata = .; /* End of data section */
   }
 
   . = ALIGN(THREAD_SIZE);  /* init_task */
-  .data.init_task : { *(.data.init_task) }
+  .init_task.data : { *(.init_task.data) }
 
   /* might get freed after init */
   . = ALIGN(4096);
@@ -128,7 +128,7 @@
 
   . = ALIGN(32);
   __per_cpu_start = .;
-  .data.percpu  : { *(.data.percpu) }
+  .percpu.data  : { *(.percpu.data) }
   __per_cpu_end = .;
   . = ALIGN(4096);
   __init_end = .;
@@ -136,7 +136,7 @@
 
   __bss_start = .; /* BSS */
   .bss : {
-   *(.bss.page_aligned)
+   *(.bss.k.page_aligned)
*(.bss)
   }
   . = ALIGN(4);
--
To unsubscribe from this list: send the line unsubscribe linux-embedded in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 14/23] make section names compatible with -ffunction-sections -fdata-sections: parisc

2008-07-01 Thread Denys Vlasenko
The purpose of this patch is to make kernel buildable
with gcc -ffunction-sections -fdata-sections.
This patch fixes parisc architecture.

Signed-off-by: Denys Vlasenko [EMAIL PROTECTED]
--
vda


--- 0.org/arch/parisc/kernel/head.S Wed Jul  2 00:40:41 2008
+++ 1.fixname/arch/parisc/kernel/head.S Wed Jul  2 00:45:45 2008
@@ -345,7 +345,7 @@
 ENDPROC(stext)
 
 #ifndef CONFIG_64BIT
-   .section .data.read_mostly
+   .section .read_mostly.data
 
.align  4
.export $global$,data
--- 0.org/arch/parisc/kernel/init_task.cWed Jul  2 00:40:41 2008
+++ 1.fixname/arch/parisc/kernel/init_task.cWed Jul  2 00:46:55 2008
@@ -49,7 +49,7 @@
  * init_task linker map entry..
  */
 union thread_union init_thread_union
-   __attribute__((aligned(128))) 
__attribute__((__section__(.data.init_task))) =
+   __attribute__((aligned(128))) 
__attribute__((__section__(.init_task.data))) =
{ INIT_THREAD_INFO(init_task) };
 
 #if PT_NLEVELS == 3
@@ -58,11 +58,11 @@
  * guarantee that global objects will be laid out in memory in the same order 
  * as the order of declaration, so put these in different sections and use
  * the linker script to order them. */
-pmd_t pmd0[PTRS_PER_PMD] __attribute__ ((__section__ (.data.vm0.pmd), 
aligned(PAGE_SIZE)));
+pmd_t pmd0[PTRS_PER_PMD] __attribute__ ((__section__ (.vm0.pmd.data), 
aligned(PAGE_SIZE)));
 #endif
 
-pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__ ((__section__ 
(.data.vm0.pgd), aligned(PAGE_SIZE)));
-pte_t pg0[PT_INITIAL * PTRS_PER_PTE] __attribute__ ((__section__ 
(.data.vm0.pte), aligned(PAGE_SIZE)));
+pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__ ((__section__ 
(.vm0.pgd.data), aligned(PAGE_SIZE)));
+pte_t pg0[PT_INITIAL * PTRS_PER_PTE] __attribute__ ((__section__ 
(.vm0.pte.data), aligned(PAGE_SIZE)));
 
 /*
  * Initial task structure.
--- 0.org/arch/parisc/kernel/vmlinux.lds.S  Wed Jul  2 00:40:41 2008
+++ 1.fixname/arch/parisc/kernel/vmlinux.lds.S  Wed Jul  2 01:02:35 2008
@@ -54,10 +54,10 @@
TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
-   *(.text.do_softirq)
-   *(.text.sys_exit)
-   *(.text.do_sigaltstack)
-   *(.text.do_fork)
+   *(.do_softirq.text)
+   *(.sys_exit.text)
+   *(.do_sigaltstack.text)
+   *(.do_fork.text)
*(.text.*)
*(.fixup)
*(.lock.text)   /* out-of-line lock text */
@@ -95,8 +95,8 @@
 
/* rarely changed data like cpu maps */
. = ALIGN(16);
-   .data.read_mostly : {
-   *(.data.read_mostly)
+   .read_mostly.data : {
+   *(.read_mostly.data)
}
 
. = ALIGN(L1_CACHE_BYTES);
@@ -107,14 +107,14 @@
}
 
. = ALIGN(L1_CACHE_BYTES);
-   .data.cacheline_aligned : {
-   *(.data.cacheline_aligned)
+   .cacheline_aligned.data : {
+   *(.cacheline_aligned.data)
}
 
/* PA-RISC locks requires 16-byte alignment */
. = ALIGN(16);
-   .data.lock_aligned : {
-   *(.data.lock_aligned)
+   .lock_aligned.data : {
+   *(.lock_aligned.data)
}
 
/* nosave data is really only used for software suspend...it's here
@@ -123,7 +123,7 @@
. = ALIGN(PAGE_SIZE);
__nosave_begin = .;
.data_nosave : {
-   *(.data.nosave)
+   *(.nosave.data)
}
. = ALIGN(PAGE_SIZE);
__nosave_end = .;
@@ -135,10 +135,10 @@
__bss_start = .;
/* page table entries need to be PAGE_SIZE aligned */
. = ALIGN(PAGE_SIZE);
-   .data.vmpages : {
-   *(.data.vm0.pmd)
-   *(.data.vm0.pgd)
-   *(.data.vm0.pte)
+   .data.vmpages : { /* TODO: rename .vmpages.data? */
+   *(.vm0.pmd.data)
+   *(.vm0.pgd.data)
+   *(.vm0.pte.data)
}
.bss : {
*(.bss)
@@ -150,8 +150,8 @@
/* assembler code expects init_task to be 16k aligned */
. = ALIGN(16384);
/* init_task */
-   .data.init_task : {
-   *(.data.init_task)
+   .init_task.data : {
+   *(.init_task.data)
}
 
 #ifdef CONFIG_64BIT
--- 0.org/include/asm-parisc/cache.hWed Jul  2 00:40:50 2008
+++ 1.fixname/include/asm-parisc/cache.hWed Jul  2 00:45:45 2008
@@ -28,7 +28,7 @@
 
 #define SMP_CACHE_BYTES L1_CACHE_BYTES
 
-#define __read_mostly __attribute__((__section__(.data.read_mostly)))
+#define __read_mostly __attribute__((__section__(.read_mostly.data)))
 
 void parisc_cache_init(void);  /* initializes cache-flushing */
 void disable_sr_hashing_asm(int); /* low level support for above */
--- 0.org/include/asm-parisc/system.h   Wed Jul  2 00:40:50 2008
+++ 1.fixname/include/asm-parisc/system.h   Wed Jul  2 00:46:14 2008
@@ -174,7 +174,7 @@
 })
 
 #ifdef CONFIG_SMP
-# define 

[PATCH 15/23] make section names compatible with -ffunction-sections -fdata-sections: powerpc

2008-07-01 Thread Denys Vlasenko
The purpose of this patch is to make kernel buildable
with gcc -ffunction-sections -fdata-sections.
This patch fixes powerpc architecture.

Signed-off-by: Denys Vlasenko [EMAIL PROTECTED]
--
vda


--- 0.org/arch/powerpc/kernel/head_32.S Wed Jul  2 00:40:41 2008
+++ 1.fixname/arch/powerpc/kernel/head_32.S Wed Jul  2 00:44:22 2008
@@ -49,7 +49,7 @@
mtspr   SPRN_DBAT##n##L,RB; \
 1:
 
-   .section.text.head, ax
+   .section.head.text, ax
.stabs  arch/powerpc/kernel/,N_SO,0,0,0f
.stabs  head_32.S,N_SO,0,0,0f
 0:
--- 0.org/arch/powerpc/kernel/head_40x.SWed Jul  2 00:40:41 2008
+++ 1.fixname/arch/powerpc/kernel/head_40x.SWed Jul  2 00:44:22 2008
@@ -52,7 +52,7 @@
  *
  * This is all going to change RSN when we add bi_recs...  -- Dan
  */
-   .section.text.head, ax
+   .section.head.text, ax
 _ENTRY(_stext);
 _ENTRY(_start);
 
--- 0.org/arch/powerpc/kernel/head_44x.SWed Jul  2 00:40:41 2008
+++ 1.fixname/arch/powerpc/kernel/head_44x.SWed Jul  2 00:44:22 2008
@@ -50,7 +50,7 @@
  *   r7 - End of kernel command line string
  *
  */
-   .section.text.head, ax
+   .section.head.text, ax
 _ENTRY(_stext);
 _ENTRY(_start);
/*
--- 0.org/arch/powerpc/kernel/head_8xx.SWed Jul  2 00:40:41 2008
+++ 1.fixname/arch/powerpc/kernel/head_8xx.SWed Jul  2 00:44:22 2008
@@ -38,7 +38,7 @@
 #else
 #define DO_8xx_CPU6(val, reg)
 #endif
-   .section.text.head, ax
+   .section.head.text, ax
 _ENTRY(_stext);
 _ENTRY(_start);
 
--- 0.org/arch/powerpc/kernel/head_fsl_booke.S  Wed Jul  2 00:40:41 2008
+++ 1.fixname/arch/powerpc/kernel/head_fsl_booke.S  Wed Jul  2 00:44:22 2008
@@ -52,7 +52,7 @@
  *   r7 - End of kernel command line string
  *
  */
-   .section.text.head, ax
+   .section.head.text, ax
 _ENTRY(_stext);
 _ENTRY(_start);
/*
--- 0.org/arch/powerpc/kernel/init_task.c   Wed Jul  2 00:40:41 2008
+++ 1.fixname/arch/powerpc/kernel/init_task.c   Wed Jul  2 00:45:57 2008
@@ -22,7 +22,7 @@
  * init_task linker map entry..
  */
 union thread_union init_thread_union 
-   __attribute__((__section__(.data.init_task))) =
+   __attribute__((__section__(.init_task.data))) =
{ INIT_THREAD_INFO(init_task) };
 
 /*
--- 0.org/arch/powerpc/kernel/machine_kexec_64.cWed Jul  2 00:40:41 2008
+++ 1.fixname/arch/powerpc/kernel/machine_kexec_64.cWed Jul  2 00:45:57 2008
@@ -250,7 +250,7 @@
  * current, but that audit has not been performed.
  */
 union thread_union kexec_stack
-   __attribute__((__section__(.data.init_task))) = { };
+   __attribute__((__section__(.init_task.data))) = { };
 
 /* Our assembly helper, in kexec_stub.S */
 extern NORET_TYPE void kexec_sequence(void *newstack, unsigned long start,
--- 0.org/arch/powerpc/kernel/vdso.cWed Jul  2 00:40:41 2008
+++ 1.fixname/arch/powerpc/kernel/vdso.cWed Jul  2 00:46:09 2008
@@ -74,7 +74,7 @@
 static union {
struct vdso_datadata;
u8  page[PAGE_SIZE];
-} vdso_data_store __attribute__((__section__(.data.page_aligned)));
+} vdso_data_store __attribute__((__section__(.page_aligned.data)));
 struct vdso_data *vdso_data = vdso_data_store.data;
 
 /* Format of the patch table */
--- 0.org/arch/powerpc/kernel/vdso32/vdso32_wrapper.S   Wed Jul  2 00:40:41 2008
+++ 1.fixname/arch/powerpc/kernel/vdso32/vdso32_wrapper.S   Wed Jul  2 
00:46:09 2008
@@ -1,7 +1,7 @@
 #include linux/init.h
 #include asm/page.h
 
-   .section .data.page_aligned
+   .section .page_aligned.data
 
.globl vdso32_start, vdso32_end
.balign PAGE_SIZE
--- 0.org/arch/powerpc/kernel/vdso64/vdso64_wrapper.S   Wed Jul  2 00:40:41 2008
+++ 1.fixname/arch/powerpc/kernel/vdso64/vdso64_wrapper.S   Wed Jul  2 
00:46:09 2008
@@ -1,7 +1,7 @@
 #include linux/init.h
 #include asm/page.h
 
-   .section .data.page_aligned
+   .section .page_aligned.data
 
.globl vdso64_start, vdso64_end
.balign PAGE_SIZE
--- 0.org/arch/powerpc/kernel/vmlinux.lds.S Wed Jul  2 00:40:41 2008
+++ 1.fixname/arch/powerpc/kernel/vmlinux.lds.S Wed Jul  2 00:54:28 2008
@@ -33,9 +33,9 @@
/* Text and gots */
.text : AT(ADDR(.text) - LOAD_OFFSET) {
ALIGN_FUNCTION();
-   *(.text.head)
+   *(.head.text)
_text = .;
-   *(.text .fixup .text.init.refok .exit.text.refok)
+   *(.text .fixup .init.refok.text .exit.refok.text)
SCHED_TEXT
LOCK_TEXT
KPROBES_TEXT
@@ -144,10 +144,10 @@
}
 #endif
. = ALIGN(PAGE_SIZE);
-   .data.percpu  : AT(ADDR(.data.percpu) - LOAD_OFFSET) {
+   .percpu.data  : AT(ADDR(.percpu.data) - LOAD_OFFSET) {
__per_cpu_start = .;
-   *(.data.percpu)
-   *(.data.percpu.shared_aligned)
+   

[PATCH 18/23] make section names compatible with -ffunction-sections -fdata-sections: sh

2008-07-01 Thread Denys Vlasenko
The purpose of this patch is to make kernel buildable
with gcc -ffunction-sections -fdata-sections.
This patch fixes sh architecture.

Signed-off-by: Denys Vlasenko [EMAIL PROTECTED]
--
vda


--- 0.org/arch/sh/kernel/cpu/sh5/entry.SWed Jul  2 00:40:42 2008
+++ 1.fixname/arch/sh/kernel/cpu/sh5/entry.SWed Jul  2 00:44:28 2008
@@ -2063,10 +2063,10 @@
 
 
 /*
- * --- .text.init Section
+ * --- .init.text Section
  */
 
-   .section.text.init, ax
+   .section.init.text, ax
 
 /*
  * void trap_init (void)
--- 0.org/arch/sh/kernel/head_32.S  Wed Jul  2 00:40:42 2008
+++ 1.fixname/arch/sh/kernel/head_32.S  Wed Jul  2 00:44:22 2008
@@ -40,7 +40,7 @@
 1:
.skip   PAGE_SIZE - empty_zero_page - 1b
 
-   .section.text.head, ax
+   .section.head.text, ax
 
 /*
  * Condition at the entry of _stext:
--- 0.org/arch/sh/kernel/head_64.S  Wed Jul  2 00:40:42 2008
+++ 1.fixname/arch/sh/kernel/head_64.S  Wed Jul  2 00:44:22 2008
@@ -110,7 +110,7 @@
 fpu_in_use:.quad   0
 
 
-   .section.text.head, ax
+   .section.head.text, ax
.balign L1_CACHE_BYTES
 /*
  * Condition at the entry of __stext:
--- 0.org/arch/sh/kernel/init_task.cWed Jul  2 00:40:42 2008
+++ 1.fixname/arch/sh/kernel/init_task.cWed Jul  2 00:45:57 2008
@@ -22,7 +22,7 @@
  * init_task linker map entry..
  */
 union thread_union init_thread_union
-   __attribute__((__section__(.data.init_task))) =
+   __attribute__((__section__(.init_task.data))) =
{ INIT_THREAD_INFO(init_task) };
 
 /*
--- 0.org/arch/sh/kernel/irq.c  Wed Jul  2 00:40:42 2008
+++ 1.fixname/arch/sh/kernel/irq.c  Wed Jul  2 00:47:00 2008
@@ -158,10 +158,10 @@
 
 #ifdef CONFIG_IRQSTACKS
 static char softirq_stack[NR_CPUS * THREAD_SIZE]
-   __attribute__((__section__(.bss.page_aligned)));
+   __attribute__((__section__(.bss.k.page_aligned)));
 
 static char hardirq_stack[NR_CPUS * THREAD_SIZE]
-   __attribute__((__section__(.bss.page_aligned)));
+   __attribute__((__section__(.bss.k.page_aligned)));
 
 /*
  * allocate per-cpu stacks for hardirq and for softirq processing
--- 0.org/arch/sh/kernel/vmlinux_32.lds.S   Wed Jul  2 00:40:42 2008
+++ 1.fixname/arch/sh/kernel/vmlinux_32.lds.S   Wed Jul  2 00:47:00 2008
@@ -28,7 +28,7 @@
} = 0
 
.text : {
-   *(.text.head)
+   *(.head.text)
TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
@@ -59,19 +59,19 @@
 
. = ALIGN(THREAD_SIZE);
.data : {   /* Data */
-   *(.data.init_task)
+   *(.init_task.data)
 
. = ALIGN(L1_CACHE_BYTES);
-   *(.data.cacheline_aligned)
+   *(.cacheline_aligned.data)
 
. = ALIGN(L1_CACHE_BYTES);
-   *(.data.read_mostly)
+   *(.read_mostly.data)
 
. = ALIGN(PAGE_SIZE);
-   *(.data.page_aligned)
+   *(.page_aligned.data)
 
__nosave_begin = .;
-   *(.data.nosave)
+   *(.nosave.data)
. = ALIGN(PAGE_SIZE);
__nosave_end = .;
 
@@ -129,7 +129,7 @@
.bss : {
__init_end = .;
__bss_start = .;/* BSS */
-   *(.bss.page_aligned)
+   *(.bss.k.page_aligned)
*(.bss)
*(COMMON)
. = ALIGN(4);
--- 0.org/arch/sh/kernel/vmlinux_64.lds.S   Wed Jul  2 00:40:42 2008
+++ 1.fixname/arch/sh/kernel/vmlinux_64.lds.S   Wed Jul  2 00:47:00 2008
@@ -42,7 +42,7 @@
} = 0
 
.text : C_PHYS(.text) {
-   *(.text.head)
+   *(.head.text)
TEXT_TEXT
*(.text64)
*(.text..SHmedia32)
@@ -71,19 +71,19 @@
 
. = ALIGN(THREAD_SIZE);
.data : C_PHYS(.data) { /* Data */
-   *(.data.init_task)
+   *(.init_task.data)
 
. = ALIGN(L1_CACHE_BYTES);
-   *(.data.cacheline_aligned)
+   *(.cacheline_aligned.data)
 
. = ALIGN(L1_CACHE_BYTES);
-   *(.data.read_mostly)
+   *(.read_mostly.data)
 
. = ALIGN(PAGE_SIZE);
-   *(.data.page_aligned)
+   *(.page_aligned.data)
 
__nosave_begin = .;
-   *(.data.nosave)
+   *(.nosave.data)
. = ALIGN(PAGE_SIZE);
__nosave_end = .;
 
@@ -141,7 +141,7 @@
.bss : C_PHYS(.bss) {
__init_end = .;
__bss_start = .;/* BSS */
-   *(.bss.page_aligned)
+   *(.bss.k.page_aligned)
*(.bss)
*(COMMON)
. = ALIGN(4);
--- 0.org/include/asm-sh/cache.hWed Jul  2 00:40:50 2008
+++ 

[PATCH 19/23] make section names compatible with -ffunction-sections -fdata-sections: sparc

2008-07-01 Thread Denys Vlasenko
The purpose of this patch is to make kernel buildable
with gcc -ffunction-sections -fdata-sections.
This patch fixes sparc architecture.

Signed-off-by: Denys Vlasenko [EMAIL PROTECTED]
--
vda


--- 0.org/arch/sparc/boot/btfixupprep.c Wed Jul  2 00:40:42 2008
+++ 1.fixname/arch/sparc/boot/btfixupprep.c Wed Jul  2 00:45:57 2008
@@ -171,7 +171,7 @@
}
} else if (buffer[nbase+4] != '_')
continue;
-   if (!strcmp (sect, .text.exit))
+   if (!strcmp (sect, .exit.text))
continue;
if (strcmp (sect, .text) 
strcmp (sect, .init.text) 
@@ -325,7 +325,7 @@
(*rr)-next = NULL;
}
printf(! Generated by btfixupprep. Do not edit.\n\n);
-   printf(\t.section\t\.data.init\,#alloc,#write\n\t.align\t4\n\n);
+   printf(\t.section\t\.init.data\,#alloc,#write\n\t.align\t4\n\n);
printf(\t.global\t___btfixup_start\n___btfixup_start:\n\n);
for (i = 0; i  last; i++) {
f = array + i;
--- 0.org/arch/sparc/kernel/head.S  Wed Jul  2 00:40:42 2008
+++ 1.fixname/arch/sparc/kernel/head.S  Wed Jul  2 00:44:28 2008
@@ -742,7 +742,7 @@
 nop
 
 /* The code above should be at beginning and we have to take care about
- * short jumps, as branching to .text.init section from .text is usually
+ * short jumps, as branching to .init.text section from .text is usually
  * impossible */
__INIT
 /* Acquire boot time privileged register values, this will help debugging.
--- 0.org/arch/sparc/kernel/vmlinux.lds.S   Wed Jul  2 00:40:42 2008
+++ 1.fixname/arch/sparc/kernel/vmlinux.lds.S   Wed Jul  2 00:45:51 2008
@@ -86,12 +86,12 @@
. = ALIGN(PAGE_SIZE);
__init_end = .;
. = ALIGN(32);
-   .data.cacheline_aligned : {
-   *(.data.cacheline_aligned)
+   .cacheline_aligned.data : {
+   *(.cacheline_aligned.data)
}
. = ALIGN(32);
-   .data.read_mostly : {
-   *(.data.read_mostly)
+   .read_mostly.data : {
+   *(.read_mostly.data)
}
 
__bss_start = .;
--- 0.org/arch/sparc64/kernel/head.SWed Jul  2 00:40:42 2008
+++ 1.fixname/arch/sparc64/kernel/head.SWed Jul  2 00:44:28 2008
@@ -466,7 +466,7 @@
jmpl%g2 + %g0, %g0
 nop
 
-   .section.text.init.refok
+   .section.init.refok.text
 sun4u_init:
BRANCH_IF_SUN4V(g1, sun4v_init)
 
--- 0.org/arch/sparc64/kernel/vmlinux.lds.S Wed Jul  2 00:40:42 2008
+++ 1.fixname/arch/sparc64/kernel/vmlinux.lds.S Wed Jul  2 00:45:51 2008
@@ -32,12 +32,12 @@
*(.data1)
}
. = ALIGN(64);
-   .data.cacheline_aligned : {
-   *(.data.cacheline_aligned)
+   .cacheline_aligned.data : {
+   *(.cacheline_aligned.data)
}
. = ALIGN(64);
-   .data.read_mostly : {
-   *(.data.read_mostly)
+   .read_mostly.data : {
+   *(.read_mostly.data)
}
_edata = .;
PROVIDE (edata = .);
--- 0.org/include/asm-sparc/cache.h Wed Jul  2 00:40:51 2008
+++ 1.fixname/include/asm-sparc/cache.h Wed Jul  2 00:45:45 2008
@@ -19,7 +19,7 @@
 
 #define SMP_CACHE_BYTES (1  SMP_CACHE_BYTES_SHIFT)
 
-#define __read_mostly __attribute__((__section__(.data.read_mostly)))
+#define __read_mostly __attribute__((__section__(.read_mostly.data)))
 
 #ifdef CONFIG_SPARC32
 #include asm/asi.h
--
To unsubscribe from this list: send the line unsubscribe linux-embedded in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 21/23] make section names compatible with -ffunction-sections -fdata-sections: v850

2008-07-01 Thread Denys Vlasenko
The purpose of this patch is to make kernel buildable
with gcc -ffunction-sections -fdata-sections.
This patch fixes v850 architecture.

Signed-off-by: Denys Vlasenko [EMAIL PROTECTED]
--
vda


--- 0.org/arch/v850/kernel/init_task.c  Wed Jul  2 00:40:42 2008
+++ 1.fixname/arch/v850/kernel/init_task.c  Wed Jul  2 00:45:57 2008
@@ -44,5 +44,5 @@
  * init_task linker map entry.
  */
 union thread_union init_thread_union 
-   __attribute__((__section__(.data.init_task))) =
+   __attribute__((__section__(.init_task.data))) =
{ INIT_THREAD_INFO(init_task) };
--- 0.org/arch/v850/kernel/vmlinux.lds.SWed Jul  2 00:40:42 2008
+++ 1.fixname/arch/v850/kernel/vmlinux.lds.SWed Jul  2 00:46:26 2008
@@ -95,8 +95,8 @@
TEXT_TEXT \
SCHED_TEXT\
*(.exit.text)   /* 2.5 convention */  \
-   *(.text.exit)   /* 2.4 convention */  \
-   *(.text.lock) \
+   *(.exit.text)   /* 2.4 convention */  \
+   *(.lock.text) \
*(.exitcall.exit) \
__real_etext = . ;  /* There may be data after here.  */  \
RODATA_CONTENTS   \
@@ -115,11 +115,11 @@
__sdata = . ; \
DATA_DATA \
EXIT_DATA   /* 2.5 convention */  \
-   *(.data.exit)   /* 2.4 convention */  \
+   *(.exit.data)   /* 2.4 convention */  \
. = ALIGN (16) ;  \
-   *(.data.cacheline_aligned)\
+   *(.cacheline_aligned.data)\
. = ALIGN (0x2000) ;  \
-   *(.data.init_task)\
+   *(.init_task.data)\
. = ALIGN (0x2000) ;  \
__edata = . ;
 
@@ -160,8 +160,8 @@
INIT_TEXT   /* 2.5 convention */  \
__einittext = .;  \
INIT_DATA \
-   *(.text.init)   /* 2.4 convention */  \
-   *(.data.init) \
+   *(.init.text)   /* 2.4 convention */  \
+   *(.init.data) \
INITCALL_CONTENTS \
INITRAMFS_CONTENTS
 
@@ -171,7 +171,7 @@
. = ALIGN (4096) ;\
__init_start = . ;\
INIT_DATA   /* 2.5 convention */  \
-   *(.data.init)   /* 2.4 convention */  \
+   *(.init.data)   /* 2.4 convention */  \
__init_end = . ;  \
. = ALIGN (4096) ;
 
@@ -181,7 +181,7 @@
_sinittext = .;   \
INIT_TEXT   /* 2.5 convention */  \
_einittext = .;   \
-   *(.text.init)   /* 2.4 convention */  \
+   *(.init.text)   /* 2.4 convention */  \
INITCALL_CONTENTS \
INITRAMFS_CONTENTS
 
--
To unsubscribe from this list: send the line unsubscribe linux-embedded in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 22/23] make section names compatible with -ffunction-sections -fdata-sections: x86

2008-07-01 Thread Denys Vlasenko
The purpose of this patch is to make kernel buildable
with gcc -ffunction-sections -fdata-sections.
This patch fixes x86 architecture.

Signed-off-by: Denys Vlasenko [EMAIL PROTECTED]
--
vda


--- 0.org/arch/x86/boot/compressed/head_32.SWed Jul  2 00:40:42 2008
+++ 1.fixname/arch/x86/boot/compressed/head_32.SWed Jul  2 00:44:22 2008
@@ -29,7 +29,7 @@
 #include asm/boot.h
 #include asm/asm-offsets.h
 
-.section .text.head,ax,@progbits
+.section .head.text,ax,@progbits
.globl startup_32
 
 startup_32:
--- 0.org/arch/x86/boot/compressed/head_64.SWed Jul  2 00:40:42 2008
+++ 1.fixname/arch/x86/boot/compressed/head_64.SWed Jul  2 00:44:22 2008
@@ -32,7 +32,7 @@
 #include asm/msr.h
 #include asm/asm-offsets.h
 
-.section .text.head
+.section .head.text
.code32
.globl startup_32
 
--- 0.org/arch/x86/boot/compressed/vmlinux_32.lds   Wed Jul  2 00:40:42 2008
+++ 1.fixname/arch/x86/boot/compressed/vmlinux_32.lds   Wed Jul  2 00:44:22 2008
@@ -7,9 +7,9 @@
 * address 0.
 */
. = 0;
-   .text.head : {
+   .head.text : {
_head = . ;
-   *(.text.head)
+   *(.head.text)
_ehead = . ;
}
.rodata.compressed : {
--- 0.org/arch/x86/boot/compressed/vmlinux_64.lds   Wed Jul  2 00:40:42 2008
+++ 1.fixname/arch/x86/boot/compressed/vmlinux_64.lds   Wed Jul  2 00:44:22 2008
@@ -7,9 +7,9 @@
 * address 0.
 */
. = 0;
-   .text.head : {
+   .head.text : {
_head = . ;
-   *(.text.head)
+   *(.head.text)
_ehead = . ;
}
.rodata.compressed : {
--- 0.org/arch/x86/kernel/acpi/wakeup_32.S  Wed Jul  2 00:40:42 2008
+++ 1.fixname/arch/x86/kernel/acpi/wakeup_32.S  Wed Jul  2 00:56:50 2008
@@ -1,4 +1,4 @@
-   .section .text.page_aligned
+   .section .page_aligned.text
 #include linux/linkage.h
 #include asm/segment.h
 #include asm/page.h
--- 0.org/arch/x86/kernel/head_32.S Wed Jul  2 00:40:42 2008
+++ 1.fixname/arch/x86/kernel/head_32.S Wed Jul  2 00:47:00 2008
@@ -81,7 +81,7 @@
  * any particular GDT layout, because we load our own as soon as we
  * can.
  */
-.section .text.head,ax,@progbits
+.section .head.text,ax,@progbits
 ENTRY(startup_32)
/* test KEEP_SEGMENTS flag to see if the bootloader is asking
us to not reload segments */
@@ -602,7 +602,7 @@
 /*
  * BSS section
  */
-.section .bss.page_aligned,wa
+.section .bss.k.page_aligned,wa
.align PAGE_SIZE_asm
 #ifdef CONFIG_X86_PAE
 swapper_pg_pmd:
@@ -619,7 +619,7 @@
  * This starts the data section.
  */
 #ifdef CONFIG_X86_PAE
-.section .data.page_aligned,wa
+.section .page_aligned.data,wa
/* Page-aligned for the benefit of paravirt? */
.align PAGE_SIZE_asm
 ENTRY(swapper_pg_dir)
--- 0.org/arch/x86/kernel/head_64.S Wed Jul  2 00:40:42 2008
+++ 1.fixname/arch/x86/kernel/head_64.S Wed Jul  2 00:47:00 2008
@@ -32,7 +32,7 @@
  */
 
.text
-   .section .text.head
+   .section .head.text
.code64
.globl startup_64
 startup_64:
@@ -416,7 +416,7 @@
  * Also sysret mandates a special GDT layout 
  */

-   .section .data.page_aligned, aw
+   .section .page_aligned.data, aw
.align PAGE_SIZE
 
 /* The TLS descriptors are currently at a different place compared to i386.
@@ -448,7 +448,7 @@
 ENTRY(idt_table)
.skip 256 * 16
 
-   .section .bss.page_aligned, aw, @nobits
+   .section .bss.k.page_aligned, aw, @nobits
.align PAGE_SIZE
 ENTRY(empty_zero_page)
.skip PAGE_SIZE
--- 0.org/arch/x86/kernel/init_task.c   Wed Jul  2 00:40:42 2008
+++ 1.fixname/arch/x86/kernel/init_task.c   Wed Jul  2 00:45:57 2008
@@ -24,7 +24,7 @@
  * init_task linker map entry..
  */
 union thread_union init_thread_union
-   __attribute__((__section__(.data.init_task))) =
+   __attribute__((__section__(.init_task.data))) =
{ INIT_THREAD_INFO(init_task) };
 
 /*
@@ -38,7 +38,7 @@
 /*
  * per-CPU TSS segments. Threads are completely 'soft' on Linux,
  * no more per-task TSS's. The TSS size is kept cacheline-aligned
- * so they are allowed to end up in the .data.cacheline_aligned
+ * so they are allowed to end up in the .cacheline_aligned.data
  * section. Since TSS's are completely CPU-local, we want them
  * on exact cacheline boundaries, to eliminate cacheline ping-pong.
  */
--- 0.org/arch/x86/kernel/irq_32.c  Wed Jul  2 00:40:42 2008
+++ 1.fixname/arch/x86/kernel/irq_32.c  Wed Jul  2 00:47:00 2008
@@ -148,10 +148,10 @@
 #ifdef CONFIG_4KSTACKS
 
 static char softirq_stack[NR_CPUS * THREAD_SIZE]
-   __attribute__((__section__(.bss.page_aligned)));
+   __attribute__((__section__(.bss.k.page_aligned)));
 
 static char hardirq_stack[NR_CPUS * THREAD_SIZE]
-   __attribute__((__section__(.bss.page_aligned)));
+   

[PATCH 23/23] make section names compatible with -ffunction-sections -fdata-sections: xtensa

2008-07-01 Thread Denys Vlasenko
The purpose of this patch is to make kernel buildable
with gcc -ffunction-sections -fdata-sections.
This patch fixes xtensa architecture.

Signed-off-by: Denys Vlasenko [EMAIL PROTECTED]
--
vda


--- 0.org/arch/xtensa/kernel/head.S Wed Jul  2 00:40:43 2008
+++ 1.fixname/arch/xtensa/kernel/head.S Wed Jul  2 00:47:00 2008
@@ -234,7 +234,7 @@
  * BSS section
  */

-.section .bss.page_aligned, w
+.section .bss.k.page_aligned, w
 ENTRY(swapper_pg_dir)
.fill   PAGE_SIZE, 1, 0
 ENTRY(empty_zero_page)
--- 0.org/arch/xtensa/kernel/init_task.cWed Jul  2 00:40:43 2008
+++ 1.fixname/arch/xtensa/kernel/init_task.cWed Jul  2 00:45:57 2008
@@ -29,7 +29,7 @@
 EXPORT_SYMBOL(init_mm);
 
 union thread_union init_thread_union
-   __attribute__((__section__(.data.init_task))) =
+   __attribute__((__section__(.init_task.data))) =
 { INIT_THREAD_INFO(init_task) };
 
 struct task_struct init_task = INIT_TASK(init_task);
--- 0.org/arch/xtensa/kernel/vmlinux.lds.S  Wed Jul  2 00:40:43 2008
+++ 1.fixname/arch/xtensa/kernel/vmlinux.lds.S  Wed Jul  2 00:47:00 2008
@@ -121,14 +121,14 @@
 DATA_DATA
 CONSTRUCTORS
 . = ALIGN(XCHAL_ICACHE_LINESIZE);
-*(.data.cacheline_aligned)
+*(.cacheline_aligned.data)
   }
 
   _edata = .;
 
   /* The initial task */
   . = ALIGN(8192);
-  .data.init_task : { *(.data.init_task) }
+  .init_task.data : { *(.init_task.data) }
 
   /* Initialization code and data: */
 
@@ -259,7 +259,7 @@
 
   /* BSS section */
   _bss_start = .;
-  .bss : { *(.bss.page_aligned) *(.bss) }
+  .bss : { *(.bss.k.page_aligned) *(.bss) }
   _bss_end = .;
 
   _end = .;
--- 0.org/include/asm-frv/init.hWed Jul  2 00:40:50 2008
+++ 1.fixname/include/asm-frv/init.hWed Jul  2 00:45:57 2008
@@ -1,12 +1,12 @@
 #ifndef _ASM_INIT_H
 #define _ASM_INIT_H
 
-#define __init __attribute__ ((__section__ (.text.init)))
-#define __initdata __attribute__ ((__section__ (.data.init)))
+#define __init __attribute__ ((__section__ (.init.text)))
+#define __initdata __attribute__ ((__section__ (.init.data)))
 /* For assembly routines */
-#define __INIT .section.text.init,#alloc,#execinstr
+#define __INIT .section.init.text,#alloc,#execinstr
 #define __FINIT.previous
-#define __INITDATA .section.data.init,#alloc,#write
+#define __INITDATA .section.init.data,#alloc,#write
 
 #endif
 
--
To unsubscribe from this list: send the line unsubscribe linux-embedded in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/23] make section names compatible with -ffunction-sections -fdata-sections: blackfin

2008-07-01 Thread Mike Frysinger
On Tue, Jul 1, 2008 at 8:35 PM, Denys Vlasenko wrote:
 The purpose of this patch is to make kernel buildable
 with gcc -ffunction-sections -fdata-sections.
 This patch fixes blackfin architecture.

the comment right above what you changed says it already works for
Blackfin.  so you arent fixing it at all.
/* This gets done first, so the glob doesn't suck it in */
. = ALIGN(32);
 -   *(.data.cacheline_aligned)
 +   *(.cacheline_aligned.data)

ive built Blackfin kernels with function/data sections a long time ago
... but iirc, there were toolchain problems, so i havent pursued it
since.

if you're going to muck with names, you might as well do it right the
first time: move the names into asm-generic/vmlinux.lds.h so we dont
have to worry about this kind of churn again.
-mike
--
To unsubscribe from this list: send the line unsubscribe linux-embedded in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/23] make section names compatible with -ffunction-sections -fdata-sections

2008-07-01 Thread Valdis . Kletnieks
On Wed, 02 Jul 2008 02:33:48 +0200, Denys Vlasenko said:

 The purpose of these patches is to make kernel buildable
 with gcc -ffunction-sections -fdata-sections.
 
 Newer gcc and binutils can do dead code and data removal
 at link time. It is achieved using combination of
 -ffunction-sections -fdata-sections options for gcc and
 --gc-sections for ld.

Interesting idea.  Do you happen to have before-and-after 'size vmlinux'
numbers to show how much space is actually reclaimed?


pgpoSIiQT4Jow.pgp
Description: PGP signature


Re: [PATCH v4 2/6] dmaengine: Add dma_chan_is_in_use() function

2008-07-01 Thread Dan Williams
On Tue, Jul 1, 2008 at 6:31 PM, Dan Williams [EMAIL PROTECTED] wrote:
 On Thu, Jun 26, 2008 at 6:23 AM, Haavard Skinnemoen
 [EMAIL PROTECTED] wrote:
 This moves the code checking if a DMA channel is in use from
 show_in_use() into an inline helper function, dma_is_in_use(). DMA
 controllers can use this in order to give clients exclusive access to
 channels (usually necessary when setting up slave DMA.)

 I have to admit that I don't really understand the channel refcounting
 logic at all... dma_chan_get() simply increments a per-cpu value. How
 can we be sure that whatever CPU calls dma_chan_is_in_use() sees the
 same value?

 As Chris noted in the comments at the top of dmaengine.c this is an
 implementation Rusty's 'bigref'.  It seeks to avoid the
 cache-line-bouncing overhead of maintaining a single global refcount
 in hot paths like tcp_v{4,6}_rcv().  When the channel is being
 removed, a rare event, we transition to the accurate, yet slow, global
 method.

 Your observation is correct, dma_chan_is_in_use() may lie in the case
 when the current cpu is not using the channel.  For this particular
 test I think you can look to see if this channel's resources are
 already allocated.  If they are then some other client got a hold of
 this channel before the current attempt.  Hmm... that would also
 require that we free the channel's resources in the case where the
 client replies with DMA_NAK, probably something we should do anyways.

 Thoughts?


Actually we will probably need something like the following.
-client_count is protected by the dma_list_mutex.

diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
index 99c22b4..10de69e 100644
--- a/drivers/dma/dmaengine.c
+++ b/drivers/dma/dmaengine.c
@@ -183,9 +183,10 @@ static void dma_client_chan_alloc(struct
dma_client *client)
/* we are done once this client rejects
 * an available resource
 */
-   if (ack == DMA_ACK)
+   if (ack == DMA_ACK) {
dma_chan_get(chan);
-   else if (ack == DMA_NAK)
+   chan-client_count++;
+   } else if (ack == DMA_NAK)
return;
}
}
@@ -272,8 +273,10 @@ static void dma_clients_notify_removed(struct
dma_chan *chan)
/* client was holding resources for this channel so
 * free it
 */
-   if (ack == DMA_ACK)
+   if (ack == DMA_ACK) {
dma_chan_put(chan);
+   chan-client_count--;
+   }
}

mutex_unlock(dma_list_mutex);
@@ -313,8 +316,10 @@ void dma_async_client_unregister(struct dma_client *client)
ack = client-event_callback(client, chan,
DMA_RESOURCE_REMOVED);

-   if (ack == DMA_ACK)
+   if (ack == DMA_ACK) {
dma_chan_put(chan);
+   chan-client_count--;
+   }
}

list_del(client-global_node);
@@ -394,6 +399,7 @@ int dma_async_device_register(struct dma_device *device)
kref_get(device-refcount);
kref_get(device-refcount);
kref_init(chan-refcount);
+   chan-client_count = 0;
chan-slow_ref = 0;
INIT_RCU_HEAD(chan-rcu);
}
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index d08a5c5..6432b83 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -139,6 +139,7 @@ struct dma_chan_percpu {
  * @rcu: the DMA channel's RCU head
  * @device_node: used to add this to the device chan list
  * @local: per-cpu pointer to a struct dma_chan_percpu
+ * @client-count: how many clients are using this channel
  */
 struct dma_chan {
struct dma_device *device;
@@ -154,6 +155,7 @@ struct dma_chan {

struct list_head device_node;
struct dma_chan_percpu *local;
+   int client_count;
 };

 #define to_dma_chan(p) container_of(p, struct dma_chan, dev)
--
To unsubscribe from this list: send the line unsubscribe linux-embedded in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/23] make section names compatible with -ffunction-sections -fdata-sections: blackfin

2008-07-01 Thread Mike Frysinger
On Tue, Jul 1, 2008 at 8:08 PM, Denys Vlasenko wrote:
 On Wednesday 02 July 2008 00:58, Mike Frysinger wrote:
 On Tue, Jul 1, 2008 at 8:35 PM, Denys Vlasenko wrote:
  The purpose of this patch is to make kernel buildable
  with gcc -ffunction-sections -fdata-sections.
  This patch fixes blackfin architecture.

 the comment right above what you changed says it already works for
 Blackfin.  so you arent fixing it at all.
 /* This gets done first, so the glob doesn't suck it in */
 . = ALIGN(32);
  -   *(.data.cacheline_aligned)
  +   *(.cacheline_aligned.data)

 This may pull in an unrelated data object named cacheline_aligned
 (say, a static variable in a driver). If that variable is not
 itself aligned to the cacheline size, it will mess up alignment of all
 objects in .data.cacheline_aligned which follow. Not good.

 To be safe from such weird and hard to debug problems
 it's better to not use names like .data. at all.
 I just uniformly renamed al such special sections
 in the kernel to .X.data

you're right of course ... i obviously hadnt thought of this.  please
however still abstract this stuff into the common header.

i just tested the current Blackfin kernel and it does build/link/run
fine with -ffunction-sections/-fdata-sections.  however, --gc-sections
still causes crashes (but this is because all of the .init.setup
sections are flagged as unused).
-mike
--
To unsubscribe from this list: send the line unsubscribe linux-embedded in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html