All of lore.kernel.org
 help / color / mirror / Atom feed
* realmode _WAKEUP
@ 2015-01-07 14:12 Alexander Kuleshov
  2015-01-07 16:54 ` Paul Bolle
  0 siblings, 1 reply; 9+ messages in thread
From: Alexander Kuleshov @ 2015-01-07 14:12 UTC (permalink / raw)
  To: kernelnewbies

Hello all,

There is following definition at arch/x86/realmode/rm/Makefile:

KBUILD_CFLAGS    := $(LINUXINCLUDE) $(REALMODE_CFLAGS) -D_SETUP -D_WAKEUP \
           -I$(srctree)/arch/x86/boot

Is it used now? I'm asking because _WAKEUP definition everywhere
undefined in the code.

Thank you.

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

* realmode _WAKEUP
  2015-01-07 14:12 realmode _WAKEUP Alexander Kuleshov
@ 2015-01-07 16:54 ` Paul Bolle
  2015-01-07 17:13   ` Paul Bolle
  2015-01-07 17:59   ` Alexander Kuleshov
  0 siblings, 2 replies; 9+ messages in thread
From: Paul Bolle @ 2015-01-07 16:54 UTC (permalink / raw)
  To: kernelnewbies

On Wed, 2015-01-07 at 20:12 +0600, Alexander Kuleshov wrote:
> There is following definition at arch/x86/realmode/rm/Makefile:
> 
> KBUILD_CFLAGS    := $(LINUXINCLUDE) $(REALMODE_CFLAGS) -D_SETUP -D_WAKEUP \
>            -I$(srctree)/arch/x86/boot
> 
> Is it used now? I'm asking because _WAKEUP definition everywhere
> undefined in the code.

git grep tells me:
    $ git grep -n "_WAKEUP\b" arch/x86
    arch/x86/boot/video-bios.c:51:#ifndef _WAKEUP
    arch/x86/boot/video-bios.c:66:#ifdef _WAKEUP
    arch/x86/boot/video-mode.c:169:#ifndef _WAKEUP
    arch/x86/boot/video-vesa.c:27:#ifndef _WAKEUP
    arch/x86/boot/video-vesa.c:29:#else /* _WAKEUP */
    arch/x86/boot/video-vesa.c:31:#endif /* _WAKEUP */
    arch/x86/boot/video-vesa.c:160:#ifndef _WAKEUP
    arch/x86/boot/video-vesa.c:272:#endif /* not _WAKEUP */
    arch/x86/boot/video-vga.c:257:#ifndef _WAKEUP
    arch/x86/boot/video-vga.c:269:#ifndef _WAKEUP

And in that Makefile we also see, a few lines up:
    wakeup-objs     := [...] video-mode.o
    [...]
    wakeup-objs     += video-vga.o
    wakeup-objs     += video-vesa.o
    wakeup-objs     += video-bios.o

