File: bundle-lock.s

package info (click to toggle)
binutils 2.31.1-16
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 309,412 kB
  • sloc: ansic: 1,161,194; asm: 638,508; cpp: 128,829; exp: 68,580; makefile: 55,828; sh: 22,360; yacc: 14,238; lisp: 13,272; perl: 2,111; ada: 1,681; lex: 1,652; pascal: 1,446; cs: 879; sed: 195; python: 154; xml: 95; awk: 25
file content (103 lines) | stat: -rw-r--r-- 1,923 bytes parent folder | download | duplicates (21)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
	.bundle_align_mode 5

# We use these macros to test each pattern at every offset from
# bundle alignment, i.e. [0,31].

.macro offset_sequence size, offset
	.p2align 5
sequence_\size\()_offset_\offset\():
	.if \offset
	.space \offset, 0xf4
	.endif
	test_sequence \size
.endm

.macro test_offsets size
	offset_sequence \size, 0
	offset_sequence \size, 1
	offset_sequence \size, 2
	offset_sequence \size, 3
	offset_sequence \size, 4
	offset_sequence \size, 5
	offset_sequence \size, 6
	offset_sequence \size, 7
	offset_sequence \size, 8
	offset_sequence \size, 9
	offset_sequence \size, 10
	offset_sequence \size, 11
	offset_sequence \size, 12
	offset_sequence \size, 13
	offset_sequence \size, 14
	offset_sequence \size, 15
	offset_sequence \size, 16
	offset_sequence \size, 17
	offset_sequence \size, 18
	offset_sequence \size, 19
	offset_sequence \size, 20
	offset_sequence \size, 21
	offset_sequence \size, 22
	offset_sequence \size, 23
	offset_sequence \size, 24
	offset_sequence \size, 25
	offset_sequence \size, 26
	offset_sequence \size, 27
	offset_sequence \size, 28
	offset_sequence \size, 29
	offset_sequence \size, 30
	offset_sequence \size, 31
.endm

.macro test_sequence size
	.bundle_lock
	clc
	.rept \size - 1
	cld
	.endr
	.bundle_unlock
.endm

	test_offsets 1
	test_offsets 2
	test_offsets 3
	test_offsets 4
	test_offsets 5
	test_offsets 6
	test_offsets 7
	test_offsets 8
	test_offsets 9
	test_offsets 10
	test_offsets 11
	test_offsets 12
	test_offsets 13
	test_offsets 14
	test_offsets 15
	test_offsets 16
	test_offsets 17
	test_offsets 18
	test_offsets 19
	test_offsets 20
	test_offsets 21
	test_offsets 22
	test_offsets 23
	test_offsets 24
	test_offsets 25
	test_offsets 26
	test_offsets 27
	test_offsets 28
	test_offsets 29
	test_offsets 30
	test_offsets 31
	test_offsets 32

.p2align 5
	# Nested .bundle_lock.
	.bundle_lock
	clc
	.bundle_lock
	cld
	.bundle_unlock
	clc
	.bundle_unlock

.p2align 5
	hlt