lkml.org 
[lkml]   [2010]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -v3 2/2] x86: more early console output from compressed/misc.c
On 08/02/2010 11:58 AM, H. Peter Anvin wrote:
> On 08/02/2010 11:54 AM, Cyrill Gorcunov wrote:
>>
>> ok, fair enough, I just don't like nesting *.c inclusion you know but seems
>> it would be the only more-less clean way here.
>>
>
> I don't mind it *as long as* the including file contains nothing but a
> single #include statement -- which is just another way to say "the same
> thing as this other file". Don't combine files.
>
> Look at most of the .c files in arch/x86/kernel/acpi/realmode/ for an
> example.

it seems I can not global variables in arch/x86/boot/compressed/misc.c

and misc.c already include some decompress .c like

#ifdef CONFIG_KERNEL_GZIP
#include "../../../../lib/decompress_inflate.c"
#endif

#ifdef CONFIG_KERNEL_BZIP2
#include "../../../../lib/decompress_bunzip2.c"
#endif

#ifdef CONFIG_KERNEL_LZMA
#include "../../../../lib/decompress_unlzma.c"
#endif

#ifdef CONFIG_KERNEL_LZO
#include "../../../../lib/decompress_unlzo.c"
#endif


this patch change to misc.c are following lines:

#define BOOT_BOOT_H
#include "../isdigit.h"
#include "../string.c"
#include "../printf.c"

...

static unsigned long fs;
static inline void set_fs(unsigned long seg)
{
fs = seg << 4; /* shift it back */
}
typedef unsigned long addr_t;
static inline char rdfs8(addr_t addr)
{
return *((char *)(fs + addr));
}
#include "../cmdline.c"
static inline int cmdline_find_option(const char *option, char *buffer, int bufsize)
{
return __cmdline_find_option(real_mode->hdr.cmd_line_ptr, option, buffer, bufsize);
}
static inline int cmdline_find_option_bool(const char *option)
{
return __cmdline_find_option_bool(real_mode->hdr.cmd_line_ptr, option);
}
static int early_serial_base;
#include "../early_serial_console.c"

or put them in another file?

Thanks

Yinghai

Yinghai


\
 
 \ /
  Last update: 2010-08-02 21:39    [W:0.224 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site