public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* pointer to .subsection and .previous usage in kernel?
@ 2003-02-27 14:58 Steve Kenton
  2003-02-27 15:46 ` Richard B. Johnson
  0 siblings, 1 reply; 4+ messages in thread
From: Steve Kenton @ 2003-02-27 14:58 UTC (permalink / raw)
  To: lkml

Anyone have a pointer to what we are really trying to accomplish
with .subsection and .previous in the in-line and asm stuff?

Like maybe a readme or coding style doc for in-line and asm code?

That was the main thing I tripped over while trying to build
a 2.5 kernel using the cygwin toolchain with an eye towards
uml under windows.  I found very little documentation about
the directives themselves even in the gnu info stuff and nada,
except one thread about abstracting them in spinlocks,
bout how/why they are used in the kernel.  They appear to be
elf specific which is why the i386pe stuff puked on them.  I
assume that most of this is to maximize cache hits, but that's
just a guess.  There are a largish handful of them scattered
around the kernel outside of locks. Any pointers would be appreciated.

Steve

^ permalink raw reply	[flat|nested] 4+ messages in thread
* Re: pointer to .subsection and .previous usage in kernel?
@ 2003-02-27 22:20 Steve Kenton
  0 siblings, 0 replies; 4+ messages in thread
From: Steve Kenton @ 2003-02-27 22:20 UTC (permalink / raw)
  To: lkml

Actually, I was following up on some pointers from Jeff Dike on the
User Mode Linux home page about possibly running UML in a windows environment.
Jeff says that SMP has worked in the past and will again in the future
so I'm pretty sure that spinlocks will be needed ...

As a first pass to see where the problems were located I tried to build a
'host' kernel for i386 using the cygwin tool chain.  That version of gcc produces
i386pe format output instead of elf which triggered the problem with .subsection
not being a recognized gas directive.  I understand that .subsections force
things to be closely located within a section when there is no other logical
association and that they are not visible to the the linker which only deals with
sections.  They only reason *I *can see for this is to improve cache hits but
I'm just guessing, hence the question.

FYI, by hacking out the .subsection/.previous directive I was able to build a
vmlinux for 2.5.59 using the cygwin tool chain under windows.  Obviously it is
not useful as is, but there seem to be relatively few syntax and toolchain
problems to deal with.  Hopefully the hard part of an actual UML port to windows
can be snarfed from the LINE project.  Again based on a pointer from Jeff Dike.

Anyway, I'm just trying to get up to speed and was wondering *WHY* things are
done that way.  Most of the in-line and asm stuff still looks like voodoo to me.
The .subsection/.previous just looks like a little blacker magic than normal.

Steve
 
>If you are writing code under cygwin, you should not be encountering
>spin-locks and kernel-specific things. Perhaps you are including
>>the wrong header files? You should never do:
>
>        #include <linux/xxx.h>
>        #include <asm/xxx.h>
>
>... unless you are writing modules. And you don't do that in cygwin.
>
>
>Cheers,
>Dick Johnson
>Penguin : Linux version 2.4.18 on an i686 machine (797.90 BogoMips).
>Why is the government concerned about the lunatic fringe? Think about it.

^ permalink raw reply	[flat|nested] 4+ messages in thread
* Re: pointer to .subsection and .previous usage in kernel?
@ 2003-02-28 15:59 Jeff Dike
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff Dike @ 2003-02-28 15:59 UTC (permalink / raw)
  To: Steve Kenton; +Cc: linux-kernel

> Hopefully the hard part of an actual UML port to windows
> can be snarfed from the LINE project.

Check out umlwin32.sf.net.  That's a mostly-working port of UML to Windows.

				Jeff


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

end of thread, other threads:[~2003-02-28 15:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-27 14:58 pointer to .subsection and .previous usage in kernel? Steve Kenton
2003-02-27 15:46 ` Richard B. Johnson
  -- strict thread matches above, loose matches on Subject: below --
2003-02-27 22:20 Steve Kenton
2003-02-28 15:59 Jeff Dike

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