So this Makefile line defines a _WAKEUP macro that is, it seems, used
for the build of those four object files. (It's bit more complicated
than that. But I think KBUILD_CFLAGS is explained in Documentation/,
isn't it?)

Hope this helps,


Paul Bolle

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

* realmode _WAKEUP
  2015-01-07 16:54 ` Paul Bolle
@ 2015-01-07 17:13   ` Paul Bolle
  2015-01-07 17:59   ` Alexander Kuleshov
  1 sibling, 0 replies; 9+ messages in thread
From: Paul Bolle @ 2015-01-07 17:13 UTC (permalink / raw)
  To: kernelnewbies

On Wed, 2015-01-07 at 17:54 +0100, Paul Bolle wrote:
> On Wed, 2015-01-07 at 20:12 +0600, Alexander Kuleshov wrote:
> > There is following definition at arch/x86/realmode/rm/Makefile:
> > 
> > KBUILD_CFLAGS    := $(LINUXINCLUDE) $(REALMODE_CFLAGS) -D_SETUP -D_WAKEUP \
> >            -I$(srctree)/arch/x86/boot
> > 
> > Is it used now? I'm asking because _WAKEUP definition everywhere
> > undefined in the code.
> 
> git grep tells me:
>     $ git grep -n "_WAKEUP\b" arch/x86
>     arch/x86/boot/video-bios.c:51:#ifndef _WAKEUP
>     arch/x86/boot/video-bios.c:66:#ifdef _WAKEUP
>     arch/x86/boot/video-mode.c:169:#ifndef _WAKEUP
>     arch/x86/boot/video-vesa.c:27:#ifndef _WAKEUP
>     arch/x86/boot/video-vesa.c:29:#else /* _WAKEUP */
>     arch/x86/boot/video-vesa.c:31:#endif /* _WAKEUP */
>     arch/x86/boot/video-vesa.c:160:#ifndef _WAKEUP
>     arch/x86/boot/video-vesa.c:272:#endif /* not _WAKEUP */
>     arch/x86/boot/video-vga.c:257:#ifndef _WAKEUP
>     arch/x86/boot/video-vga.c:269:#ifndef _WAKEUP
> 
> And in that Makefile we also see, a few lines up:
>     wakeup-objs     := [...] video-mode.o
>     [...]
>     wakeup-objs     += video-vga.o
>     wakeup-objs     += video-vesa.o
>     wakeup-objs     += video-bios.o
> 
> So this Makefile line defines a _WAKEUP macro that is, it seems, used
> for the build of those four object files. (It's bit more complicated
> than that. But I think KBUILD_CFLAGS is explained in Documentation/,
> isn't it?)

Actually, that doesn't fully explain those wakeup-objs. Because you also
need to look at this:
    arch/x86/realmode/rm/video-bios.c:1:#include "../../boot/video-bios.c"
    arch/x86/realmode/rm/video-mode.c:1:#include "../../boot/video-mode.c"
    arch/x86/realmode/rm/video-vesa.c:1:#include "../../boot/video-vesa.c"
    arch/x86/realmode/rm/video-vga.c:1:#include "../../boot/video-vga.c"

And that is the _entire_ content of those files. Rather hackish, but it
apparently works.


Paul Bolle

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

* realmode _WAKEUP
  2015-01-07 16:54 ` Paul Bolle
  2015-01-07 17:13   ` Paul Bolle
@ 2015-01-07 17:59   ` Alexander Kuleshov
  2015-01-07 18:02     ` Alexander Kuleshov
  2015-01-07 18:57     ` Paul Bolle
  1 sibling, 2 replies; 9+ messages in thread
From: Alexander Kuleshov @ 2015-01-07 17:59 UTC (permalink / raw)
  To: kernelnewbies

Hello Paul, thank you for answer.

Yes i saw video-*.c files, but i can't understand how compilation of
these video-*.c files depends on _WAKEUP macro...

For example if'd remove -D_WAKEUP, i get errors during realmode.elf linking:

arch/x86/realmode/rm/video-vga.o: In function `vga_probe':
/home/alex/dev/linux/arch/x86/realmode/rm/../../boot/video-vga.c:259:
undefined reference to `boot_params'

As you wrote there are many #ifndef/#endif directives, but why there
_WAKEUP is undefined everytime, but we pass it from command line with
-D_WAKEUP?

Thank you.

2015-01-07 22:54 GMT+06:00 Paul Bolle <pebolle@tiscali.nl>:
> On Wed, 2015-01-07 at 20:12 +0600, Alexander Kuleshov wrote:
>> There is following definition at arch/x86/realmode/rm/Makefile:
>>
>> KBUILD_CFLAGS    := $(LINUXINCLUDE) $(REALMODE_CFLAGS) -D_SETUP -D_WAKEUP \
>>            -I$(srctree)/arch/x86/boot
>>
>> Is it used now? I'm asking because _WAKEUP definition everywhere
>> undefined in the code.
>
> git grep tells me:
>     $ git grep -n "_WAKEUP\b" arch/x86
>     arch/x86/boot/video-bios.c:51:#ifndef _WAKEUP
>     arch/x86/boot/video-bios.c:66:#ifdef _WAKEUP
>     arch/x86/boot/video-mode.c:169:#ifndef _WAKEUP
>     arch/x86/boot/video-vesa.c:27:#ifndef _WAKEUP
>     arch/x86/boot/video-vesa.c:29:#else /* _WAKEUP */
>     arch/x86/boot/video-vesa.c:31:#endif /* _WAKEUP */
>     arch/x86/boot/video-vesa.c:160:#ifndef _WAKEUP
>     arch/x86/boot/video-vesa.c:272:#endif /* not _WAKEUP */
>     arch/x86/boot/video-vga.c:257:#ifndef _WAKEUP
>     arch/x86/boot/video-vga.c:269:#ifndef _WAKEUP
>
> And in that Makefile we also see, a few lines up:
>     wakeup-objs     := [...] video-mode.o
>     [...]
>     wakeup-objs     += video-vga.o
>     wakeup-objs     += video-vesa.o
>     wakeup-objs     += video-bios.o
>
> So this Makefile line defines a _WAKEUP macro that is, it seems, used
> for the build of those four object files. (It's bit more complicated
> than that. But I think KBUILD_CFLAGS is explained in Documentation/,
> isn't it?)
>
> Hope this helps,
>
>
> Paul Bolle
>



-- 
_________________________
0xAX

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

* realmode _WAKEUP
  2015-01-07 17:59   ` Alexander Kuleshov
@ 2015-01-07 18:02     ` Alexander Kuleshov
  2015-01-07 19:02       ` Paul Bolle
  2015-01-07 18:57     ` Paul Bolle
  1 sibling, 1 reply; 9+ messages in thread
From: Alexander Kuleshov @ 2015-01-07 18:02 UTC (permalink / raw)
  To: kernelnewbies

As i understood correctly we compile wakeup-objs only if
CONFIG_ACPI_SLEEP is 'y', but than why we pass -D_WAKEUP everytime,
even CONFIG_ACPI_SLEEP is not y?

2015-01-07 23:59 GMT+06:00 Alexander Kuleshov <kuleshovmail@gmail.com>:
> Hello Paul, thank you for answer.
>
> Yes i saw video-*.c files, but i can't understand how compilation of
> these video-*.c files depends on _WAKEUP macro...
>
> For example if'd remove -D_WAKEUP, i get errors during realmode.elf linking:
>
> arch/x86/realmode/rm/video-vga.o: In function `vga_probe':
> /home/alex/dev/linux/arch/x86/realmode/rm/../../boot/video-vga.c:259:
> undefined reference to `boot_params'
>
> As you wrote there are many #ifndef/#endif directives, but why there
> _WAKEUP is undefined everytime, but we pass it from command line with
> -D_WAKEUP?
>
> Thank you.
>
> 2015-01-07 22:54 GMT+06:00 Paul Bolle <pebolle@tiscali.nl>:
>> On Wed, 2015-01-07 at 20:12 +0600, Alexander Kuleshov wrote:
>>> There is following definition at arch/x86/realmode/rm/Makefile:
>>>
>>> KBUILD_CFLAGS    := $(LINUXINCLUDE) $(REALMODE_CFLAGS) -D_SETUP -D_WAKEUP \
>>>            -I$(srctree)/arch/x86/boot
>>>
>>> Is it used now? I'm asking because _WAKEUP definition everywhere
>>> undefined in the code.
>>
>> git grep tells me:
>>     $ git grep -n "_WAKEUP\b" arch/x86
>>     arch/x86/boot/video-bios.c:51:#ifndef _WAKEUP
>>     arch/x86/boot/video-bios.c:66:#ifdef _WAKEUP
>>     arch/x86/boot/video-mode.c:169:#ifndef _WAKEUP
>>     arch/x86/boot/video-vesa.c:27:#ifndef _WAKEUP
>>     arch/x86/boot/video-vesa.c:29:#else /* _WAKEUP */
>>     arch/x86/boot/video-vesa.c:31:#endif /* _WAKEUP */
>>     arch/x86/boot/video-vesa.c:160:#ifndef _WAKEUP
>>     arch/x86/boot/video-vesa.c:272:#endif /* not _WAKEUP */
>>     arch/x86/boot/video-vga.c:257:#ifndef _WAKEUP
>>     arch/x86/boot/video-vga.c:269:#ifndef _WAKEUP
>>
>> And in that Makefile we also see, a few lines up:
>>     wakeup-objs     := [...] video-mode.o
>>     [...]
>>     wakeup-objs     += video-vga.o
>>     wakeup-objs     += video-vesa.o
>>     wakeup-objs     += video-bios.o
>>
>> So this Makefile line defines a _WAKEUP macro that is, it seems, used
>> for the build of those four object files. (It's bit more complicated
>> than that. But I think KBUILD_CFLAGS is explained in Documentation/,
>> isn't it?)
>>
>> Hope this helps,
>>
>>
>> Paul Bolle
>>
>
>
>
> --
> _________________________
> 0xAX



-- 
_________________________
0xAX

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

* realmode _WAKEUP
  2015-01-07 17:59   ` Alexander Kuleshov
  2015-01-07 18:02     ` Alexander Kuleshov
@ 2015-01-07 18:57     ` Paul Bolle
  2015-01-07 19:11       ` Alexander Kuleshov
  1 sibling, 1 reply; 9+ messages in thread
From: Paul Bolle @ 2015-01-07 18:57 UTC (permalink / raw)
  To: kernelnewbies

On Wed, 2015-01-07 at 23:59 +0600, Alexander Kuleshov wrote:
> Yes i saw video-*.c files, but i can't understand how compilation of
> these video-*.c files depends on _WAKEUP macro...
> 
> For example if'd remove -D_WAKEUP, i get errors during realmode.elf linking:
> 
> arch/x86/realmode/rm/video-vga.o: In function `vga_probe':
> /home/alex/dev/linux/arch/x86/realmode/rm/../../boot/video-vga.c:259:
> undefined reference to `boot_params'
> 
> As you wrote there are many #ifndef/#endif directives, but why there
> _WAKEUP is undefined everytime, but we pass it from command line with
> -D_WAKEUP?

Because these file also get compiled via arch/x86/boot/Makefile? Ie, I
_guess_ _WAKEUP is needed to ensure the compile started from
arch/x86/realmode/rm/Makefile differs from the compile started from
arch/x86/boot/Makefile. But [...]/boot/Makefile is sufficiently
complicated for me to stop me from looking at it too long!

You do realize that the Linux kernel is a treasure trove for people
wanting to know just how far make, gcc, etc can be pushed, don't you?


Paul Bolle

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

* realmode _WAKEUP
  2015-01-07 18:02     ` Alexander Kuleshov
@ 2015-01-07 19:02       ` Paul Bolle
  0 siblings, 0 replies; 9+ messages in thread
From: Paul Bolle @ 2015-01-07 19:02 UTC (permalink / raw)
  To: kernelnewbies

On Thu, 2015-01-08 at 00:02 +0600, Alexander Kuleshov wrote:
> As i understood correctly we compile wakeup-objs only if
> CONFIG_ACPI_SLEEP is 'y', but than why we pass -D_WAKEUP everytime,
> even CONFIG_ACPI_SLEEP is not y?

I really don't know whether wakeup-objs is compiled only for the 'y'
case. Did you test this with both 'm' and 'y'? But, anyhow, suppose
that's correct: who cares if a preprocessor macro is always defined but
not always used? What's the problem?


Paul Bolle

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

* realmode _WAKEUP
  2015-01-07 18:57     ` Paul Bolle
@ 2015-01-07 19:11       ` Alexander Kuleshov
  0 siblings, 0 replies; 9+ messages in thread
From: Alexander Kuleshov @ 2015-01-07 19:11 UTC (permalink / raw)
  To: kernelnewbies

8 ???. 2015 ?. 0:57 ???????????? "Paul Bolle" <pebolle@tiscali.nl> ???????:
>
> On Wed, 2015-01-07 at 23:59 +0600, Alexander Kuleshov wrote:
> > Yes i saw video-*.c files, but i can't understand how compilation of
> > these video-*.c files depends on _WAKEUP macro...
> >
> > For example if'd remove -D_WAKEUP, i get errors during realmode.elf
linking:
> >
> > arch/x86/realmode/rm/video-vga.o: In function `vga_probe':
> > /home/alex/dev/linux/arch/x86/realmode/rm/../../boot/video-vga.c:259:
> > undefined reference to `boot_params'
> >
> > As you wrote there are many #ifndef/#endif directives, but why there
> > _WAKEUP is undefined everytime, but we pass it from command line with
> > -D_WAKEUP?
>
> Because these file also get compiled via arch/x86/boot/Makefile? Ie, I
> _guess_ _WAKEUP is needed to ensure the compile started from
> arch/x86/realmode/rm/Makefile differs from the compile started from
> arch/x86/boot/Makefile. But [...]/boot/Makefile is sufficiently
> complicated for me to stop me from looking at it too long!
>
> You do realize that the Linux kernel is a treasure trove for people
> wanting to know just how far make, gcc, etc can be pushed, don't you?
>
>
> Paul Bolle
>

That's true
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150108/5d94356f/attachment.html 

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

* realmode _WAKEUP
@ 2015-01-07 19:11 Alexander Kuleshov
  0 siblings, 0 replies; 9+ messages in thread
From: Alexander Kuleshov @ 2015-01-07 19:11 UTC (permalink / raw)
  To: kernelnewbies

Seems that finally i got point of this.

Thank you Paul for the help.
8 ???. 2015 ?. 1:10 ???????????? kuleshovmail at gmail.com ???????:

8 ???. 2015 ?. 0:57 ???????????? "Paul Bolle" <pebolle@tiscali.nl> ???????:
>
> On Wed, 2015-01-07 at 23:59 +0600, Alexander Kuleshov wrote:
> > Yes i saw video-*.c files, but i can't understand how compilation of
> > these video-*.c files depends on _WAKEUP macro...
> >
> > For example if'd remove -D_WAKEUP, i get errors during realmode.elf
linking:
> >
> > arch/x86/realmode/rm/video-vga.o: In function `vga_probe':
> > /home/alex/dev/linux/arch/x86/realmode/rm/../../boot/video-vga.c:259:
> > undefined reference to `boot_params'
> >
> > As you wrote there are many #ifndef/#endif directives, but why there
> > _WAKEUP is undefined everytime, but we pass it from command line with
> > -D_WAKEUP?
>
> Because these file also get compiled via arch/x86/boot/Makefile? Ie, I
> _guess_ _WAKEUP is needed to ensure the compile started from
> arch/x86/realmode/rm/Makefile differs from the compile started from
> arch/x86/boot/Makefile. But [...]/boot/Makefile is sufficiently
> complicated for me to stop me from looking at it too long!
>
> You do realize that the Linux kernel is a treasure trove for people
> wanting to know just how far make, gcc, etc can be pushed, don't you?
>
>
> Paul Bolle
>

That's true
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150108/4969b3bc/attachment.html 

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

end of thread, other threads:[~2015-01-07 19:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-07 14:12 realmode _WAKEUP Alexander Kuleshov
2015-01-07 16:54 ` Paul Bolle
2015-01-07 17:13   ` Paul Bolle
2015-01-07 17:59   ` Alexander Kuleshov
2015-01-07 18:02     ` Alexander Kuleshov
2015-01-07 19:02       ` Paul Bolle
2015-01-07 18:57     ` Paul Bolle
2015-01-07 19:11       ` Alexander Kuleshov
2015-01-07 19:11 Alexander Kuleshov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.