2008-01-30 15:32:31 +03:00
|
|
|
#
|
|
|
|
# Makefile for x86 specific library files.
|
|
|
|
#
|
|
|
|
|
x86: Instruction decoder API
Add x86 instruction decoder to arch-specific libraries. This decoder
can decode x86 instructions used in kernel into prefix, opcode, modrm,
sib, displacement and immediates. This can also show the length of
instructions.
This version introduces instruction attributes for decoding
instructions.
The instruction attribute tables are generated from the opcode map file
(x86-opcode-map.txt) by the generator script(gen-insn-attr-x86.awk).
Currently, the opcode maps are based on opcode maps in Intel(R) 64 and
IA-32 Architectures Software Developers Manual Vol.2: Appendix.A,
and consist of below two types of opcode tables.
1-byte/2-bytes/3-bytes opcodes, which has 256 elements, are
written as below;
Table: table-name
Referrer: escaped-name
opcode: mnemonic|GrpXXX [operand1[,operand2...]] [(extra1)[,(extra2)...] [| 2nd-mnemonic ...]
(or)
opcode: escape # escaped-name
EndTable
Group opcodes, which has 8 elements, are written as below;
GrpTable: GrpXXX
reg: mnemonic [operand1[,operand2...]] [(extra1)[,(extra2)...] [| 2nd-mnemonic ...]
EndTable
These opcode maps include a few SSE and FP opcodes (for setup), because
those opcodes are used in the kernel.
Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Signed-off-by: Jim Keniston <jkenisto@us.ibm.com>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Avi Kivity <avi@redhat.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Frank Ch. Eigler <fche@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Jason Baron <jbaron@redhat.com>
Cc: K.Prasad <prasad@linux.vnet.ibm.com>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Li Zefan <lizf@cn.fujitsu.com>
Cc: Przemysław Pawełczyk <przemyslaw@pawelczyk.it>
Cc: Roland McGrath <roland@redhat.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Tom Zanussi <tzanussi@gmail.com>
Cc: Vegard Nossum <vegard.nossum@gmail.com>
LKML-Reference: <20090813203413.31965.49709.stgit@localhost.localdomain>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
2009-08-14 00:34:13 +04:00
|
|
|
inat_tables_script = $(srctree)/arch/x86/tools/gen-insn-attr-x86.awk
|
|
|
|
inat_tables_maps = $(srctree)/arch/x86/lib/x86-opcode-map.txt
|
|
|
|
quiet_cmd_inat_tables = GEN $@
|
2009-12-07 20:00:33 +03:00
|
|
|
cmd_inat_tables = $(AWK) -f $(inat_tables_script) $(inat_tables_maps) > $@ || rm -f $@
|
x86: Instruction decoder API
Add x86 instruction decoder to arch-specific libraries. This decoder
can decode x86 instructions used in kernel into prefix, opcode, modrm,
sib, displacement and immediates. This can also show the length of
instructions.
This version introduces instruction attributes for decoding
instructions.
The instruction attribute tables are generated from the opcode map file
(x86-opcode-map.txt) by the generator script(gen-insn-attr-x86.awk).
Currently, the opcode maps are based on opcode maps in Intel(R) 64 and
IA-32 Architectures Software Developers Manual Vol.2: Appendix.A,
and consist of below two types of opcode tables.
1-byte/2-bytes/3-bytes opcodes, which has 256 elements, are
written as below;
Table: table-name
Referrer: escaped-name
opcode: mnemonic|GrpXXX [operand1[,operand2...]] [(extra1)[,(extra2)...] [| 2nd-mnemonic ...]
(or)
opcode: escape # escaped-name
EndTable
Group opcodes, which has 8 elements, are written as below;
GrpTable: GrpXXX
reg: mnemonic [operand1[,operand2...]] [(extra1)[,(extra2)...] [| 2nd-mnemonic ...]
EndTable
These opcode maps include a few SSE and FP opcodes (for setup), because
those opcodes are used in the kernel.
Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Signed-off-by: Jim Keniston <jkenisto@us.ibm.com>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Avi Kivity <avi@redhat.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Frank Ch. Eigler <fche@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Jason Baron <jbaron@redhat.com>
Cc: K.Prasad <prasad@linux.vnet.ibm.com>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Li Zefan <lizf@cn.fujitsu.com>
Cc: Przemysław Pawełczyk <przemyslaw@pawelczyk.it>
Cc: Roland McGrath <roland@redhat.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Tom Zanussi <tzanussi@gmail.com>
Cc: Vegard Nossum <vegard.nossum@gmail.com>
LKML-Reference: <20090813203413.31965.49709.stgit@localhost.localdomain>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
2009-08-14 00:34:13 +04:00
|
|
|
|
|
|
|
$(obj)/inat-tables.c: $(inat_tables_script) $(inat_tables_maps)
|
|
|
|
$(call cmd,inat_tables)
|
|
|
|
|
|
|
|
$(obj)/inat.o: $(obj)/inat-tables.c
|
|
|
|
|
|
|
|
clean-files := inat-tables.c
|
|
|
|
|
2010-01-22 18:01:03 +03:00
|
|
|
obj-$(CONFIG_SMP) += msr-smp.o cache-smp.o
|
2008-01-30 15:32:31 +03:00
|
|
|
|
2008-07-03 19:35:41 +04:00
|
|
|
lib-y := delay.o
|
2008-05-12 23:20:42 +04:00
|
|
|
lib-y += thunk_$(BITS).o
|
2008-06-25 00:40:14 +04:00
|
|
|
lib-y += usercopy_$(BITS).o getuser.o putuser.o
|
2008-01-30 15:32:31 +03:00
|
|
|
lib-y += memcpy_$(BITS).o
|
2009-06-06 15:58:12 +04:00
|
|
|
lib-$(CONFIG_INSTRUCTION_DECODER) += insn.o inat.o
|
2008-01-30 15:32:31 +03:00
|
|
|
|
2009-12-17 02:16:25 +03:00
|
|
|
obj-y += msr.o msr-reg.o msr-reg-export.o
|
2008-01-30 15:32:31 +03:00
|
|
|
|
2007-10-11 13:13:35 +04:00
|
|
|
ifeq ($(CONFIG_X86_32),y)
|
2009-07-03 19:28:57 +04:00
|
|
|
obj-y += atomic64_32.o
|
2010-02-24 12:54:25 +03:00
|
|
|
lib-y += atomic64_cx8_32.o
|
2008-01-30 15:32:31 +03:00
|
|
|
lib-y += checksum_32.o
|
|
|
|
lib-y += strstr_32.o
|
x86: change x86 to use generic find_next_bit
The versions with inline assembly are in fact slower on the machines I
tested them on (in userspace) (Athlon XP 2800+, p4-like Xeon 2.8GHz, AMD
Opteron 270). The i386-version needed a fix similar to 06024f21 to avoid
crashing the benchmark.
Benchmark using: gcc -fomit-frame-pointer -Os. For each bitmap size
1...512, for each possible bitmap with one bit set, for each possible
offset: find the position of the first bit starting at offset. If you
follow ;). Times include setup of the bitmap and checking of the
results.
Athlon Xeon Opteron 32/64bit
x86-specific: 0m3.692s 0m2.820s 0m3.196s / 0m2.480s
generic: 0m2.622s 0m1.662s 0m2.100s / 0m1.572s
If the bitmap size is not a multiple of BITS_PER_LONG, and no set
(cleared) bit is found, find_next_bit (find_next_zero_bit) returns a
value outside of the range [0, size]. The generic version always returns
exactly size. The generic version also uses unsigned long everywhere,
while the x86 versions use a mishmash of int, unsigned (int), long and
unsigned long.
Using the generic version does give a slightly bigger kernel, though.
defconfig: text data bss dec hex filename
x86-specific: 4738555 481232 626688 5846475 5935cb vmlinux (32 bit)
generic: 4738621 481232 626688 5846541 59360d vmlinux (32 bit)
x86-specific: 5392395 846568 724424 6963387 6a40bb vmlinux (64 bit)
generic: 5392458 846568 724424 6963450 6a40fa vmlinux (64 bit)
Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-03-09 23:01:04 +03:00
|
|
|
lib-y += semaphore_32.o string_32.o
|
2010-07-29 03:53:49 +04:00
|
|
|
lib-y += cmpxchg.o
|
2009-10-01 09:30:38 +04:00
|
|
|
ifneq ($(CONFIG_X86_CMPXCHG64),y)
|
2010-02-24 12:54:25 +03:00
|
|
|
lib-y += cmpxchg8b_emu.o atomic64_386_32.o
|
2009-10-01 09:30:38 +04:00
|
|
|
endif
|
2008-01-30 15:32:31 +03:00
|
|
|
lib-$(CONFIG_X86_USE_3DNOW) += mmx_32.o
|
2007-10-11 13:13:35 +04:00
|
|
|
else
|
2010-02-05 17:37:07 +03:00
|
|
|
obj-y += iomap_copy_64.o
|
2008-01-30 15:32:31 +03:00
|
|
|
lib-y += csum-partial_64.o csum-copy_64.o csum-wrappers_64.o
|
|
|
|
lib-y += thunk_64.o clear_page_64.o copy_page_64.o
|
|
|
|
lib-y += memmove_64.o memset_64.o
|
|
|
|
lib-y += copy_user_64.o rwlock_64.o copy_user_nocache_64.o
|
2010-01-13 05:16:42 +03:00
|
|
|
lib-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem_64.o
|
2011-02-28 13:02:24 +03:00
|
|
|
lib-y += cmpxchg16b_emu.o
|
2007-10-11 13:13:35 +04:00
|
|
|
endif
|