diff options
author | jkoshy <jkoshy@FreeBSD.org> | 2007-08-22 05:06:14 +0000 |
---|---|---|
committer | jkoshy <jkoshy@FreeBSD.org> | 2007-08-22 05:06:14 +0000 |
commit | 8e094e5065828429b3637d88bd24d896ae848454 (patch) | |
tree | 89e93fd56f4931356cd8fcfd4bbb99dc80f3da98 /sys | |
parent | 106a0e34d4aa75f6872600089a1f168bebf94828 (diff) | |
download | FreeBSD-src-8e094e5065828429b3637d88bd24d896ae848454.zip FreeBSD-src-8e094e5065828429b3637d88bd24d896ae848454.tar.gz |
Assign sizes to assembly language support functions.
Approved by: re (kensmith)
Diffstat (limited to 'sys')
-rw-r--r-- | sys/amd64/amd64/cpu_switch.S | 5 | ||||
-rw-r--r-- | sys/amd64/amd64/support.S | 33 | ||||
-rw-r--r-- | sys/i386/i386/support.s | 44 | ||||
-rw-r--r-- | sys/i386/i386/swtch.s | 3 |
4 files changed, 77 insertions, 8 deletions
diff --git a/sys/amd64/amd64/cpu_switch.S b/sys/amd64/amd64/cpu_switch.S index a5c7c01..d584004 100644 --- a/sys/amd64/amd64/cpu_switch.S +++ b/sys/amd64/amd64/cpu_switch.S @@ -81,6 +81,7 @@ ENTRY(cpu_throw) movq PCB_CR3(%rdx),%rdx movq %rdx,%cr3 /* new address space */ jmp swact +END(cpu_throw) /* * cpu_switch(old, new, mtx) @@ -256,7 +257,8 @@ sw1: movq %rax,%dr7 1: ret - +END(cpu_switch) + /* * savectx(pcb) * Update pcb, saving current processor state. @@ -314,3 +316,4 @@ ENTRY(savectx) popfq ret +END(savectx) diff --git a/sys/amd64/amd64/support.S b/sys/amd64/amd64/support.S index 782cde9..2f2a3f1 100644 --- a/sys/amd64/amd64/support.S +++ b/sys/amd64/amd64/support.S @@ -69,7 +69,8 @@ ENTRY(bzero) rep stosb ret - +END(bzero) + /* Address: %rdi */ ENTRY(pagezero) movq $-PAGE_SIZE,%rdx @@ -84,6 +85,7 @@ ENTRY(pagezero) jne 1b sfence ret +END(pagezero) ENTRY(bcmp) movq %rdx,%rcx @@ -101,6 +103,7 @@ ENTRY(bcmp) setne %al movsbl %al,%eax ret +END(bcmp) /* * bcopy(src, dst, cnt) @@ -144,7 +147,8 @@ ENTRY(bcopy) movsq cld ret - +END(bcopy) + /* * Note: memcpy does not support overlapping copies */ @@ -159,6 +163,7 @@ ENTRY(memcpy) rep movsb ret +END(memcpy) /* * pagecopy(%rdi=from, %rsi=to) @@ -185,6 +190,7 @@ ENTRY(pagecopy) jne 2b sfence ret +END(pagecopy) /* fillw(pat, base, cnt) */ /* %rdi,%rsi, %rdx */ @@ -196,6 +202,7 @@ ENTRY(fillw) rep stosw ret +END(fillw) /*****************************************************************************/ /* copyout and fubyte family */ @@ -267,6 +274,7 @@ copyout_fault: movq $0,PCB_ONFAULT(%rdx) movq $EFAULT,%rax ret +END(copyout) /* * copyin(from_user, to_kernel, len) - MP SAFE @@ -312,6 +320,7 @@ copyin_fault: movq $0,PCB_ONFAULT(%rdx) movq $EFAULT,%rax ret +END(copyin) /* * casuword32. Compare and set user integer. Returns -1 or the current value. @@ -340,6 +349,7 @@ ENTRY(casuword32) movq PCPU(CURPCB),%rcx movq $0,PCB_ONFAULT(%rcx) ret +END(casuword32) /* * casuword. Compare and set user word. Returns -1 or the current value. @@ -369,6 +379,7 @@ ENTRY(casuword) movq $fusufault,PCB_ONFAULT(%rcx) movq $0,PCB_ONFAULT(%rcx) ret +END(casuword) /* * Fetch (load) a 64-bit word, a 32-bit word, a 16-bit word, or an 8-bit @@ -388,6 +399,8 @@ ENTRY(fuword) movq (%rdi),%rax movq $0,PCB_ONFAULT(%rcx) ret +END(fuword64) +END(fuword) ENTRY(fuword32) movq PCPU(CURPCB),%rcx @@ -400,6 +413,7 @@ ENTRY(fuword32) movl (%rdi),%eax movq $0,PCB_ONFAULT(%rcx) ret +END(fuword32) /* * fuswintr() and suswintr() are specialized variants of fuword16() and @@ -412,6 +426,8 @@ ALTENTRY(suswintr) ENTRY(fuswintr) movq $-1,%rax ret +END(suswintr) +END(fuswintr) ENTRY(fuword16) movq PCPU(CURPCB),%rcx @@ -424,6 +440,7 @@ ENTRY(fuword16) movzwl (%rdi),%eax movq $0,PCB_ONFAULT(%rcx) ret +END(fuword16) ENTRY(fubyte) movq PCPU(CURPCB),%rcx @@ -436,6 +453,7 @@ ENTRY(fubyte) movzbl (%rdi),%eax movq $0,PCB_ONFAULT(%rcx) ret +END(fubyte) ALIGN_TEXT fusufault: @@ -464,6 +482,8 @@ ENTRY(suword) movq PCPU(CURPCB),%rcx movq %rax,PCB_ONFAULT(%rcx) ret +END(suword64) +END(suword) ENTRY(suword32) movq PCPU(CURPCB),%rcx @@ -478,6 +498,7 @@ ENTRY(suword32) movq PCPU(CURPCB),%rcx movq %rax,PCB_ONFAULT(%rcx) ret +END(suword32) ENTRY(suword16) movq PCPU(CURPCB),%rcx @@ -492,6 +513,7 @@ ENTRY(suword16) movq PCPU(CURPCB),%rcx /* restore trashed register */ movq %rax,PCB_ONFAULT(%rcx) ret +END(suword16) ENTRY(subyte) movq PCPU(CURPCB),%rcx @@ -507,6 +529,7 @@ ENTRY(subyte) movq PCPU(CURPCB),%rcx /* restore trashed register */ movq %rax,PCB_ONFAULT(%rcx) ret +END(subyte) /* * copyinstr(from, to, maxlen, int *lencopied) - MP SAFE @@ -575,7 +598,7 @@ cpystrflt_x: movq %r8,(%r9) 1: ret - +END(copyinstr) /* * copystr(from, to, maxlen, int *lencopied) - MP SAFE @@ -612,6 +635,7 @@ ENTRY(copystr) movq %r8,(%rcx) 7: ret +END(copystr) /* * Handling of special amd64 registers and descriptor tables etc @@ -639,6 +663,7 @@ ENTRY(lgdt) pushq %rax MEXITCOUNT lretq +END(lgdt) /*****************************************************************************/ /* setjump, longjump */ @@ -656,6 +681,7 @@ ENTRY(setjmp) movq %rdx,56(%rdi) /* save rip */ xorl %eax,%eax /* return(0); */ ret +END(setjmp) ENTRY(longjmp) movq 0(%rdi),%rbx /* restore rbx */ @@ -670,6 +696,7 @@ ENTRY(longjmp) xorl %eax,%eax /* return(1); */ incl %eax ret +END(longjmp) /* * Support for BB-profiling (gcc -a). The kernbb program will extract diff --git a/sys/i386/i386/support.s b/sys/i386/i386/support.s index 0f34525..d5c5096 100644 --- a/sys/i386/i386/support.s +++ b/sys/i386/i386/support.s @@ -80,6 +80,7 @@ eintrnames: ENTRY(bzero) MEXITCOUNT jmp *bzero_vector +END(bzero) ENTRY(generic_bzero) pushl %edi @@ -96,7 +97,8 @@ ENTRY(generic_bzero) stosb popl %edi ret - +END(generic_bzero) + #ifdef I486_CPU ENTRY(i486_bzero) movl 4(%esp),%edx @@ -197,6 +199,7 @@ do1: SUPERALIGN_TEXT do0: ret +END(i486_bzero) #endif #if defined(I586_CPU) && defined(DEV_NPX) @@ -355,6 +358,7 @@ intreg_i586_bzero: stosb popl %edi ret +END(i586_bzero) #endif /* I586_CPU && defined(DEV_NPX) */ ENTRY(sse2_pagezero) @@ -371,6 +375,7 @@ ENTRY(sse2_pagezero) sfence popl %ebx ret +END(sse2_pagezero) ENTRY(i686_pagezero) pushl %edi @@ -421,6 +426,7 @@ ENTRY(i686_pagezero) popl %ebx popl %edi ret +END(i686_pagezero) /* fillw(pat, base, cnt) */ ENTRY(fillw) @@ -433,6 +439,7 @@ ENTRY(fillw) stosw popl %edi ret +END(fillw) ENTRY(bcopyb) pushl %esi @@ -464,10 +471,12 @@ ENTRY(bcopyb) popl %esi cld ret +END(bcopyb) ENTRY(bcopy) MEXITCOUNT jmp *bcopy_vector +END(bcopy) /* * generic_bcopy(src, dst, cnt) @@ -517,6 +526,7 @@ ENTRY(generic_bcopy) popl %esi cld ret +END(generic_bcopy) #if defined(I586_CPU) && defined(DEV_NPX) ENTRY(i586_bcopy) @@ -665,6 +675,7 @@ small_i586_bcopy: popl %esi cld ret +END(i586_bcopy) #endif /* I586_CPU && defined(DEV_NPX) */ /* @@ -688,7 +699,7 @@ ENTRY(memcpy) popl %esi popl %edi ret - +END(memcpy) /*****************************************************************************/ /* copyout and fubyte family */ @@ -714,6 +725,7 @@ ENTRY(memcpy) ENTRY(copyout) MEXITCOUNT jmp *copyout_vector +END(copyout) ENTRY(generic_copyout) movl PCPU(CURPCB),%eax @@ -773,6 +785,7 @@ done_copyout: movl PCPU(CURPCB),%edx movl %eax,PCB_ONFAULT(%edx) ret +END(generic_copyout) ALIGN_TEXT copyout_fault: @@ -836,6 +849,7 @@ ENTRY(i586_copyout) call fastmove addl $4,%esp jmp done_copyout +END(i586_copyout) #endif /* I586_CPU && defined(DEV_NPX) */ /* @@ -844,6 +858,7 @@ ENTRY(i586_copyout) ENTRY(copyin) MEXITCOUNT jmp *copyin_vector +END(copyin) ENTRY(generic_copyin) movl PCPU(CURPCB),%eax @@ -887,6 +902,7 @@ done_copyin: movl PCPU(CURPCB),%edx movl %eax,PCB_ONFAULT(%edx) ret +END(generic_copyin) ALIGN_TEXT copyin_fault: @@ -930,6 +946,7 @@ ENTRY(i586_copyin) call fastmove addl $8,%esp jmp done_copyin +END(i586_copyin) #endif /* I586_CPU && defined(DEV_NPX) */ #if defined(I586_CPU) && defined(DEV_NPX) @@ -1137,6 +1154,7 @@ fastmove_tail_fault: movl $0,PCB_ONFAULT(%edx) movl $EFAULT,%eax ret +END(fastmove) #endif /* I586_CPU && defined(DEV_NPX) */ /* @@ -1169,6 +1187,8 @@ ENTRY(casuword) movl $fusufault,PCB_ONFAULT(%ecx) movl $0,PCB_ONFAULT(%ecx) ret +END(casuword32) +END(casuword) /* * Fetch (load) a 32-bit word, a 16-bit word, or an 8-bit byte from user @@ -1187,6 +1207,8 @@ ENTRY(fuword) movl (%edx),%eax movl $0,PCB_ONFAULT(%ecx) ret +END(fuword32) +END(fuword) /* * fuswintr() and suswintr() are specialized variants of fuword16() and @@ -1199,6 +1221,8 @@ ALTENTRY(suswintr) ENTRY(fuswintr) movl $-1,%eax ret +END(suswintr) +END(fuswintr) ENTRY(fuword16) movl PCPU(CURPCB),%ecx @@ -1211,6 +1235,7 @@ ENTRY(fuword16) movzwl (%edx),%eax movl $0,PCB_ONFAULT(%ecx) ret +END(fuword16) ENTRY(fubyte) movl PCPU(CURPCB),%ecx @@ -1223,6 +1248,7 @@ ENTRY(fubyte) movzbl (%edx),%eax movl $0,PCB_ONFAULT(%ecx) ret +END(fubyte) ALIGN_TEXT fusufault: @@ -1252,6 +1278,8 @@ ENTRY(suword) movl PCPU(CURPCB),%ecx movl %eax,PCB_ONFAULT(%ecx) ret +END(suword32) +END(suword) ENTRY(suword16) movl PCPU(CURPCB),%ecx @@ -1267,6 +1295,7 @@ ENTRY(suword16) movl PCPU(CURPCB),%ecx /* restore trashed register */ movl %eax,PCB_ONFAULT(%ecx) ret +END(suword16) ENTRY(subyte) movl PCPU(CURPCB),%ecx @@ -1282,6 +1311,7 @@ ENTRY(subyte) movl PCPU(CURPCB),%ecx /* restore trashed register */ movl %eax,PCB_ONFAULT(%ecx) ret +END(subyte) /* * copyinstr(from, to, maxlen, int *lencopied) - MP SAFE @@ -1354,7 +1384,7 @@ cpystrflt_x: popl %edi popl %esi ret - +END(copyinstr) /* * copystr(from, to, maxlen, int *lencopied) - MP SAFE @@ -1396,6 +1426,7 @@ ENTRY(copystr) popl %edi popl %esi ret +END(copystr) ENTRY(bcmp) pushl %edi @@ -1421,7 +1452,7 @@ ENTRY(bcmp) popl %esi popl %edi ret - +END(bcmp) /* * Handling of special 386 registers and descriptor tables etc @@ -1451,6 +1482,7 @@ ENTRY(lgdt) movl $KCSEL,4(%esp) MEXITCOUNT lret +END(lgdt) /* ssdtosd(*ssdp,*sdp) */ ENTRY(ssdtosd) @@ -1472,6 +1504,7 @@ ENTRY(ssdtosd) movl %ebx,4(%ecx) popl %ebx ret +END(ssdtosd) /* void reset_dbregs() */ ENTRY(reset_dbregs) @@ -1483,6 +1516,7 @@ ENTRY(reset_dbregs) movl %eax,%dr3 movl %eax,%dr6 ret +END(reset_dbregs) /*****************************************************************************/ /* setjump, longjump */ @@ -1499,6 +1533,7 @@ ENTRY(setjmp) movl %edx,20(%eax) /* save eip */ xorl %eax,%eax /* return(0); */ ret +END(setjmp) ENTRY(longjmp) movl 4(%esp),%eax @@ -1512,6 +1547,7 @@ ENTRY(longjmp) xorl %eax,%eax /* return(1); */ incl %eax ret +END(longjmp) /* * Support for BB-profiling (gcc -a). The kernbb program will extract diff --git a/sys/i386/i386/swtch.s b/sys/i386/i386/swtch.s index e47de5e..6ffd5d5 100644 --- a/sys/i386/i386/swtch.s +++ b/sys/i386/i386/swtch.s @@ -99,6 +99,7 @@ ENTRY(cpu_throw) #endif btsl %esi, PM_ACTIVE(%ebx) /* set new */ jmp sw1 +END(cpu_throw) /* * cpu_switch(old, new) @@ -348,6 +349,7 @@ badsw3: call panic sw0_3: .asciz "cpu_switch: no newthread supplied" #endif +END(cpu_switch) /* * savectx(pcb) @@ -413,3 +415,4 @@ ENTRY(savectx) #endif /* DEV_NPX */ ret +END(savectx) |