add missing files for r1764
git-svn-id: svn://kolibrios.org@1765 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
9883e4f56f
commit
e2999eaedd
68
data/eng/doexe2.asm
Normal file
68
data/eng/doexe2.asm
Normal file
@ -0,0 +1,68 @@
|
||||
filename equ '%EXENAME%'
|
||||
|
||||
virtual at 0
|
||||
file filename:3Ch,4
|
||||
load pehea dword from 0
|
||||
file filename:pehea,0F8h+28h*3
|
||||
load NumberOfSections word from 4+6
|
||||
load SizeOfOptionalHeader word from 4+14h
|
||||
if NumberOfSections<>3
|
||||
error Expected three sections, .text, .bss and .reloc
|
||||
end if
|
||||
if SizeOfOptionalHeader<>0E0h
|
||||
error Nonstandard PE header
|
||||
end if
|
||||
load RelocsRVA dword from 4+0A0h
|
||||
load RelocsSize dword from 4+0A4h
|
||||
load ImageBase dword from 4+34h
|
||||
load TextRVA dword from 4+0F8h+0Ch
|
||||
load TextSize dword from 4+0F8h+8
|
||||
load TextOffs dword from 4+0F8h+14h
|
||||
load BSSSize dword from 4+0F8h+28h+10h
|
||||
load RelocRVA dword from 4+0F8h+28h*2+0Ch
|
||||
load RelocOffs dword from 4+0F8h+28h*2+14h
|
||||
if BSSSize
|
||||
error Second section expected to be .bss
|
||||
end if
|
||||
if RelocRVA<>RelocsRVA
|
||||
error Third section expected to be .reloc
|
||||
end if
|
||||
;file 'test.exe':pehea+0F8h,28h
|
||||
;load physofs dword from 4+14h
|
||||
;load mem dword from 4+8
|
||||
;file 'test.exe':physofs+16,4
|
||||
;load sz dword from $-4
|
||||
end virtual
|
||||
|
||||
file filename:TextOffs,TextSize
|
||||
|
||||
while RelocsSize>8
|
||||
virtual at 0
|
||||
file filename:RelocOffs,8
|
||||
load CurRelocPage dword from 0
|
||||
load CurRelocChunkSize dword from 4
|
||||
end virtual
|
||||
RelocsSize=RelocsSize-CurRelocChunkSize
|
||||
CurRelocChunkSize = CurRelocChunkSize-8
|
||||
RelocOffs=RelocOffs+8
|
||||
while CurRelocChunkSize
|
||||
virtual at 0
|
||||
file filename:RelocOffs,2
|
||||
RelocOffs=RelocOffs+2
|
||||
CurRelocChunkSize=CurRelocChunkSize-2
|
||||
load s word from 0
|
||||
end virtual
|
||||
CurRelocType = s shr 12
|
||||
RelocItem = CurRelocPage + (s and 0xFFF)
|
||||
if CurRelocType=0
|
||||
else if CurRelocType=3
|
||||
load z dword from RelocItem-TextRVA
|
||||
store dword z-(TextRVA+ImageBase) at RelocItem-TextRVA
|
||||
else
|
||||
error Unexpected relocation type
|
||||
end if
|
||||
end while
|
||||
end while
|
||||
|
||||
store dword TextSize at 10h
|
||||
store dword RelocRVA-TextRVA at 14h
|
68
data/rus/doexe2.asm
Normal file
68
data/rus/doexe2.asm
Normal file
@ -0,0 +1,68 @@
|
||||
filename equ '%EXENAME%'
|
||||
|
||||
virtual at 0
|
||||
file filename:3Ch,4
|
||||
load pehea dword from 0
|
||||
file filename:pehea,0F8h+28h*3
|
||||
load NumberOfSections word from 4+6
|
||||
load SizeOfOptionalHeader word from 4+14h
|
||||
if NumberOfSections<>3
|
||||
error Expected three sections, .text, .bss and .reloc
|
||||
end if
|
||||
if SizeOfOptionalHeader<>0E0h
|
||||
error Nonstandard PE header
|
||||
end if
|
||||
load RelocsRVA dword from 4+0A0h
|
||||
load RelocsSize dword from 4+0A4h
|
||||
load ImageBase dword from 4+34h
|
||||
load TextRVA dword from 4+0F8h+0Ch
|
||||
load TextSize dword from 4+0F8h+8
|
||||
load TextOffs dword from 4+0F8h+14h
|
||||
load BSSSize dword from 4+0F8h+28h+10h
|
||||
load RelocRVA dword from 4+0F8h+28h*2+0Ch
|
||||
load RelocOffs dword from 4+0F8h+28h*2+14h
|
||||
if BSSSize
|
||||
error Second section expected to be .bss
|
||||
end if
|
||||
if RelocRVA<>RelocsRVA
|
||||
error Third section expected to be .reloc
|
||||
end if
|
||||
;file 'test.exe':pehea+0F8h,28h
|
||||
;load physofs dword from 4+14h
|
||||
;load mem dword from 4+8
|
||||
;file 'test.exe':physofs+16,4
|
||||
;load sz dword from $-4
|
||||
end virtual
|
||||
|
||||
file filename:TextOffs,TextSize
|
||||
|
||||
while RelocsSize>8
|
||||
virtual at 0
|
||||
file filename:RelocOffs,8
|
||||
load CurRelocPage dword from 0
|
||||
load CurRelocChunkSize dword from 4
|
||||
end virtual
|
||||
RelocsSize=RelocsSize-CurRelocChunkSize
|
||||
CurRelocChunkSize = CurRelocChunkSize-8
|
||||
RelocOffs=RelocOffs+8
|
||||
while CurRelocChunkSize
|
||||
virtual at 0
|
||||
file filename:RelocOffs,2
|
||||
RelocOffs=RelocOffs+2
|
||||
CurRelocChunkSize=CurRelocChunkSize-2
|
||||
load s word from 0
|
||||
end virtual
|
||||
CurRelocType = s shr 12
|
||||
RelocItem = CurRelocPage + (s and 0xFFF)
|
||||
if CurRelocType=0
|
||||
else if CurRelocType=3
|
||||
load z dword from RelocItem-TextRVA
|
||||
store dword z-(TextRVA+ImageBase) at RelocItem-TextRVA
|
||||
else
|
||||
error Unexpected relocation type
|
||||
end if
|
||||
end while
|
||||
end while
|
||||
|
||||
store dword TextSize at 10h
|
||||
store dword RelocRVA-TextRVA at 14h
|
31
drivers/include/linux/compiler-gcc3.h
Normal file
31
drivers/include/linux/compiler-gcc3.h
Normal file
@ -0,0 +1,31 @@
|
||||
#ifndef __LINUX_COMPILER_H
|
||||
#error "Please don't include <linux/compiler-gcc3.h> directly, include <linux/compiler.h> instead."
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ < 2
|
||||
# error Sorry, your compiler is too old - please upgrade it.
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ >= 3
|
||||
# define __used __attribute__((__used__))
|
||||
#else
|
||||
# define __used __attribute__((__unused__))
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ >= 4
|
||||
#define __must_check __attribute__((warn_unused_result))
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_GCOV_KERNEL
|
||||
# if __GNUC_MINOR__ < 4
|
||||
# error "GCOV profiling support for gcc versions below 3.4 not included"
|
||||
# endif /* __GNUC_MINOR__ */
|
||||
#endif /* CONFIG_GCOV_KERNEL */
|
||||
|
||||
/*
|
||||
* A trick to suppress uninitialized variable warning without generating any
|
||||
* code
|
||||
*/
|
||||
#define uninitialized_var(x) x = x
|
||||
|
||||
#define __always_inline inline __attribute__((always_inline))
|
11
programs/other/graph/memcpy.asm
Normal file
11
programs/other/graph/memcpy.asm
Normal file
@ -0,0 +1,11 @@
|
||||
format MS COFF
|
||||
section '.text' code readable executable
|
||||
public _memcpy
|
||||
_memcpy:
|
||||
push esi edi
|
||||
mov edi, [esp+12]
|
||||
mov esi, [esp+16]
|
||||
mov ecx, [esp+20]
|
||||
rep movsb
|
||||
pop edi esi
|
||||
ret
|
11
programs/other/graph/memset.asm
Normal file
11
programs/other/graph/memset.asm
Normal file
@ -0,0 +1,11 @@
|
||||
format MS COFF
|
||||
section '.text' code readable executable
|
||||
public _memset
|
||||
_memset:
|
||||
push edi
|
||||
mov edi, [esp+8]
|
||||
mov al, [esp+12]
|
||||
mov ecx, [esp+16]
|
||||
rep stosb
|
||||
pop edi
|
||||
ret
|
Loading…
Reference in New Issue
Block a user