diff options
author | jkim <jkim@FreeBSD.org> | 2007-03-31 01:47:37 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2007-03-31 01:47:37 +0000 |
commit | 19c0211d4d790020fc7cd2c3c3cac58166948247 (patch) | |
tree | 190003f7099f261e54c82c1c99acc237262890f6 /sys | |
parent | 0b07299b2a5b31b1d180e7f8114a9aa0a092a9d0 (diff) | |
download | FreeBSD-src-19c0211d4d790020fc7cd2c3c3cac58166948247.zip FreeBSD-src-19c0211d4d790020fc7cd2c3c3cac58166948247.tar.gz |
Correct BB-profiling and adjust comments.
Pointed out by: bde
Reviewed by: bde
Diffstat (limited to 'sys')
-rw-r--r-- | sys/amd64/amd64/support.S | 44 | ||||
-rw-r--r-- | sys/i386/i386/support.s | 47 |
2 files changed, 45 insertions, 46 deletions
diff --git a/sys/amd64/amd64/support.S b/sys/amd64/amd64/support.S index eede26a..c828877 100644 --- a/sys/amd64/amd64/support.S +++ b/sys/amd64/amd64/support.S @@ -671,33 +671,15 @@ ENTRY(longjmp) incl %eax ret -/* - * Support for BB-profiling (gcc -a). The kernbb program will extract - * the data from the kernel. - */ - - .data - ALIGN_DATA - .globl bbhead -bbhead: - .quad 0 - - .text -NON_GPROF_ENTRY(__bb_init_func) - movq $1,(%rdi) - movq bbhead,%rax - movq %rax,32(%rdi) - movq %rdi,bbhead - NON_GPROF_RET - - .text +/*****************************************************************************/ +/* linux_futex support */ +/*****************************************************************************/ futex_fault: movq $0,PCB_ONFAULT(%rcx) movq $-EFAULT,%rax ret -/* int futex_xchgl(int oparg, caddr_t uaddr, int *oldval); */ ENTRY(futex_xchgl) movq PCPU(CURPCB),%rcx movq $futex_fault,PCB_ONFAULT(%rcx) @@ -715,7 +697,6 @@ ENTRY(futex_xchgl) movq %rax,PCB_ONFAULT(%rcx) ret -/* int futex_addl(int oparg, caddr_t uaddr, int *oldval); */ ENTRY(futex_addl) movq PCPU(CURPCB),%rcx movq $futex_fault,PCB_ONFAULT(%rcx) @@ -732,3 +713,22 @@ ENTRY(futex_addl) xorl %eax,%eax movq %rax,PCB_ONFAULT(%rcx) ret + +/* + * Support for BB-profiling (gcc -a). The kernbb program will extract + * the data from the kernel. + */ + + .data + ALIGN_DATA + .globl bbhead +bbhead: + .quad 0 + + .text +NON_GPROF_ENTRY(__bb_init_func) + movq $1,(%rdi) + movq bbhead,%rax + movq %rax,32(%rdi) + movq %rdi,bbhead + NON_GPROF_RET diff --git a/sys/i386/i386/support.s b/sys/i386/i386/support.s index 546698e..7d49f01 100644 --- a/sys/i386/i386/support.s +++ b/sys/i386/i386/support.s @@ -1513,35 +1513,15 @@ ENTRY(longjmp) incl %eax ret -/* - * Support for BB-profiling (gcc -a). The kernbb program will extract - * the data from the kernel. - */ - - .data - ALIGN_DATA - .globl bbhead -bbhead: - .long 0 - - .text -NON_GPROF_ENTRY(__bb_init_func) - movl 4(%esp),%eax - movl $1,(%eax) - movl bbhead,%edx - movl %edx,16(%eax) - movl %eax,bbhead - NON_GPROF_RET - -/* necessary for linux_futex support */ - .text +/*****************************************************************************/ +/* linux_futex support */ +/*****************************************************************************/ futex_fault: movl $0,PCB_ONFAULT(%ecx) movl $-EFAULT,%eax ret -/* int futex_xchgl(int oparg, caddr_t uaddr, int *oldval); */ ENTRY(futex_xchgl) movl PCPU(CURPCB),%ecx movl $futex_fault,PCB_ONFAULT(%ecx) @@ -1560,7 +1540,6 @@ ENTRY(futex_xchgl) movl $0,PCB_ONFAULT(%ecx) ret -/* int futex_addl(int oparg, caddr_t uaddr, int *oldval); */ ENTRY(futex_addl) movl PCPU(CURPCB),%ecx movl $futex_fault,PCB_ONFAULT(%ecx) @@ -1578,3 +1557,23 @@ ENTRY(futex_addl) xorl %eax,%eax movl $0,PCB_ONFAULT(%ecx) ret + +/* + * Support for BB-profiling (gcc -a). The kernbb program will extract + * the data from the kernel. + */ + + .data + ALIGN_DATA + .globl bbhead +bbhead: + .long 0 + + .text +NON_GPROF_ENTRY(__bb_init_func) + movl 4(%esp),%eax + movl $1,(%eax) + movl bbhead,%edx + movl %edx,16(%eax) + movl %eax,bbhead + NON_GPROF_RET |