Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
297f778c
Commit
297f778c
authored
Oct 26, 2004
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://linux-sam.bkbits.net/kbuild
into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents
75392adf
ce57f2a0
Changes
27
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
267 additions
and
112 deletions
+267
-112
Documentation/DocBook/Makefile
Documentation/DocBook/Makefile
+5
-2
Documentation/kbuild/makefiles.txt
Documentation/kbuild/makefiles.txt
+15
-0
Makefile
Makefile
+35
-16
arch/i386/Makefile
arch/i386/Makefile
+1
-1
arch/ppc/boot/utils/mkbugboot.c
arch/ppc/boot/utils/mkbugboot.c
+1
-1
init/Kconfig
init/Kconfig
+38
-1
kernel/module.c
kernel/module.c
+14
-2
lib/Kconfig.debug
lib/Kconfig.debug
+1
-1
scripts/Makefile.lib
scripts/Makefile.lib
+27
-0
scripts/Makefile.modinst
scripts/Makefile.modinst
+4
-1
scripts/basic/docproc.c
scripts/basic/docproc.c
+22
-11
scripts/basic/fixdep.c
scripts/basic/fixdep.c
+5
-5
scripts/basic/split-include.c
scripts/basic/split-include.c
+1
-1
scripts/conmakehash.c
scripts/conmakehash.c
+1
-1
scripts/gen_initramfs_list.sh
scripts/gen_initramfs_list.sh
+35
-16
scripts/kallsyms.c
scripts/kallsyms.c
+13
-1
scripts/kconfig/conf.c
scripts/kconfig/conf.c
+3
-3
scripts/kconfig/confdata.c
scripts/kconfig/confdata.c
+15
-7
scripts/kconfig/mconf.c
scripts/kconfig/mconf.c
+2
-2
scripts/kconfig/symbol.c
scripts/kconfig/symbol.c
+1
-1
scripts/kernel-doc
scripts/kernel-doc
+1
-1
scripts/mksysmap
scripts/mksysmap
+1
-1
scripts/mod/file2alias.c
scripts/mod/file2alias.c
+12
-7
scripts/mod/modpost.c
scripts/mod/modpost.c
+1
-1
scripts/mod/sumversion.c
scripts/mod/sumversion.c
+4
-4
usr/Makefile
usr/Makefile
+9
-20
usr/initramfs_list
usr/initramfs_list
+0
-5
No files found.
Documentation/DocBook/Makefile
View file @
297f778c
...
...
@@ -58,14 +58,14 @@ MAKEMAN = $(PERL) $(srctree)/scripts/makeman
# The following rules are used to generate the .sgml documentation
# required to generate the final targets. (ps, pdf, html).
quiet_cmd_docproc
=
DOCPROC
$@
cmd_docproc
=
$(DOCPROC)
doc
$<
>
$@
cmd_docproc
=
SRCTREE
=
$(srctree)
/
$(DOCPROC)
doc
$<
>
$@
define
rule_docproc
set
-e;
\
$(if
$($(quiet)cmd_$(1)),echo
' $($(quiet)cmd_$(1))'
;)
\
$(cmd_$(1));
\
(
\
echo 'cmd_$@
:
= $(cmd_$(1))';
\
echo $@: `
$(DOCPROC) depend $<`;
\
echo $@: `
SRCTREE=$(srctree) $(DOCPROC) depend $<`;
\
) > $(dir $@).$(notdir $@).cmd
endef
...
...
@@ -129,6 +129,9 @@ quiet_cmd_db2html = DB2HTML $@
# Rule to generate man files - output is placed in the man subdirectory
%.9
:
%.sgml
ifneq
($(KBUILD_SRC),)
$(Q)
mkdir
-p
$(objtree)
/Documentation/DocBook/man
endif
$(SPLITMAN)
$<
$(objtree)
/Documentation/DocBook/man
"
$(VERSION)
.
$(PATCHLEVEL)
.
$(SUBLEVEL)
"
$(MAKEMAN)
convert
$(objtree)
/Documentation/DocBook/man
$<
...
...
Documentation/kbuild/makefiles.txt
View file @
297f778c
...
...
@@ -997,6 +997,21 @@ When kbuild executes the following steps are followed (roughly):
option. When $(biarch) equals to y the expanded variables $(aflags-y)
and $(cflags-y) will be assigned the values -a32 and -m32.
cc-option-align
gcc version >= 3.0 shifted type of options used to speify
alignment of functions, loops etc. $(cc-option-align) whrn used
as prefix to the align options will select the right prefix:
gcc < 3.00
cc-option-align = -malign
gcc >= 3.00
cc-option-align = -falign
Example:
CFLAGS += $(cc-option-align)-functions=4
In the above example the option -falign-functions=4 is used for
gcc >= 3.00. For gcc < 3.00 -malign-functions=4 is used.
cc-version
cc-version return a numerical version of the $(CC) compiler version.
The format is <major><minor> where both are two digits. So for example
...
...
Makefile
View file @
297f778c
...
...
@@ -157,7 +157,7 @@ endif
LOCALVERSION
=
$(
subst
$(space)
,,
\
$(
shell
cat
/dev/null
$
(
localversion-files
))
\
$(
subst
",
,
$(CONFIG_LOCALVERSION)
))
$(
patsubst
"%"
,%
,
$(CONFIG_LOCALVERSION)
))
KERNELRELEASE
=
$(VERSION)
.
$(PATCHLEVEL)
.
$(SUBLEVEL)$(EXTRAVERSION)$(LOCALVERSION)
...
...
@@ -295,6 +295,11 @@ check_gcc = $(warning check_gcc is deprecated - use cc-option) \
cc-option-yn
=
$(
shell
if
$(CC)
$(CFLAGS)
$(1)
-S
-o
/dev/null
-xc
/dev/null
\
>
/dev/null 2>&1
;
then
echo
"y"
;
else
echo
"n"
;
fi
;
)
# cc-option-align
# Prefix align with either -falign or -malign
cc-option-align
=
$(
subst
-functions
=
0,,
\
$(
call
cc-option,-falign-functions
=
0,-malign-functions
=
0
))
# cc-version
# Usage gcc-ver := $(call cc-version $(CC))
cc-version
=
$(
shell
$(CONFIG_SHELL)
$(srctree)
/scripts/gcc-version.sh
\
...
...
@@ -379,6 +384,18 @@ RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn --exclude CV
scripts_basic
:
$(Q)$(MAKE)
$(build)
=
scripts/basic
.PHONY
:
outputmakefile
# outputmakefile generate a Makefile to be placed in output directory, if
# using a seperate output directory. This allows convinient use
# of make in output directory
outputmakefile
:
$(Q)
if
/usr/bin/env
test
!
$(srctree)
-ef
$(objtree)
;
then
\
$(CONFIG_SHELL)
$(srctree)
/scripts/mkmakefile
\
$(srctree)
$(objtree)
$(VERSION)
$(PATCHLEVEL)
\
>
$(objtree)
/Makefile
;
\
echo
' GEN
$(objtree)
/Makefile'
;
\
fi
# To make sure we do not include .config for any of the *config targets
# catch them early, and hand them over to scripts/kconfig/Makefile
# It is allowed to specify more targets when calling make, including
...
...
@@ -423,9 +440,9 @@ ifeq ($(config-targets),1)
# *config targets only - make sure prerequisites are updated, and descend
# in scripts/kconfig to make the *config target
config
:
scripts_basic FORCE
config
:
scripts_basic
outputmakefile
FORCE
$(Q)$(MAKE)
$(build)
=
scripts/kconfig
$@
%config
:
scripts_basic FORCE
%config
:
scripts_basic
outputmakefile
FORCE
$(Q)$(MAKE)
$(build)
=
scripts/kconfig
$@
else
...
...
@@ -486,7 +503,16 @@ else
CFLAGS
+=
-O2
endif
ifndef
CONFIG_FRAME_POINTER
#Add align options if CONFIG_CC_* is not equal to 0
add-align
=
$(
if
$(
filter-out
0,
$
(
$(1)
))
,
$
(
cc-option-align
)
$(2)
=
$
(
$(1)
))
CFLAGS
+=
$(
call
add-align,CONFIG_CC_ALIGN_FUNCTIONS,-functions
)
CFLAGS
+=
$(
call
add-align,CONFIG_CC_ALIGN_LABELS,-labels
)
CFLAGS
+=
$(
call
add-align,CONFIG_CC_ALIGN_LOOPS,-loops
)
CFLAGS
+=
$(
call
add-align,CONFIG_CC_ALIGN_JUMPS,-jumps
)
ifdef
CONFIG_FRAME_POINTER
CFLAGS
+=
-fno-omit-frame-pointer
else
CFLAGS
+=
-fomit-frame-pointer
endif
...
...
@@ -711,22 +737,12 @@ $(vmlinux-dirs): prepare-all scripts
.PHONY
:
prepare-all prepare prepare0 prepare1 prepare2
# prepare 2 generate Makefile to be placed in output directory, if
# using a seperate output directory. This allows convinient use
# of make in output directory
prepare2
:
$(Q)
if
/usr/bin/env
test
!
$(srctree)
-ef
$(objtree)
;
then
\
$(CONFIG_SHELL)
$(srctree)
/scripts/mkmakefile
\
$(srctree)
$(objtree)
$(VERSION)
$(PATCHLEVEL)
\
>
$(objtree)
/Makefile
;
\
fi
# prepare1 is used to check if we are building in a separate output directory,
# prepare2 is used to check if we are building in a separate output directory,
# and if so do:
# 1) Check that make has not been executed in the kernel src $(srctree)
# 2) Create the include2 directory, used for the second asm symlink
prepare
1
:
prepare2
prepare
2
:
ifneq
($(KBUILD_SRC),)
@
echo
' Using
$(srctree)
as source for kernel'
$(Q)
if
[
-h
$(srctree)
/include/asm
-o
-f
$(srctree)
/.config
]
;
then
\
...
...
@@ -738,6 +754,9 @@ ifneq ($(KBUILD_SRC),)
$(Q)
ln
-fsn
$(srctree)
/include/asm-
$(ARCH)
include2/asm
endif
# prepare1 creates a makefile if using a separate output directory
prepare1
:
prepare2 outputmakefile
prepare0
:
prepare1 include/linux/version.h include/asm include/config/MARKER
ifneq
($(KBUILD_MODULES),)
$(Q)
rm
-rf
$(MODVERDIR)
...
...
arch/i386/Makefile
View file @
297f778c
...
...
@@ -25,7 +25,7 @@ CFLAGS += -pipe -msoft-float
# prevent gcc from keeping the stack 16 byte aligned
CFLAGS
+=
$(
call
cc-option,-mpreferred-stack-boundary
=
2
)
align
:=
$(
subst
-functions
=
0,,
$(
call
cc-option,-falign-functions
=
0,-malign-functions
=
0
)
)
align
:=
$
(
cc-option-align
)
cflags-$(CONFIG_M386)
+=
-march
=
i386
cflags-$(CONFIG_M486)
+=
-march
=
i486
cflags-$(CONFIG_M586)
+=
-march
=
i586
...
...
arch/ppc/boot/utils/mkbugboot.c
View file @
297f778c
...
...
@@ -96,7 +96,7 @@ void write_bugboot_header(int32_t out_fd, uint32_t boot_size)
uint8_t
header_block
[
HEADER_SIZE
];
bug_boot_header_t
*
bbh
=
(
bug_boot_header_t
*
)
&
header_block
[
0
];
bzero
(
header_block
,
HEADER_SIZE
);
memset
(
header_block
,
0
,
HEADER_SIZE
);
/* Fill in the PPCBUG ROM boot header */
strncpy
(
bbh
->
magic_word
,
"BOOT"
,
4
);
/* PPCBUG magic word */
...
...
init/Kconfig
View file @
297f778c
...
...
@@ -325,6 +325,43 @@ config SHMEM
option replaces shmem and tmpfs with the much simpler ramfs code,
which may be appropriate on small systems without swap.
config CC_ALIGN_FUNCTIONS
int "Function alignment"
default 0
help
Align the start of functions to the next power-of-two greater than n,
skipping up to n bytes. For instance, 32 aligns functions
to the next 32-byte boundary, but 24 would align to the next
32-byte boundary only if this can be done by skipping 23 bytes or less.
Zero means use compiler's default.
config CC_ALIGN_LABELS
int "Label alignment"
default 0
help
Align all branch targets to a power-of-two boundary, skipping
up to n bytes like ALIGN_FUNCTIONS. This option can easily
make code slower, because it must insert dummy operations for
when the branch target is reached in the usual flow of the code.
Zero means use compiler's default.
config CC_ALIGN_LOOPS
int "Loop alignment"
default 0
help
Align loops to a power-of-two boundary, skipping up to n bytes.
Zero means use compiler's default.
config CC_ALIGN_JUMPS
int "Jump alignment"
default 0
help
Align branch targets to a power-of-two boundary, for branch
targets where the targets can only be reached by jumping,
skipping up to n bytes like ALIGN_FUNCTIONS. In this case,
no dummy operations need be executed.
Zero means use compiler's default.
endmenu # General setup
config TINY_SHMEM
...
...
@@ -397,7 +434,7 @@ config MODULE_SRCVERSION_ALL
depends on MODULES
help
Modules which contain a MODULE_VERSION get an extra "srcversion"
field insert
ing
into their modinfo section, which contains a
field insert
ed
into their modinfo section, which contains a
sum of the source files which made it. This helps maintainers
see exactly which source was used to build a module (since
others sometimes change the module source without updating
...
...
kernel/module.c
View file @
297f778c
...
...
@@ -1834,6 +1834,16 @@ static inline int within(unsigned long addr, void *start, unsigned long size)
}
#ifdef CONFIG_KALLSYMS
/*
* This ignores the intensely annoying "mapping symbols" found
* in ARM ELF files: $a, $t and $d.
*/
static
inline
int
is_arm_mapping_symbol
(
const
char
*
str
)
{
return
str
[
0
]
==
'$'
&&
strchr
(
"atd"
,
str
[
1
])
&&
(
str
[
2
]
==
'\0'
||
str
[
2
]
==
'.'
);
}
static
const
char
*
get_ksymbol
(
struct
module
*
mod
,
unsigned
long
addr
,
unsigned
long
*
size
,
...
...
@@ -1858,11 +1868,13 @@ static const char *get_ksymbol(struct module *mod,
* and inserted at a whim. */
if
(
mod
->
symtab
[
i
].
st_value
<=
addr
&&
mod
->
symtab
[
i
].
st_value
>
mod
->
symtab
[
best
].
st_value
&&
*
(
mod
->
strtab
+
mod
->
symtab
[
i
].
st_name
)
!=
'\0'
)
&&
*
(
mod
->
strtab
+
mod
->
symtab
[
i
].
st_name
)
!=
'\0'
&&
!
is_arm_mapping_symbol
(
mod
->
strtab
+
mod
->
symtab
[
i
].
st_name
))
best
=
i
;
if
(
mod
->
symtab
[
i
].
st_value
>
addr
&&
mod
->
symtab
[
i
].
st_value
<
nextval
&&
*
(
mod
->
strtab
+
mod
->
symtab
[
i
].
st_name
)
!=
'\0'
)
&&
*
(
mod
->
strtab
+
mod
->
symtab
[
i
].
st_name
)
!=
'\0'
&&
!
is_arm_mapping_symbol
(
mod
->
strtab
+
mod
->
symtab
[
i
].
st_name
))
nextval
=
mod
->
symtab
[
i
].
st_value
;
}
...
...
lib/Kconfig.debug
View file @
297f778c
...
...
@@ -46,7 +46,7 @@ config DEBUG_SLAB
help
Say Y here to have the kernel do limited verification on memory
allocation as well as poisoning memory on free to catch use of freed
memory.
memory.
This can make kmalloc/kfree-intensive workloads much slower.
config DEBUG_SPINLOCK
bool "Spinlock debugging"
...
...
scripts/Makefile.lib
View file @
297f778c
...
...
@@ -232,3 +232,30 @@ descend =$(Q)$(MAKE) -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build ob
# Usage:
# $(Q)$(MAKE) $(build)=dir
build
:=
-f
$(
if
$(KBUILD_SRC)
,
$(srctree)
/
)
scripts/Makefile.build obj
# filechk is used to check if the content of a generated file is updated.
# Sample usage:
# define filechk_sample
# echo $KERNELRELEASE
# endef
# version.h : Makefile
# $(call filechk,sample)
# The rule defined shall write to stdout the content of the new file.
# The existing file will be compared with the new one.
# - If no file exist it is created
# - If the content differ the new file is used
# - If they are equal no change, and no timestamp update
define
filechk
$(Q)set
-e;
\
echo
' CHK $@'
;
\
mkdir
-p
$(dir
$@);
\
$(filechk_$(1))
$(2)
>
$@.tmp;
\
if
[
-r
$@
]
&&
cmp
-s
$@
$@.tmp;
then
\
rm
-f
$@.tmp;
\
else
\
echo
' UPD $@'
;
\
mv
-f
$@.tmp
$@;
\
fi
endef
scripts/Makefile.modinst
View file @
297f778c
...
...
@@ -19,7 +19,10 @@ __modinst: $(modules)
quiet_cmd_modules_install
=
INSTALL
$@
cmd_modules_install
=
mkdir
-p
$(2)
;
cp
$@
$(2)
modinst_dir
=
$(MODLIB)
/
$(
if
$(
filter
../% /%,
$@
)
,extra/,kernel/
$
(
@D
))
# Modules built outside the kernel source tree go into extra by default
INSTALL_MOD_DIR
?=
extra
modinst_dir
=
$(MODLIB)
/
$(
if
$(
filter
../% /%,
$@
)
,
$(INSTALL_MOD_DIR)
/,kernel/
$
(
@D
))
$(modules)
:
$(
call
cmd,modules_install,
$(modinst_dir)
)
scripts/basic/docproc.c
View file @
297f778c
...
...
@@ -52,7 +52,7 @@ FILEONLY *internalfunctions;
FILEONLY
*
externalfunctions
;
FILEONLY
*
symbolsonly
;
typedef
void
FILELINE
(
char
*
file
,
char
*
line
);
typedef
void
FILELINE
(
char
*
file
,
signed
char
*
line
);
FILELINE
*
singlefunctions
;
FILELINE
*
entity_system
;
...
...
@@ -79,6 +79,7 @@ void exec_kernel_doc(char **svec)
{
pid_t
pid
;
int
ret
;
char
real_filename
[
PATH_MAX
+
1
];
/* Make sure output generated so far are flushed */
fflush
(
stdout
);
switch
(
pid
=
fork
())
{
...
...
@@ -86,8 +87,13 @@ void exec_kernel_doc(char **svec)
perror
(
"fork"
);
exit
(
1
);
case
0
:
execvp
(
KERNELDOCPATH
KERNELDOC
,
svec
);
perror
(
"exec "
KERNELDOCPATH
KERNELDOC
);
memset
(
real_filename
,
0
,
sizeof
(
real_filename
));
strncat
(
real_filename
,
getenv
(
"SRCTREE"
),
PATH_MAX
);
strncat
(
real_filename
,
KERNELDOCPATH
KERNELDOC
,
PATH_MAX
-
strlen
(
real_filename
));
execvp
(
real_filename
,
svec
);
fprintf
(
stderr
,
"exec "
);
perror
(
real_filename
);
exit
(
1
);
default:
waitpid
(
pid
,
&
ret
,
0
);
...
...
@@ -142,9 +148,9 @@ struct symfile * filename_exist(char * filename)
* Files are separated by tabs.
*/
void
adddep
(
char
*
file
)
{
printf
(
"
\t
%s"
,
file
);
}
void
adddep2
(
char
*
file
,
char
*
line
)
{
line
=
line
;
adddep
(
file
);
}
void
adddep2
(
char
*
file
,
signed
char
*
line
)
{
line
=
line
;
adddep
(
file
);
}
void
noaction
(
char
*
line
)
{
line
=
line
;
}
void
noaction2
(
char
*
file
,
char
*
line
)
{
file
=
file
;
line
=
line
;
}
void
noaction2
(
char
*
file
,
signed
char
*
line
)
{
file
=
file
;
line
=
line
;
}
/* Echo the line without further action */
void
printline
(
char
*
line
)
{
printf
(
"%s"
,
line
);
}
...
...
@@ -160,16 +166,21 @@ void find_export_symbols(char * filename)
struct
symfile
*
sym
;
char
line
[
MAXLINESZ
];
if
(
filename_exist
(
filename
)
==
NULL
)
{
char
real_filename
[
PATH_MAX
+
1
];
memset
(
real_filename
,
0
,
sizeof
(
real_filename
));
strncat
(
real_filename
,
getenv
(
"SRCTREE"
),
PATH_MAX
);
strncat
(
real_filename
,
filename
,
PATH_MAX
-
strlen
(
real_filename
));
sym
=
add_new_file
(
filename
);
fp
=
fopen
(
filename
,
"r"
);
fp
=
fopen
(
real_
filename
,
"r"
);
if
(
fp
==
NULL
)
{
fprintf
(
stderr
,
"docproc: "
);
perror
(
filename
);
perror
(
real_
filename
);
}
while
(
fgets
(
line
,
MAXLINESZ
,
fp
))
{
char
*
p
;
char
*
e
;
signed
char
*
p
;
signed
char
*
e
;
if
(((
p
=
strstr
(
line
,
"EXPORT_SYMBOL_GPL"
))
!=
0
)
||
((
p
=
strstr
(
line
,
"EXPORT_SYMBOL"
))
!=
0
))
{
/* Skip EXPORT_SYMBOL{_GPL} */
...
...
@@ -242,7 +253,7 @@ void extfunc(char * filename) { docfunctions(filename, FUNCTION); }
* Call kernel-doc with the following parameters:
* kernel-doc -docbook -function function1 [-function function2]
*/
void
singfunc
(
char
*
filename
,
char
*
line
)
void
singfunc
(
char
*
filename
,
signed
char
*
line
)
{
char
*
vec
[
200
];
/* Enough for specific functions */
int
i
,
idx
=
0
;
...
...
@@ -279,7 +290,7 @@ void singfunc(char * filename, char * line)
void
parse_file
(
FILE
*
infile
)
{
char
line
[
MAXLINESZ
];
char
*
s
;
signed
char
*
s
;
while
(
fgets
(
line
,
MAXLINESZ
,
infile
))
{
if
(
line
[
0
]
==
'!'
)
{
s
=
line
+
2
;
...
...
scripts/basic/fixdep.c
View file @
297f778c
...
...
@@ -217,12 +217,12 @@ void use_config(char *m, int slen)
printf
(
" $(wildcard include/config/%s.h)
\\\n
"
,
s
);
}
void
parse_config_file
(
char
*
map
,
size_t
len
)
void
parse_config_file
(
signed
char
*
map
,
size_t
len
)
{
int
*
end
=
(
int
*
)
(
map
+
len
);
/* start at +1, so that p can never be < map */
int
*
m
=
(
int
*
)
map
+
1
;
char
*
p
,
*
q
;
signed
char
*
p
,
*
q
;
for
(;
m
<
end
;
m
++
)
{
if
(
*
m
==
INT_CONF
)
{
p
=
(
char
*
)
m
;
goto
conf
;
}
...
...
@@ -291,9 +291,9 @@ void do_config_file(char *filename)
void
parse_dep_file
(
void
*
map
,
size_t
len
)
{
char
*
m
=
map
;
char
*
end
=
m
+
len
;
char
*
p
;
signed
char
*
m
=
map
;
signed
char
*
end
=
m
+
len
;
signed
char
*
p
;
char
s
[
PATH_MAX
];
p
=
strchr
(
m
,
':'
);
...
...
scripts/basic/split-include.c
View file @
297f778c
...
...
@@ -104,7 +104,7 @@ int main(int argc, const char * argv [])
/* Read config lines. */
while
(
fgets
(
line
,
buffer_size
,
fp_config
))
{
const
char
*
str_config
;
const
signed
char
*
str_config
;
int
is_same
;
int
itarget
;
...
...
scripts/conmakehash.c
View file @
297f778c
...
...
@@ -33,7 +33,7 @@ void usage(char *argv0)
int
getunicode
(
char
**
p0
)
{
char
*
p
=
*
p0
;
unsigned
char
*
p
=
*
p0
;
while
(
*
p
==
' '
||
*
p
==
'\t'
)
p
++
;
...
...
scripts/gen_initramfs_list.sh
View file @
297f778c
...
...
@@ -2,24 +2,25 @@
# Copyright (C) Martin Schlemmer <azarah@nosferatu.za.org>
# Released under the terms of the GNU GPL
#
#
A script to generate newline separated entries (to stdout) from a directory's
#
contents suitable for use as a cpio_list for gen_init_cpio.
#
Generate a newline separated list of entries from the file/directory pointed
#
out by the environment variable: CONFIG_INITRAMFS_SOURCE
#
# Arguements: $1 -- the source directory
# If CONFIG_INITRAMFS_SOURCE is non-existing then generate a small dummy file.
#
# The output is suitable for gen_init_cpio as found in usr/Makefile.
#
# TODO: Add support for symlinks, sockets and pipes when gen_init_cpio
# supports them.
usage
()
{
echo
"Usage:
$0
initramfs-source-dir"
exit
1
}
srcdir
=
$(
echo
"
$1
"
|
sed
-e
's://*:/:g'
)
simple_initramfs
()
{
cat
<<-
EOF
# This is a very simple initramfs
if
[
"$#"
-gt
1
-o
!
-d
"
${
srcdir
}
"
]
;
then
usage
fi
dir /dev 0755 0 0
nod /dev/console 0600 0 0 c 5 1
dir /root 0700 0 0
EOF
}
filetype
()
{
local
argv1
=
"
$1
"
...
...
@@ -76,9 +77,27 @@ parse() {
return
0
}
find
"
${
srcdir
}
"
-printf
"%p %m %U %G
\n
"
|
\
while
read
x
;
do
parse
${
x
}
done
if
[
-z
$1
]
;
then
simple_initramfs
elif
[
-f
$1
]
;
then
cat
$1
elif
[
-d
$1
]
;
then
srcdir
=
$(
echo
"
$1
"
|
sed
-e
's://*:/:g'
)
dirlist
=
$(
find
"
${
srcdir
}
"
-printf
"%p %m %U %G
\n
"
2>/dev/null
)
# If $dirlist is only one line, then the directory is empty
if
[
"
$(
echo
"
${
dirlist
}
"
|
wc
-l
)
"
-gt
1
]
;
then
echo
"
${
dirlist
}
"
|
\
while
read
x
;
do
parse
${
x
}
done
else
# Failsafe in case directory is empty
simple_initramfs
fi
else
echo
"
$0
: Cannot open '
$1
' (CONFIG_INITRAMFS_SOURCE)"
>
&2
exit
1
fi
exit
0
scripts/kallsyms.c
View file @
297f778c
...
...
@@ -97,6 +97,17 @@ usage(void)
exit
(
1
);
}
/*
* This ignores the intensely annoying "mapping symbols" found
* in ARM ELF files: $a, $t and $d.
*/
static
inline
int
is_arm_mapping_symbol
(
const
char
*
str
)
{
return
str
[
0
]
==
'$'
&&
strchr
(
"atd"
,
str
[
1
])
&&
(
str
[
2
]
==
'\0'
||
str
[
2
]
==
'.'
);
}
static
int
read_symbol
(
FILE
*
in
,
struct
sym_entry
*
s
)
{
...
...
@@ -121,7 +132,8 @@ read_symbol(FILE *in, struct sym_entry *s)
_sinittext
=
s
->
addr
;
else
if
(
strcmp
(
str
,
"_einittext"
)
==
0
)
_einittext
=
s
->
addr
;
else
if
(
toupper
(
s
->
type
)
==
'A'
||
toupper
(
s
->
type
)
==
'U'
)
else
if
(
toupper
(
s
->
type
)
==
'A'
||
toupper
(
s
->
type
)
==
'U'
||
is_arm_mapping_symbol
(
str
))
return
-
1
;
/* include the type field in the symbol name, so that it gets
...
...
scripts/kconfig/conf.c
View file @
297f778c
...
...
@@ -31,14 +31,14 @@ char *defconfig_file;
static
int
indent
=
1
;
static
int
valid_stdin
=
1
;
static
int
conf_cnt
;
static
char
line
[
128
];
static
signed
char
line
[
128
];
static
struct
menu
*
rootEntry
;
static
char
nohelp_text
[]
=
"Sorry, no help available for this option yet.
\n
"
;
static
void
strip
(
char
*
str
)
static
void
strip
(
signed
char
*
str
)
{
char
*
p
=
str
;
signed
char
*
p
=
str
;
int
l
;
while
((
isspace
(
*
p
)))
...
...
scripts/kconfig/confdata.c
View file @
297f778c
...
...
@@ -27,10 +27,10 @@ const char *conf_confnames[] = {
NULL
,
};
static
char
*
conf_expand_value
(
const
char
*
in
)
static
char
*
conf_expand_value
(
const
signed
char
*
in
)
{
struct
symbol
*
sym
;
const
char
*
src
;
const
signed
char
*
src
;
static
char
res_value
[
SYMBOL_MAXLENGTH
];
char
*
dst
,
name
[
SYMBOL_MAXLENGTH
];
...
...
@@ -270,6 +270,8 @@ int conf_write(const char *name)
int
type
,
l
;
const
char
*
str
;
time_t
now
;
int
use_timestamp
=
1
;
char
*
env
;
dirname
[
0
]
=
0
;
if
(
name
&&
name
[
0
])
{
...
...
@@ -293,7 +295,7 @@ int conf_write(const char *name)
}
else
basename
=
conf_def_filename
;
sprintf
(
newname
,
"%s.tmpconfig.%d"
,
dirname
,
getpid
());
sprintf
(
newname
,
"%s.tmpconfig.%d"
,
dirname
,
(
int
)
getpid
());
out
=
fopen
(
newname
,
"w"
);
if
(
!
out
)
return
1
;
...
...
@@ -306,22 +308,28 @@ int conf_write(const char *name)
sym
=
sym_lookup
(
"KERNELRELEASE"
,
0
);
sym_calc_value
(
sym
);
time
(
&
now
);
env
=
getenv
(
"KCONFIG_NOTIMESTAMP"
);
if
(
env
&&
*
env
)
use_timestamp
=
0
;
fprintf
(
out
,
"#
\n
"
"# Automatically generated make config: don't edit
\n
"
"# Linux kernel version: %s
\n
"
"
#
%s"
"
%s
%s"
"#
\n
"
,
sym_get_string_value
(
sym
),
ctime
(
&
now
));
use_timestamp
?
"# "
:
""
,
use_timestamp
?
ctime
(
&
now
)
:
""
);
if
(
out_h
)
fprintf
(
out_h
,
"/*
\n
"
" * Automatically generated C config: don't edit
\n
"
" * Linux kernel version: %s
\n
"
"
*
%s"
"
%s
%s"
" */
\n
"
"#define AUTOCONF_INCLUDED
\n
"
,
sym_get_string_value
(
sym
),
ctime
(
&
now
));
use_timestamp
?
" * "
:
""
,
use_timestamp
?
ctime
(
&
now
)
:
""
);
if
(
!
sym_change_count
)
sym_clear_all_valid
();
...
...
scripts/kconfig/mconf.c
View file @
297f778c
...
...
@@ -82,8 +82,8 @@ save_config_help[] =
"leave this blank.
\n
"
;
static
char
buf
[
4096
],
*
bufptr
=
buf
;
static
char
input_buf
[
4096
];
static
signed
char
buf
[
4096
],
*
bufptr
=
buf
;
static
signed
char
input_buf
[
4096
];
static
char
filename
[
PATH_MAX
+
1
]
=
".config"
;
static
char
*
args
[
1024
],
**
argptr
=
args
;
static
int
indent
;
...
...
scripts/kconfig/symbol.c
View file @
297f778c
...
...
@@ -421,7 +421,7 @@ tristate sym_toggle_tristate_value(struct symbol *sym)
bool
sym_string_valid
(
struct
symbol
*
sym
,
const
char
*
str
)
{
char
ch
;
signed
char
ch
;
switch
(
sym
->
type
)
{
case
S_STRING
:
...
...
scripts/kernel-doc
View file @
297f778c
...
...
@@ -1531,7 +1531,7 @@ sub process_state3_type($$) {
}
sub
process_file
($)
{
my
(
$file
)
=
@_
;
my
(
$file
)
=
"
$ENV
{'SRCTREE'}
@_
"
;
my
$identifier
;
my
$func
;
my
$initial_section_counter
=
$section_counter
;
...
...
scripts/mksysmap
View file @
297f778c
...
...
@@ -40,5 +40,5 @@
# so we just ignore them to let readprofile continue to work.
# (At least sparc64 has __crc_ in the middle).
$NM
-n
$1
|
grep
-v
'\( [aUw] \)\|\(__crc_\)'
>
$2
$NM
-n
$1
|
grep
-v
'\( [aUw] \)\|\(__crc_\)
\|\( \$[adt]\)
'
>
$2
scripts/mod/file2alias.c
View file @
297f778c
...
...
@@ -12,17 +12,22 @@
#include "modpost.h"
/* We use the ELF typedefs
, since we can't rely on stdint.h being present. */
/* We use the ELF typedefs
for kernel_ulong_t but bite the bullet and
* use either stdint.h or inttypes.h for the rest. */
#if KERNEL_ELFCLASS == ELFCLASS32
typedef
Elf32_Addr
kernel_ulong_t
;
typedef
Elf32_Addr
kernel_ulong_t
;
#else
typedef
Elf64_Addr
kernel_ulong_t
;
#endif
#ifdef __sun__
#include <inttypes.h>
#else
typedef
Elf64_Addr
kernel_ulong_t
;
#include <stdint.h>
#endif
typedef
Elf32_Word
__u32
;
typedef
Elf32_Half
__u16
;
typedef
unsigned
char
__u8
;
typedef
uint32_t
__u32
;
typedef
uint16_t
__u16
;
typedef
unsigned
char
__u8
;
/* Big exception to the "don't include kernel headers into userspace, which
* even potentially has different endianness and word sizes, since
...
...
scripts/mod/modpost.c
View file @
297f778c
...
...
@@ -219,7 +219,7 @@ get_next_line(unsigned long *pos, void *file, unsigned long size)
static
char
line
[
4096
];
int
skip
=
1
;
size_t
len
=
0
;
char
*
p
=
(
char
*
)
file
+
*
pos
;
signed
char
*
p
=
(
char
*
)
file
+
*
pos
;
char
*
s
=
line
;
for
(;
*
pos
<
size
;
(
*
pos
)
++
)
...
...
scripts/mod/sumversion.c
View file @
297f778c
...
...
@@ -252,9 +252,9 @@ static int parse_comment(const char *file, unsigned long len)
}
/* FIXME: Handle .s files differently (eg. # starts comments) --RR */
static
int
parse_file
(
const
char
*
fname
,
struct
md4_ctx
*
md
)
static
int
parse_file
(
const
signed
char
*
fname
,
struct
md4_ctx
*
md
)
{
char
*
file
;
signed
char
*
file
;
unsigned
long
i
,
len
;
file
=
grab_file
(
fname
,
&
len
);
...
...
@@ -332,7 +332,7 @@ static int parse_source_files(const char *objfile, struct md4_ctx *md)
Sum all files in the same dir or subdirs.
*/
while
((
line
=
get_next_line
(
&
pos
,
file
,
flen
))
!=
NULL
)
{
char
*
p
=
line
;
signed
char
*
p
=
line
;
if
(
strncmp
(
line
,
"deps_"
,
sizeof
(
"deps_"
)
-
1
)
==
0
)
{
check_files
=
1
;
continue
;
...
...
@@ -456,7 +456,7 @@ static void write_version(const char *filename, const char *sum,
close
(
fd
);
}
static
int
strip_rcs_crap
(
char
*
version
)
static
int
strip_rcs_crap
(
signed
char
*
version
)
{
unsigned
int
len
,
full_len
;
...
...
usr/Makefile
View file @
297f778c
...
...
@@ -3,7 +3,7 @@ obj-y := initramfs_data.o
hostprogs-y
:=
gen_init_cpio
clean-files
:=
initramfs_data.cpio.gz
clean-files
:=
initramfs_data.cpio.gz
initramfs_list
# If you want a different list of files in the initramfs_data.cpio
# then you can either overwrite the cpio_list in this directory
...
...
@@ -23,28 +23,17 @@ $(obj)/initramfs_data.o: $(obj)/initramfs_data.cpio.gz FORCE
# Commented out for now
# initramfs-y := $(obj)/root/hello
quiet_cmd_gen_list
=
GEN_INITRAMFS_LIST
$@
cmd_gen_list
=
$(
shell
\
if
test
-f
$(CONFIG_INITRAMFS_SOURCE)
;
then
\
if
[
$(CONFIG_INITRAMFS_SOURCE)
!=
$@
]
;
then
\
echo
'cp -f
$(CONFIG_INITRAMFS_SOURCE)
$@'
;
\
else
\
echo
'echo Using shipped $@'
;
\
fi
;
\
elif
test
-d
$(CONFIG_INITRAMFS_SOURCE)
;
then
\
echo
'scripts/gen_initramfs_list.sh
$(CONFIG_INITRAMFS_SOURCE)
> $@'
;
\
else
\
echo
'echo Using shipped $@'
;
\
fi
)
$(INITRAMFS_LIST)
:
FORCE
$(
call
cmd,gen_list
)
filechk_initramfs_list
=
$(CONFIG_SHELL)
\
$(srctree)
/scripts/gen_initramfs_list.sh
$(CONFIG_INITRAMFS_SOURCE)
$(obj)/initramfs_list
:
FORCE
$(
call
filechk,initramfs_list
)
quiet_cmd_cpio
=
CPIO
$@
cmd_cpio
=
./
$<
$(
INITRAMFS_LIST)
>
$@
cmd_cpio
=
./
$<
$(
obj)
/initramfs_list
>
$@
$(obj)/initramfs_data.cpio
:
$(obj)/gen_init_cpio $(initramfs-y) $(INITRAMFS_LIST) FORCE
$(obj)/initramfs_data.cpio
:
$(obj)/gen_init_cpio
\
$(initramfs-y) $(obj)/initramfs_list FORCE
$(
call
if_changed,cpio
)
targets
+=
initramfs_data.cpio
...
...
usr/initramfs_list
deleted
100644 → 0
View file @
75392adf
# This is a very simple initramfs - mostly preliminary for future expansion
dir /dev 0755 0 0
nod /dev/console 0600 0 0 c 5 1
dir /root 0700 0 0
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment