[lkml]   [1996]   [Jun]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectDriver optimization.

I was reading some NT sources (No, please don't shoot me :-), and
found something that Linux should've had for quite a while now.

Initialization code is interspersed with the actual driver code.
I think that the phrase

#pragma alloc_text(INIT,ParInitializeDeviceObject)

in then NT sources means that the routine ParInitializeDeviceObject
will be allocated in a special segment called "INIT".

If strict (*) rules about these are kept, we could even free the
memory associated with initializing the system...... Otherwise,
having them together increases cache performance.

Ideally gcc should grok an #pragma similar to the MSC compiler above.
Otherwise an "asm" statement could be inserted before and after
init routines to switch to a different segement. The problem with
this approach is that a string in the routine causes an
.section .rodata
.string "this is the string
to be emitted just before the function, undoing the simple
asm (".section .init");
A way around this needs to be found.
In ELF lots of segments get mapped the same as .text, ".init" is
indeed one of them, so if you don't want to go and edit binutils, you
could just use one of those (I don't know if ".init" is already used).

This could go on the "wishlist for 2.1" and/or someone could pick
it up.....

Roger Wolff.

(*) i.e. don't call the init routine again when a full reset is
invoked or something like that...... :-)

 \ /
  Last update: 2005-03-22 13:37    [from the cache]
©2003-2011 Jasper Spaans