📄 xllp_checksum.lst
字号:
ARM macroassembler Page:1
1 00000000 ;******************************************************************************
2 00000000 ;
3 00000000 ; COPYRIGHT (C) 2005 Intel Corporation.
4 00000000 ;
5 00000000 ; This software as well as the software described in it is furnished under
6 00000000 ; license and may only be used or copied in accordance with the terms of the
7 00000000 ; license. The information in this file is furnished for informational use
8 00000000 ; only, is subject to change without notice, and should not be construed as
9 00000000 ; a commitment by Intel Corporation. Intel Corporation assumes no
10 00000000 ; responsibility or liability for any errors or inaccuracies that may appear
11 00000000 ; in this document or any software that may be provided in association with
12 00000000 ; this document.
13 00000000 ;
14 00000000 ; Except as permitted by such license, no part of this document may be
15 00000000 ; reproduced, stored in a retrieval system, or transmitted in any form or by
16 00000000 ; any means without the express written consent of Intel Corporation.
17 00000000 ;
18 00000000 ;******************************************************************************
19 00000000 ; PURPOSE:
20 00000000 ; Checksum routine(s) for use by assembler and C code
21 00000000 ; It was created initially primarily to contain functions that may be needed
22 00000000 ; by both boot and kernel code.
23 00000000 ; If such routines exist in modules that make external references to other modules,
24 00000000 ; unresolved references are prone to be reported by the linker.
25 00000000 ; When the linker needs to pull in a module to resolve an external reference
26 00000000 ; it needs to resolve all external references in that module as well.
27 00000000 ; Functions in this file should therefore not make external references.
28 00000000
29 AREA |.text|, CODE, READONLY, ALIGN=5 ; Align =5 required for "ALIGN 32" to work
30 00000000 ;
31 00000000 INCLUDE xllp_ARM_macros.inc ; for RETURN macro
1 00000000 IF !:DEF: _xllp_arm_macros_included
2 00000000 xllp_arm_macros_included EQU 1
3 00000000 ;******************************************************************************
4 00000000 ;
5 00000000 ; COPYRIGHT (C) 2005 Intel Corporation.
6 00000000 ;
7 00000000 ; This software as well as the software described in it is furnished under
8 00000000 ; license and may only be used or copied in accordance with the terms of the
9 00000000 ; license. The information in this file is furnished for informational use
10 00000000 ; only, is subject to change without notice, and should not be construed as
11 00000000 ; a commitment by Intel Corporation. Intel Corporation assumes no
12 00000000 ; responsibility or liability for any errors or inaccuracies that may appear
13 00000000 ; in this document or any software that may be provided in association with
14 00000000 ; this document.
15 00000000 ;
16 00000000 ; Except as permitted by such license, no part of this document may be
17 00000000 ; reproduced, stored in a retrieval system, or transmitted in any form or by
18 00000000 ; any means without the express written consent of Intel Corporation.
19 00000000 ;
20 00000000 ;******************************************************************************
21 00000000
22 00000000 MACRO
23 00000000 RETURN
24 00000000 IF :DEF: Interworking
25 00000000 IF Interworking :LOR: Thumbing
26 00000000 bx lr
27 00000000 ELSE
28 00000000 mov pc, lr ; return
29 00000000 ENDIF ; ELSE of IF Interworking :LOR: Thumbing
30 00000000 ELSE ; IF :DEF: Interworking
31 00000000 mov pc, lr ; return
32 00000000 ENDIF ; ELSE OF IF :DEF: Interworking
33 00000000
34 00000000 MEND
35 00000000
36 00000000 ;;------------------------------------------------------------------------------
37 00000000 ENDIF
38 00000000 END
32 00000000
33 00000000 ; Functions made public by this file:
34 00000000 ;
35 00000000 EXPORT Xllp_SimpleChecksum
36 00000000
37 00000000 ; This function is linked into both the boot loaders and the kernel image.
38 00000000 ; 1. in resume code that is linked into the boot loader(s)
39 00000000 ; 2. in suspend code that is linked into the kernel image
40 00000000 ; It does not assume existance of a stack.
41 00000000 ; However, if the SP is not zero it is assumed to be valid and registers used are preserved on the stack.
42 00000000 Xllp_SimpleChecksum FUNCTION
43 00000000 ; Args:
44 00000000 ; r0 = buffer address
45 00000000 ; r1 = number of words
46 00000000 ; Reg Use:
47 00000000 ; r0 = accumlating checksum (and checksum returned)
48 00000000 ; r1 = words left
49 00000000 ; r2 = pointer to next buffer word
50 00000000 ; r3 = current buffer word value
51 00000000 ;
52 00000000 ; if SP is non-zero save the registers we'll use
53 00000000 e35d0000 cmp sp, #0
54 00000004 192d401e stmnedb sp!, {r1-r4, lr} ; Push entry mode state onto our stack
55 00000008
56 00000008 e1a02000 mov r2, r0 ; buffer pointer
57 0000000c e59f001c ldr r0, =(0x5A72) ; Pick a non-zero seed.
58 00000010 2
59 00000010 e4923004 ldr r3, [r2], #4 ; get value and increment pointer
60 00000014 e0800003 add r0, r0, r3
61 00000018 e1a00fe0 mov r0, r0, ROR #31 ; Rotate left by one bit position
62 0000001c e2511001 subs r1, r1, #1 ; decrement words left
63 00000020 1afffffa bne %B2
64 00000024
65 00000024 ; if SP is non-zero restore regs we saved
66 00000024 e35d0000 cmp sp, #0
67 00000028 18bd401e ldmneia sp!, {r1-r4, lr} ; Restore regs we used
68 0000002c RETURN
24 0000002c IF :DEF: Interworking
25 0000002c IF Interworking :LOR: Thumbing
26 0000002c e12fff1e bx lr
27 00000030 ELSE
29 00000030 ENDIF ; ELSE of IF Interworking :LOR: Thumbing
30 00000030 ELSE ; IF :DEF: Interworking
32 00000030 ENDIF ; ELSE OF IF :DEF: Interworking
33 00000030
69 00000030 ENDFUNC
70 00000030 ;**************************************************************************************************
71 00000030 END
72 00000030 00005a72 *literal pool: constant
Assembly terminated, errors: 0, warnings: 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -