-
Notifications
You must be signed in to change notification settings - Fork 1
/
timesync.dis
3766 lines (3601 loc) · 132 KB
/
timesync.dis
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
timesync: file format elf32-littlearm
Disassembly of section .init:
00010874 <_init>:
10874: e92d4008 push {r3, lr}
10878: eb00005c bl 109f0 <call_weak_fn>
1087c: e8bd8008 pop {r3, pc}
Disassembly of section .plt:
00010880 <open@plt-0x14>:
10880: e52de004 push {lr} ; (str lr, [sp, #-4]!)
10884: e59fe004 ldr lr, [pc, #4] ; 10890 <_init+0x1c>
10888: e08fe00e add lr, pc, lr
1088c: e5bef008 ldr pc, [lr, #8]!
10890: 000122b0 .word 0x000122b0
00010894 <open@plt>:
10894: e28fc600 add ip, pc, #0, 12
10898: e28cca12 add ip, ip, #73728 ; 0x12000
1089c: e5bcf2b0 ldr pc, [ip, #688]! ; 0x2b0
000108a0 <mmap@plt>:
108a0: e28fc600 add ip, pc, #0, 12
108a4: e28cca12 add ip, ip, #73728 ; 0x12000
108a8: e5bcf2a8 ldr pc, [ip, #680]! ; 0x2a8
000108ac <abort@plt>:
108ac: e28fc600 add ip, pc, #0, 12
108b0: e28cca12 add ip, ip, #73728 ; 0x12000
108b4: e5bcf2a0 ldr pc, [ip, #672]! ; 0x2a0
000108b8 <memcmp@plt>:
108b8: e28fc600 add ip, pc, #0, 12
108bc: e28cca12 add ip, ip, #73728 ; 0x12000
108c0: e5bcf298 ldr pc, [ip, #664]! ; 0x298
000108c4 <__libc_start_main@plt>:
108c4: e28fc600 add ip, pc, #0, 12
108c8: e28cca12 add ip, ip, #73728 ; 0x12000
108cc: e5bcf290 ldr pc, [ip, #656]! ; 0x290
000108d0 <clock_gettime@plt>:
108d0: e28fc600 add ip, pc, #0, 12
108d4: e28cca12 add ip, ip, #73728 ; 0x12000
108d8: e5bcf288 ldr pc, [ip, #648]! ; 0x288
000108dc <__gmon_start__@plt>:
108dc: e28fc600 add ip, pc, #0, 12
108e0: e28cca12 add ip, ip, #73728 ; 0x12000
108e4: e5bcf280 ldr pc, [ip, #640]! ; 0x280
000108e8 <putchar@plt>:
108e8: e28fc600 add ip, pc, #0, 12
108ec: e28cca12 add ip, ip, #73728 ; 0x12000
108f0: e5bcf278 ldr pc, [ip, #632]! ; 0x278
000108f4 <calloc@plt>:
108f4: e28fc600 add ip, pc, #0, 12
108f8: e28cca12 add ip, ip, #73728 ; 0x12000
108fc: e5bcf270 ldr pc, [ip, #624]! ; 0x270
00010900 <memset@plt>:
10900: e28fc600 add ip, pc, #0, 12
10904: e28cca12 add ip, ip, #73728 ; 0x12000
10908: e5bcf268 ldr pc, [ip, #616]! ; 0x268
0001090c <perror@plt>:
1090c: e28fc600 add ip, pc, #0, 12
10910: e28cca12 add ip, ip, #73728 ; 0x12000
10914: e5bcf260 ldr pc, [ip, #608]! ; 0x260
00010918 <__assert_fail@plt>:
10918: e28fc600 add ip, pc, #0, 12
1091c: e28cca12 add ip, ip, #73728 ; 0x12000
10920: e5bcf258 ldr pc, [ip, #600]! ; 0x258
00010924 <free@plt>:
10924: e28fc600 add ip, pc, #0, 12
10928: e28cca12 add ip, ip, #73728 ; 0x12000
1092c: e5bcf250 ldr pc, [ip, #592]! ; 0x250
00010930 <fflush@plt>:
10930: e28fc600 add ip, pc, #0, 12
10934: e28cca12 add ip, ip, #73728 ; 0x12000
10938: e5bcf248 ldr pc, [ip, #584]! ; 0x248
0001093c <ioctl@plt>:
1093c: e28fc600 add ip, pc, #0, 12
10940: e28cca12 add ip, ip, #73728 ; 0x12000
10944: e5bcf240 ldr pc, [ip, #576]! ; 0x240
00010948 <__ubsan_handle_add_overflow@plt>:
10948: e28fc600 add ip, pc, #0, 12
1094c: e28cca12 add ip, ip, #73728 ; 0x12000
10950: e5bcf238 ldr pc, [ip, #568]! ; 0x238
00010954 <printf@plt>:
10954: e28fc600 add ip, pc, #0, 12
10958: e28cca12 add ip, ip, #73728 ; 0x12000
1095c: e5bcf230 ldr pc, [ip, #560]! ; 0x230
00010960 <__ubsan_handle_shift_out_of_bounds@plt>:
10960: e28fc600 add ip, pc, #0, 12
10964: e28cca12 add ip, ip, #73728 ; 0x12000
10968: e5bcf228 ldr pc, [ip, #552]! ; 0x228
0001096c <close@plt>:
1096c: e28fc600 add ip, pc, #0, 12
10970: e28cca12 add ip, ip, #73728 ; 0x12000
10974: e5bcf220 ldr pc, [ip, #544]! ; 0x220
00010978 <malloc@plt>:
10978: e28fc600 add ip, pc, #0, 12
1097c: e28cca12 add ip, ip, #73728 ; 0x12000
10980: e5bcf218 ldr pc, [ip, #536]! ; 0x218
00010984 <__ubsan_handle_type_mismatch@plt>:
10984: e28fc600 add ip, pc, #0, 12
10988: e28cca12 add ip, ip, #73728 ; 0x12000
1098c: e5bcf210 ldr pc, [ip, #528]! ; 0x210
00010990 <puts@plt>:
10990: e28fc600 add ip, pc, #0, 12
10994: e28cca12 add ip, ip, #73728 ; 0x12000
10998: e5bcf208 ldr pc, [ip, #520]! ; 0x208
0001099c <nanosleep@plt>:
1099c: e28fc600 add ip, pc, #0, 12
109a0: e28cca12 add ip, ip, #73728 ; 0x12000
109a4: e5bcf200 ldr pc, [ip, #512]! ; 0x200
000109a8 <strcmp@plt>:
109a8: e28fc600 add ip, pc, #0, 12
109ac: e28cca12 add ip, ip, #73728 ; 0x12000
109b0: e5bcf1f8 ldr pc, [ip, #504]! ; 0x1f8
000109b4 <exit@plt>:
109b4: e28fc600 add ip, pc, #0, 12
109b8: e28cca12 add ip, ip, #73728 ; 0x12000
109bc: e5bcf1f0 ldr pc, [ip, #496]! ; 0x1f0
Disassembly of section .text:
000109c0 <_start>:
109c0: f04f 0b00 mov.w fp, #0
109c4: f04f 0e00 mov.w lr, #0
109c8: bc02 pop {r1}
109ca: 466a mov r2, sp
109cc: b404 push {r2}
109ce: b401 push {r0}
109d0: f8df c010 ldr.w ip, [pc, #16] ; 109e4 <_start+0x24>
109d4: f84d cd04 str.w ip, [sp, #-4]!
109d8: 4803 ldr r0, [pc, #12] ; (109e8 <_start+0x28>)
109da: 4b04 ldr r3, [pc, #16] ; (109ec <_start+0x2c>)
109dc: f7ff ef72 blx 108c4 <__libc_start_main@plt>
109e0: f7ff ef64 blx 108ac <abort@plt>
109e4: 000126b1 .word 0x000126b1
109e8: 00012521 .word 0x00012521
109ec: 00012671 .word 0x00012671
000109f0 <call_weak_fn>:
109f0: e59f3014 ldr r3, [pc, #20] ; 10a0c <call_weak_fn+0x1c>
109f4: e59f2014 ldr r2, [pc, #20] ; 10a10 <call_weak_fn+0x20>
109f8: e08f3003 add r3, pc, r3
109fc: e7932002 ldr r2, [r3, r2]
10a00: e3520000 cmp r2, #0
10a04: 012fff1e bxeq lr
10a08: eaffffb3 b 108dc <__gmon_start__@plt>
10a0c: 00012140 .word 0x00012140
10a10: 00000070 .word 0x00000070
00010a14 <deregister_tm_clones>:
10a14: 4b07 ldr r3, [pc, #28] ; (10a34 <deregister_tm_clones+0x20>)
10a16: f649 504c movw r0, #40268 ; 0x9d4c
10a1a: f2c0 0002 movt r0, #2
10a1e: 1a1b subs r3, r3, r0
10a20: 2b06 cmp r3, #6
10a22: d905 bls.n 10a30 <deregister_tm_clones+0x1c>
10a24: f240 0300 movw r3, #0
10a28: f2c0 0300 movt r3, #0
10a2c: b103 cbz r3, 10a30 <deregister_tm_clones+0x1c>
10a2e: 4718 bx r3
10a30: 4770 bx lr
10a32: bf00 nop
10a34: 00029d4f .word 0x00029d4f
00010a38 <register_tm_clones>:
10a38: f649 534c movw r3, #40268 ; 0x9d4c
10a3c: f649 504c movw r0, #40268 ; 0x9d4c
10a40: f2c0 0302 movt r3, #2
10a44: f2c0 0002 movt r0, #2
10a48: 1a19 subs r1, r3, r0
10a4a: 1089 asrs r1, r1, #2
10a4c: eb01 71d1 add.w r1, r1, r1, lsr #31
10a50: 1049 asrs r1, r1, #1
10a52: d005 beq.n 10a60 <register_tm_clones+0x28>
10a54: f240 0300 movw r3, #0
10a58: f2c0 0300 movt r3, #0
10a5c: b103 cbz r3, 10a60 <register_tm_clones+0x28>
10a5e: 4718 bx r3
10a60: 4770 bx lr
10a62: bf00 nop
00010a64 <__do_global_dtors_aux>:
10a64: b510 push {r4, lr}
10a66: f649 5450 movw r4, #40272 ; 0x9d50
10a6a: f2c0 0402 movt r4, #2
10a6e: 7823 ldrb r3, [r4, #0]
10a70: b91b cbnz r3, 10a7a <__do_global_dtors_aux+0x16>
10a72: f7ff ffcf bl 10a14 <deregister_tm_clones>
10a76: 2301 movs r3, #1
10a78: 7023 strb r3, [r4, #0]
10a7a: bd10 pop {r4, pc}
00010a7c <frame_dummy>:
10a7c: f642 2034 movw r0, #10804 ; 0x2a34
10a80: b508 push {r3, lr}
10a82: f2c0 0002 movt r0, #2
10a86: 6803 ldr r3, [r0, #0]
10a88: b913 cbnz r3, 10a90 <frame_dummy+0x14>
10a8a: e8bd 4008 ldmia.w sp!, {r3, lr}
10a8e: e7d3 b.n 10a38 <register_tm_clones>
10a90: f240 0300 movw r3, #0
10a94: f2c0 0300 movt r3, #0
10a98: 2b00 cmp r3, #0
10a9a: d0f6 beq.n 10a8a <frame_dummy+0xe>
10a9c: 4798 blx r3
10a9e: e7f4 b.n 10a8a <frame_dummy+0xe>
00010aa0 <setup_io>:
void setup_io();
void setup_io()
{
10aa0: b580 push {r7, lr}
10aa2: b082 sub sp, #8
10aa4: af02 add r7, sp, #8
/* open /dev/mem */
if ((mem_fd = open("/dev/mem", O_RDWR|O_SYNC) ) < 0) {
10aa6: f242 700c movw r0, #9996 ; 0x270c
10aaa: f2c0 0001 movt r0, #1
10aae: f241 0102 movw r1, #4098 ; 0x1002
10ab2: f2c0 0110 movt r1, #16
10ab6: f7ff eeee blx 10894 <open@plt>
10aba: 4602 mov r2, r0
10abc: f649 5354 movw r3, #40276 ; 0x9d54
10ac0: f2c0 0302 movt r3, #2
10ac4: 601a str r2, [r3, #0]
10ac6: f649 5354 movw r3, #40276 ; 0x9d54
10aca: f2c0 0302 movt r3, #2
10ace: 681b ldr r3, [r3, #0]
10ad0: 2b00 cmp r3, #0
10ad2: da09 bge.n 10ae8 <setup_io+0x48>
printf("can't open /dev/mem \n");
10ad4: f242 7018 movw r0, #10008 ; 0x2718
10ad8: f2c0 0001 movt r0, #1
10adc: f7ff ef58 blx 10990 <puts@plt>
exit(-1);
10ae0: f04f 30ff mov.w r0, #4294967295
10ae4: f7ff ef66 blx 109b4 <exit@plt>
}
/* mmap GPIO */
gpio_map = mmap(
10ae8: f649 5354 movw r3, #40276 ; 0x9d54
10aec: f2c0 0302 movt r3, #2
10af0: 681b ldr r3, [r3, #0]
10af2: 9300 str r3, [sp, #0]
10af4: 2300 movs r3, #0
10af6: f6c3 7320 movt r3, #16160 ; 0x3f20
10afa: 9301 str r3, [sp, #4]
10afc: 2000 movs r0, #0
10afe: f44f 5180 mov.w r1, #4096 ; 0x1000
10b02: 2203 movs r2, #3
10b04: 2301 movs r3, #1
10b06: f7ff eecc blx 108a0 <mmap@plt>
10b0a: 4602 mov r2, r0
10b0c: f649 535c movw r3, #40284 ; 0x9d5c
10b10: f2c0 0302 movt r3, #2
10b14: 601a str r2, [r3, #0]
MAP_SHARED, //Shared with other processes
mem_fd, //File to map
GPIO_BASE //Offset to GPIO peripheral
);
close(mem_fd); //No need to keep mem_fd open after mmap
10b16: f649 5354 movw r3, #40276 ; 0x9d54
10b1a: f2c0 0302 movt r3, #2
10b1e: 681b ldr r3, [r3, #0]
10b20: 4618 mov r0, r3
10b22: f7ff ef24 blx 1096c <close@plt>
if (gpio_map == MAP_FAILED) {
10b26: f649 535c movw r3, #40284 ; 0x9d5c
10b2a: f2c0 0302 movt r3, #2
10b2e: 681b ldr r3, [r3, #0]
10b30: f1b3 3fff cmp.w r3, #4294967295
10b34: d10f bne.n 10b56 <setup_io+0xb6>
printf("mmap error %d\n", (int)gpio_map);//errno also set!
10b36: f649 535c movw r3, #40284 ; 0x9d5c
10b3a: f2c0 0302 movt r3, #2
10b3e: 681b ldr r3, [r3, #0]
10b40: f242 7030 movw r0, #10032 ; 0x2730
10b44: f2c0 0001 movt r0, #1
10b48: 4619 mov r1, r3
10b4a: f7ff ef04 blx 10954 <printf@plt>
exit(-1);
10b4e: f04f 30ff mov.w r0, #4294967295
10b52: f7ff ef30 blx 109b4 <exit@plt>
}
// Always use volatile pointer!
gpio = (volatile unsigned *)gpio_map;
10b56: f649 535c movw r3, #40284 ; 0x9d5c
10b5a: f2c0 0302 movt r3, #2
10b5e: 681a ldr r2, [r3, #0]
10b60: f649 6360 movw r3, #40544 ; 0x9e60
10b64: f2c0 0302 movt r3, #2
10b68: 601a str r2, [r3, #0]
} // setup_io
10b6a: 46bd mov sp, r7
10b6c: bd80 pop {r7, pc}
10b6e: bf00 nop
00010b70 <open_spi>:
const char *spi_dev_name = SPI_DEVNAME;
int open_spi(const char *devname)
{
10b70: b580 push {r7, lr}
10b72: b084 sub sp, #16
10b74: af00 add r7, sp, #0
10b76: 6078 str r0, [r7, #4]
int fd = open(devname, O_RDWR);
10b78: 6878 ldr r0, [r7, #4]
10b7a: 2102 movs r1, #2
10b7c: f7ff ee8a blx 10894 <open@plt>
10b80: 60f8 str r0, [r7, #12]
if (fd < 0)
10b82: 68fb ldr r3, [r7, #12]
10b84: 2b00 cmp r3, #0
10b86: da09 bge.n 10b9c <open_spi+0x2c>
{
perror("Open Failed\n");
10b88: f242 7050 movw r0, #10064 ; 0x2750
10b8c: f2c0 0001 movt r0, #1
10b90: f7ff eebc blx 1090c <perror@plt>
exit(-1);
10b94: f04f 30ff mov.w r0, #4294967295
10b98: f7ff ef0c blx 109b4 <exit@plt>
}
return fd;
10b9c: 68fb ldr r3, [r7, #12]
}
10b9e: 4618 mov r0, r3
10ba0: 3710 adds r7, #16
10ba2: 46bd mov sp, r7
10ba4: bd80 pop {r7, pc}
10ba6: bf00 nop
00010ba8 <close_spi>:
int close_spi(int fd)
{
10ba8: b580 push {r7, lr}
10baa: b082 sub sp, #8
10bac: af00 add r7, sp, #0
10bae: 6078 str r0, [r7, #4]
if (close(fd))
10bb0: 6878 ldr r0, [r7, #4]
10bb2: f7ff eedc blx 1096c <close@plt>
10bb6: 4603 mov r3, r0
10bb8: 2b00 cmp r3, #0
10bba: d009 beq.n 10bd0 <close_spi+0x28>
{
perror("Close Failed\n");
10bbc: f242 7060 movw r0, #10080 ; 0x2760
10bc0: f2c0 0001 movt r0, #1
10bc4: f7ff eea2 blx 1090c <perror@plt>
exit(-1);
10bc8: f04f 30ff mov.w r0, #4294967295
10bcc: f7ff eef2 blx 109b4 <exit@plt>
}
return 0;
10bd0: 2300 movs r3, #0
}
10bd2: 4618 mov r0, r3
10bd4: 3708 adds r7, #8
10bd6: 46bd mov sp, r7
10bd8: bd80 pop {r7, pc}
10bda: bf00 nop
00010bdc <default_spi_config>:
void default_spi_config(int fd)
{
10bdc: b580 push {r7, lr}
10bde: b084 sub sp, #16
10be0: af00 add r7, sp, #0
10be2: 6078 str r0, [r7, #4]
int x;
x = SPI_MODE_0;
10be4: 2300 movs r3, #0
10be6: 60fb str r3, [r7, #12]
if(ioctl(fd, SPI_IOC_WR_MODE, &x))
10be8: f107 030c add.w r3, r7, #12
10bec: 6878 ldr r0, [r7, #4]
10bee: f646 3101 movw r1, #27393 ; 0x6b01
10bf2: f2c4 0101 movt r1, #16385 ; 0x4001
10bf6: 461a mov r2, r3
10bf8: f7ff eea0 blx 1093c <ioctl@plt>
10bfc: 4603 mov r3, r0
10bfe: 2b00 cmp r3, #0
10c00: d005 beq.n 10c0e <default_spi_config+0x32>
{
perror("Failed to set mode to SPI_MODE_0");
10c02: f242 7070 movw r0, #10096 ; 0x2770
10c06: f2c0 0001 movt r0, #1
10c0a: f7ff ee80 blx 1090c <perror@plt>
}
x = SPI_SPEED;
10c0e: f644 3340 movw r3, #19264 ; 0x4b40
10c12: f2c0 034c movt r3, #76 ; 0x4c
10c16: 60fb str r3, [r7, #12]
if(ioctl(fd, SPI_IOC_WR_MAX_SPEED_HZ, &x))
10c18: f107 030c add.w r3, r7, #12
10c1c: 6878 ldr r0, [r7, #4]
10c1e: f646 3104 movw r1, #27396 ; 0x6b04
10c22: f2c4 0104 movt r1, #16388 ; 0x4004
10c26: 461a mov r2, r3
10c28: f7ff ee88 blx 1093c <ioctl@plt>
10c2c: 4603 mov r3, r0
10c2e: 2b00 cmp r3, #0
10c30: d005 beq.n 10c3e <default_spi_config+0x62>
{
perror("Failed to set speed");
10c32: f242 7094 movw r0, #10132 ; 0x2794
10c36: f2c0 0001 movt r0, #1
10c3a: f7ff ee68 blx 1090c <perror@plt>
}
x = 8;
10c3e: 2308 movs r3, #8
10c40: 60fb str r3, [r7, #12]
if(ioctl(fd, SPI_IOC_WR_BITS_PER_WORD, &x))
10c42: f107 030c add.w r3, r7, #12
10c46: 6878 ldr r0, [r7, #4]
10c48: f646 3103 movw r1, #27395 ; 0x6b03
10c4c: f2c4 0101 movt r1, #16385 ; 0x4001
10c50: 461a mov r2, r3
10c52: f7ff ee74 blx 1093c <ioctl@plt>
10c56: 4603 mov r3, r0
10c58: 2b00 cmp r3, #0
10c5a: d006 beq.n 10c6a <default_spi_config+0x8e>
{
perror("Failed to set bpw");
10c5c: f242 70a8 movw r0, #10152 ; 0x27a8
10c60: f2c0 0001 movt r0, #1
10c64: f7ff ee52 blx 1090c <perror@plt>
10c68: e01b b.n 10ca2 <default_spi_config+0xc6>
}
else if(ioctl(fd, SPI_IOC_RD_BITS_PER_WORD, &x))
10c6a: f107 030c add.w r3, r7, #12
10c6e: 6878 ldr r0, [r7, #4]
10c70: f646 3103 movw r1, #27395 ; 0x6b03
10c74: f2c8 0101 movt r1, #32769 ; 0x8001
10c78: 461a mov r2, r3
10c7a: f7ff ee60 blx 1093c <ioctl@plt>
10c7e: 4603 mov r3, r0
10c80: 2b00 cmp r3, #0
10c82: d006 beq.n 10c92 <default_spi_config+0xb6>
{
perror("Failed to get bwp");
10c84: f242 70bc movw r0, #10172 ; 0x27bc
10c88: f2c0 0001 movt r0, #1
10c8c: f7ff ee3e blx 1090c <perror@plt>
10c90: e007 b.n 10ca2 <default_spi_config+0xc6>
}
else
{
printf("BPW: %d\n", x);
10c92: 68fb ldr r3, [r7, #12]
10c94: f242 70d0 movw r0, #10192 ; 0x27d0
10c98: f2c0 0001 movt r0, #1
10c9c: 4619 mov r1, r3
10c9e: f7ff ee5a blx 10954 <printf@plt>
}
}
10ca2: 3710 adds r7, #16
10ca4: 46bd mov sp, r7
10ca6: bd80 pop {r7, pc}
00010ca8 <write_reg>:
#define READ_CMD_BIT (1<<7)
#define BURST_CMD_BIT (1<<6)
void write_reg(int fd, uint8_t addr, uint8_t value, uint8_t *response)
{
10ca8: b5b0 push {r4, r5, r7, lr}
10caa: b090 sub sp, #64 ; 0x40
10cac: af00 add r7, sp, #0
10cae: 60f8 str r0, [r7, #12]
10cb0: 607b str r3, [r7, #4]
10cb2: 460b mov r3, r1
10cb4: 72fb strb r3, [r7, #11]
10cb6: 4613 mov r3, r2
10cb8: 72bb strb r3, [r7, #10]
int ret;
struct spi_ioc_transfer tr;
#define N_RESP_BYTES (2)
uint8_t *wr, *rd;
wr = malloc(N_RESP_BYTES);
10cba: 2002 movs r0, #2
10cbc: f7ff ee5c blx 10978 <malloc@plt>
10cc0: 4603 mov r3, r0
10cc2: 63fb str r3, [r7, #60] ; 0x3c
rd = malloc(N_RESP_BYTES);
10cc4: 2002 movs r0, #2
10cc6: f7ff ee58 blx 10978 <malloc@plt>
10cca: 4603 mov r3, r0
10ccc: 63bb str r3, [r7, #56] ; 0x38
memset(&tr, 0, sizeof(tr));
10cce: f107 0310 add.w r3, r7, #16
10cd2: 4618 mov r0, r3
10cd4: 2100 movs r1, #0
10cd6: 2220 movs r2, #32
10cd8: f7ff ee12 blx 10900 <memset@plt>
memset(wr, 0, 10);
10cdc: 6bf8 ldr r0, [r7, #60] ; 0x3c
10cde: 2100 movs r1, #0
10ce0: 220a movs r2, #10
10ce2: f7ff ee0e blx 10900 <memset@plt>
memset(rd, 0, 10);
10ce6: 6bb8 ldr r0, [r7, #56] ; 0x38
10ce8: 2100 movs r1, #0
10cea: 220a movs r2, #10
10cec: f7ff ee08 blx 10900 <memset@plt>
wr[0] = (addr);
10cf0: 6bfb ldr r3, [r7, #60] ; 0x3c
10cf2: 2b00 cmp r3, #0
10cf4: d106 bne.n 10d04 <write_reg+0x5c>
10cf6: f249 30b4 movw r0, #37812 ; 0x93b4
10cfa: f2c0 0002 movt r0, #2
10cfe: 2100 movs r1, #0
10d00: f7ff ee40 blx 10984 <__ubsan_handle_type_mismatch@plt>
10d04: 6bfb ldr r3, [r7, #60] ; 0x3c
10d06: 7afa ldrb r2, [r7, #11]
10d08: 701a strb r2, [r3, #0]
wr[1] = value;
10d0a: 6bfb ldr r3, [r7, #60] ; 0x3c
10d0c: 1c5c adds r4, r3, #1
10d0e: 2c00 cmp r4, #0
10d10: d106 bne.n 10d20 <write_reg+0x78>
10d12: f249 30cc movw r0, #37836 ; 0x93cc
10d16: f2c0 0002 movt r0, #2
10d1a: 2100 movs r1, #0
10d1c: f7ff ee32 blx 10984 <__ubsan_handle_type_mismatch@plt>
10d20: 7abb ldrb r3, [r7, #10]
10d22: 7023 strb r3, [r4, #0]
GPIO_CLR = 1<<(GPIO_CHIP_SEL);
10d24: f649 6360 movw r3, #40544 ; 0x9e60
10d28: f2c0 0302 movt r3, #2
10d2c: 681b ldr r3, [r3, #0]
10d2e: f103 0428 add.w r4, r3, #40 ; 0x28
10d32: 2c00 cmp r4, #0
10d34: d106 bne.n 10d44 <write_reg+0x9c>
10d36: f249 4000 movw r0, #37888 ; 0x9400
10d3a: f2c0 0002 movt r0, #2
10d3e: 2100 movs r1, #0
10d40: f7ff ee20 blx 10984 <__ubsan_handle_type_mismatch@plt>
10d44: f44f 0380 mov.w r3, #4194304 ; 0x400000
10d48: 6023 str r3, [r4, #0]
while(GET_GPIO(GPIO_RDY))
10d4a: e01b b.n 10d84 <write_reg+0xdc>
{
int i = 0;
10d4c: 2300 movs r3, #0
10d4e: 637b str r3, [r7, #52] ; 0x34
printf("Waiting for Chiprdy ....%d\n", i++);
10d50: 6b7c ldr r4, [r7, #52] ; 0x34
10d52: 1c65 adds r5, r4, #1
10d54: 2301 movs r3, #1
10d56: 2b00 cmp r3, #0
10d58: db02 blt.n 10d60 <write_reg+0xb8>
10d5a: 42a5 cmp r5, r4
10d5c: da0a bge.n 10d74 <write_reg+0xcc>
10d5e: e001 b.n 10d64 <write_reg+0xbc>
10d60: 42a5 cmp r5, r4
10d62: dd07 ble.n 10d74 <write_reg+0xcc>
10d64: f249 4078 movw r0, #38008 ; 0x9478
10d68: f2c0 0002 movt r0, #2
10d6c: 4621 mov r1, r4
10d6e: 2201 movs r2, #1
10d70: f7ff edea blx 10948 <__ubsan_handle_add_overflow@plt>
10d74: 637d str r5, [r7, #52] ; 0x34
10d76: f242 70e8 movw r0, #10216 ; 0x27e8
10d7a: f2c0 0001 movt r0, #1
10d7e: 4621 mov r1, r4
10d80: f7ff ede8 blx 10954 <printf@plt>
wr[0] = (addr);
wr[1] = value;
GPIO_CLR = 1<<(GPIO_CHIP_SEL);
while(GET_GPIO(GPIO_RDY))
10d84: f649 6360 movw r3, #40544 ; 0x9e60
10d88: f2c0 0302 movt r3, #2
10d8c: 681b ldr r3, [r3, #0]
10d8e: f103 0434 add.w r4, r3, #52 ; 0x34
10d92: 2c00 cmp r4, #0
10d94: d106 bne.n 10da4 <write_reg+0xfc>
10d96: f249 4018 movw r0, #37912 ; 0x9418
10d9a: f2c0 0002 movt r0, #2
10d9e: 2100 movs r1, #0
10da0: f7ff edf0 blx 10984 <__ubsan_handle_type_mismatch@plt>
10da4: 6823 ldr r3, [r4, #0]
10da6: f003 7300 and.w r3, r3, #33554432 ; 0x2000000
10daa: 2b00 cmp r3, #0
10dac: d1ce bne.n 10d4c <write_reg+0xa4>
printf("Waiting for Chiprdy ....%d\n", i++);
}
#if 0
printf("Writing %02x val %02x\n", addr, value);
#endif
tr.tx_buf = (unsigned long) wr;
10dae: 6bfb ldr r3, [r7, #60] ; 0x3c
10db0: 461a mov r2, r3
10db2: f04f 0300 mov.w r3, #0
10db6: e9c7 2304 strd r2, r3, [r7, #16]
tr.rx_buf = (unsigned long) rd;
10dba: 6bbb ldr r3, [r7, #56] ; 0x38
10dbc: 461a mov r2, r3
10dbe: f04f 0300 mov.w r3, #0
10dc2: e9c7 2306 strd r2, r3, [r7, #24]
tr.len = N_RESP_BYTES;
10dc6: 2302 movs r3, #2
10dc8: 623b str r3, [r7, #32]
tr.delay_usecs = 90;
10dca: 235a movs r3, #90 ; 0x5a
10dcc: 853b strh r3, [r7, #40] ; 0x28
tr.speed_hz = SPI_SPEED;
10dce: f644 3340 movw r3, #19264 ; 0x4b40
10dd2: f2c0 034c movt r3, #76 ; 0x4c
10dd6: 627b str r3, [r7, #36] ; 0x24
tr.bits_per_word = 8;
10dd8: 2308 movs r3, #8
10dda: f887 302a strb.w r3, [r7, #42] ; 0x2a
tr.cs_change = 0;
10dde: 2300 movs r3, #0
10de0: f887 302b strb.w r3, [r7, #43] ; 0x2b
ret = ioctl(fd, SPI_IOC_MESSAGE(1), &tr);
10de4: f107 0310 add.w r3, r7, #16
10de8: 68f8 ldr r0, [r7, #12]
10dea: f44f 41d6 mov.w r1, #27392 ; 0x6b00
10dee: f2c4 0120 movt r1, #16416 ; 0x4020
10df2: 461a mov r2, r3
10df4: f7ff eda2 blx 1093c <ioctl@plt>
10df8: 6338 str r0, [r7, #48] ; 0x30
if (ret < 1)
10dfa: 6b3b ldr r3, [r7, #48] ; 0x30
10dfc: 2b00 cmp r3, #0
10dfe: dc05 bgt.n 10e0c <write_reg+0x164>
perror("can't send spi message");
10e00: f642 0004 movw r0, #10244 ; 0x2804
10e04: f2c0 0001 movt r0, #1
10e08: f7ff ed80 blx 1090c <perror@plt>
#if 0
for (ret = 0; ret < tr.len; ret++) {
printf("..%02X.. ", rd[ret]);
}
#endif
if (response)
10e0c: 687b ldr r3, [r7, #4]
10e0e: 2b00 cmp r3, #0
10e10: d018 beq.n 10e44 <write_reg+0x19c>
response[0] = rd[1];
10e12: 6bbb ldr r3, [r7, #56] ; 0x38
10e14: 2b00 cmp r3, #0
10e16: d106 bne.n 10e26 <write_reg+0x17e>
10e18: f249 4030 movw r0, #37936 ; 0x9430
10e1c: f2c0 0002 movt r0, #2
10e20: 2100 movs r1, #0
10e22: f7ff edb0 blx 10984 <__ubsan_handle_type_mismatch@plt>
10e26: 6bbb ldr r3, [r7, #56] ; 0x38
10e28: 785c ldrb r4, [r3, #1]
10e2a: 687b ldr r3, [r7, #4]
10e2c: 2b00 cmp r3, #0
10e2e: d106 bne.n 10e3e <write_reg+0x196>
10e30: f249 4048 movw r0, #37960 ; 0x9448
10e34: f2c0 0002 movt r0, #2
10e38: 2100 movs r1, #0
10e3a: f7ff eda4 blx 10984 <__ubsan_handle_type_mismatch@plt>
10e3e: 687b ldr r3, [r7, #4]
10e40: 4622 mov r2, r4
10e42: 701a strb r2, [r3, #0]
GPIO_SET = 1 << (GPIO_CHIP_SEL);
10e44: f649 6360 movw r3, #40544 ; 0x9e60
10e48: f2c0 0302 movt r3, #2
10e4c: 681b ldr r3, [r3, #0]
10e4e: f103 041c add.w r4, r3, #28
10e52: 2c00 cmp r4, #0
10e54: d106 bne.n 10e64 <write_reg+0x1bc>
10e56: f249 4060 movw r0, #37984 ; 0x9460
10e5a: f2c0 0002 movt r0, #2
10e5e: 2100 movs r1, #0
10e60: f7ff ed90 blx 10984 <__ubsan_handle_type_mismatch@plt>
10e64: f44f 0380 mov.w r3, #4194304 ; 0x400000
10e68: 6023 str r3, [r4, #0]
free(wr);
10e6a: 6bf8 ldr r0, [r7, #60] ; 0x3c
10e6c: f7ff ed5a blx 10924 <free@plt>
free(rd);
10e70: 6bb8 ldr r0, [r7, #56] ; 0x38
10e72: f7ff ed58 blx 10924 <free@plt>
}
10e76: 3740 adds r7, #64 ; 0x40
10e78: 46bd mov sp, r7
10e7a: bdb0 pop {r4, r5, r7, pc}
00010e7c <read_reg_burst>:
void read_reg_burst(int fd, uint8_t addr, uint8_t len, uint8_t *dest)
{
10e7c: b5b0 push {r4, r5, r7, lr}
10e7e: b092 sub sp, #72 ; 0x48
10e80: af00 add r7, sp, #0
10e82: 60f8 str r0, [r7, #12]
10e84: 607b str r3, [r7, #4]
10e86: 460b mov r3, r1
10e88: 72fb strb r3, [r7, #11]
10e8a: 4613 mov r3, r2
10e8c: 72bb strb r3, [r7, #10]
int ret;
uint32_t i;
struct spi_ioc_transfer tr;
#define N_RESP_BYTES (2)
uint8_t *wr, *rd;
wr = malloc(len + 1);
10e8e: 7abb ldrb r3, [r7, #10]
10e90: 1c5c adds r4, r3, #1
10e92: 2201 movs r2, #1
10e94: 2a00 cmp r2, #0
10e96: db02 blt.n 10e9e <read_reg_burst+0x22>
10e98: 429c cmp r4, r3
10e9a: da0a bge.n 10eb2 <read_reg_burst+0x36>
10e9c: e001 b.n 10ea2 <read_reg_burst+0x26>
10e9e: 429c cmp r4, r3
10ea0: dd07 ble.n 10eb2 <read_reg_burst+0x36>
10ea2: f249 5018 movw r0, #38168 ; 0x9518
10ea6: f2c0 0002 movt r0, #2
10eaa: 4619 mov r1, r3
10eac: 2201 movs r2, #1
10eae: f7ff ed4c blx 10948 <__ubsan_handle_add_overflow@plt>
10eb2: 4623 mov r3, r4
10eb4: 4618 mov r0, r3
10eb6: f7ff ed60 blx 10978 <malloc@plt>
10eba: 4603 mov r3, r0
10ebc: 63fb str r3, [r7, #60] ; 0x3c
rd = malloc(len + 1);
10ebe: 7abb ldrb r3, [r7, #10]
10ec0: 1c5c adds r4, r3, #1
10ec2: 2201 movs r2, #1
10ec4: 2a00 cmp r2, #0
10ec6: db02 blt.n 10ece <read_reg_burst+0x52>
10ec8: 429c cmp r4, r3
10eca: da0a bge.n 10ee2 <read_reg_burst+0x66>
10ecc: e001 b.n 10ed2 <read_reg_burst+0x56>
10ece: 429c cmp r4, r3
10ed0: dd07 ble.n 10ee2 <read_reg_burst+0x66>
10ed2: f249 5028 movw r0, #38184 ; 0x9528
10ed6: f2c0 0002 movt r0, #2
10eda: 4619 mov r1, r3
10edc: 2201 movs r2, #1
10ede: f7ff ed34 blx 10948 <__ubsan_handle_add_overflow@plt>
10ee2: 4623 mov r3, r4
10ee4: 4618 mov r0, r3
10ee6: f7ff ed48 blx 10978 <malloc@plt>
10eea: 4603 mov r3, r0
10eec: 63bb str r3, [r7, #56] ; 0x38
memset(&tr, 0, sizeof(tr));
10eee: f107 0310 add.w r3, r7, #16
10ef2: 4618 mov r0, r3
10ef4: 2100 movs r1, #0
10ef6: 2220 movs r2, #32
10ef8: f7ff ed02 blx 10900 <memset@plt>
memset(wr, 0, 10);
10efc: 6bf8 ldr r0, [r7, #60] ; 0x3c
10efe: 2100 movs r1, #0
10f00: 220a movs r2, #10
10f02: f7ff ecfe blx 10900 <memset@plt>
memset(rd, 0, 10);
10f06: 6bb8 ldr r0, [r7, #56] ; 0x38
10f08: 2100 movs r1, #0
10f0a: 220a movs r2, #10
10f0c: f7ff ecf8 blx 10900 <memset@plt>
memset(wr, 0xde, sizeof(wr[0])*len);
10f10: 7abb ldrb r3, [r7, #10]
10f12: 6bf8 ldr r0, [r7, #60] ; 0x3c
10f14: 21de movs r1, #222 ; 0xde
10f16: 461a mov r2, r3
10f18: f7ff ecf2 blx 10900 <memset@plt>
wr[0] = (addr) | BURST_CMD_BIT | READ_CMD_BIT;
10f1c: 7afb ldrb r3, [r7, #11]
10f1e: f063 033f orn r3, r3, #63 ; 0x3f
10f22: b2dc uxtb r4, r3
10f24: 6bfb ldr r3, [r7, #60] ; 0x3c
10f26: 2b00 cmp r3, #0
10f28: d106 bne.n 10f38 <read_reg_burst+0xbc>
10f2a: f249 4088 movw r0, #38024 ; 0x9488
10f2e: f2c0 0002 movt r0, #2
10f32: 2100 movs r1, #0
10f34: f7ff ed26 blx 10984 <__ubsan_handle_type_mismatch@plt>
10f38: 6bfb ldr r3, [r7, #60] ; 0x3c
10f3a: 4622 mov r2, r4
10f3c: 701a strb r2, [r3, #0]
GPIO_CLR = 1<<(GPIO_CHIP_SEL);
10f3e: f649 6360 movw r3, #40544 ; 0x9e60
10f42: f2c0 0302 movt r3, #2
10f46: 681b ldr r3, [r3, #0]
10f48: f103 0428 add.w r4, r3, #40 ; 0x28
10f4c: 2c00 cmp r4, #0
10f4e: d106 bne.n 10f5e <read_reg_burst+0xe2>
10f50: f249 40a0 movw r0, #38048 ; 0x94a0
10f54: f2c0 0002 movt r0, #2
10f58: 2100 movs r1, #0
10f5a: f7ff ed14 blx 10984 <__ubsan_handle_type_mismatch@plt>
10f5e: f44f 0380 mov.w r3, #4194304 ; 0x400000
10f62: 6023 str r3, [r4, #0]
while(GET_GPIO(GPIO_RDY))
10f64: e009 b.n 10f7a <read_reg_burst+0xfe>
{
printf("Waiting for Chiprdy ....%d\n", i++);
10f66: 6c7b ldr r3, [r7, #68] ; 0x44
10f68: 1c5a adds r2, r3, #1
10f6a: 647a str r2, [r7, #68] ; 0x44
10f6c: f242 70e8 movw r0, #10216 ; 0x27e8
10f70: f2c0 0001 movt r0, #1
10f74: 4619 mov r1, r3
10f76: f7ff ecee blx 10954 <printf@plt>
memset(wr, 0xde, sizeof(wr[0])*len);
wr[0] = (addr) | BURST_CMD_BIT | READ_CMD_BIT;
GPIO_CLR = 1<<(GPIO_CHIP_SEL);
while(GET_GPIO(GPIO_RDY))
10f7a: f649 6360 movw r3, #40544 ; 0x9e60
10f7e: f2c0 0302 movt r3, #2
10f82: 681b ldr r3, [r3, #0]
10f84: f103 0434 add.w r4, r3, #52 ; 0x34
10f88: 2c00 cmp r4, #0
10f8a: d106 bne.n 10f9a <read_reg_burst+0x11e>
10f8c: f249 40b8 movw r0, #38072 ; 0x94b8
10f90: f2c0 0002 movt r0, #2
10f94: 2100 movs r1, #0
10f96: f7ff ecf6 blx 10984 <__ubsan_handle_type_mismatch@plt>
10f9a: 6823 ldr r3, [r4, #0]
10f9c: f003 7300 and.w r3, r3, #33554432 ; 0x2000000
10fa0: 2b00 cmp r3, #0
10fa2: d1e0 bne.n 10f66 <read_reg_burst+0xea>
printf("Waiting for Chiprdy ....%d\n", i++);
}
#if 0
printf("Burst Reading %02x\n", addr);
#endif
tr.tx_buf = (unsigned long) wr;
10fa4: 6bfb ldr r3, [r7, #60] ; 0x3c
10fa6: 461a mov r2, r3
10fa8: f04f 0300 mov.w r3, #0
10fac: e9c7 2304 strd r2, r3, [r7, #16]
tr.rx_buf = (unsigned long) rd;
10fb0: 6bbb ldr r3, [r7, #56] ; 0x38
10fb2: 461a mov r2, r3
10fb4: f04f 0300 mov.w r3, #0
10fb8: e9c7 2306 strd r2, r3, [r7, #24]
tr.len = len + 1;
10fbc: 7abb ldrb r3, [r7, #10]
10fbe: 1c5c adds r4, r3, #1
10fc0: 2201 movs r2, #1
10fc2: 2a00 cmp r2, #0
10fc4: db02 blt.n 10fcc <read_reg_burst+0x150>
10fc6: 429c cmp r4, r3
10fc8: da0a bge.n 10fe0 <read_reg_burst+0x164>
10fca: e001 b.n 10fd0 <read_reg_burst+0x154>
10fcc: 429c cmp r4, r3
10fce: dd07 ble.n 10fe0 <read_reg_burst+0x164>
10fd0: f249 5038 movw r0, #38200 ; 0x9538
10fd4: f2c0 0002 movt r0, #2
10fd8: 4619 mov r1, r3
10fda: 2201 movs r2, #1
10fdc: f7ff ecb4 blx 10948 <__ubsan_handle_add_overflow@plt>
10fe0: 4623 mov r3, r4
10fe2: 623b str r3, [r7, #32]
tr.delay_usecs = 90;
10fe4: 235a movs r3, #90 ; 0x5a
10fe6: 853b strh r3, [r7, #40] ; 0x28
tr.speed_hz = SPI_SPEED;
10fe8: f644 3340 movw r3, #19264 ; 0x4b40
10fec: f2c0 034c movt r3, #76 ; 0x4c
10ff0: 627b str r3, [r7, #36] ; 0x24
tr.bits_per_word = 8;
10ff2: 2308 movs r3, #8
10ff4: f887 302a strb.w r3, [r7, #42] ; 0x2a
tr.cs_change = 0;
10ff8: 2300 movs r3, #0
10ffa: f887 302b strb.w r3, [r7, #43] ; 0x2b
ret = ioctl(fd, SPI_IOC_MESSAGE(1), &tr);
10ffe: f107 0310 add.w r3, r7, #16
11002: 68f8 ldr r0, [r7, #12]
11004: f44f 41d6 mov.w r1, #27392 ; 0x6b00
11008: f2c4 0120 movt r1, #16416 ; 0x4020
1100c: 461a mov r2, r3
1100e: f7ff ec96 blx 1093c <ioctl@plt>
11012: 6378 str r0, [r7, #52] ; 0x34
if (ret < 1)
11014: 6b7b ldr r3, [r7, #52] ; 0x34
11016: 2b00 cmp r3, #0
11018: dc05 bgt.n 11026 <read_reg_burst+0x1aa>
perror("can't send spi message");
1101a: f642 0004 movw r0, #10244 ; 0x2804
1101e: f2c0 0001 movt r0, #1
11022: f7ff ec74 blx 1090c <perror@plt>
#if 0
for (i = 0; i < tr.len; i++) {
printf("..%02X.. ", rd[ret]);
}
#endif
if (dest)
11026: 687b ldr r3, [r7, #4]
11028: 2b00 cmp r3, #0
1102a: d037 beq.n 1109c <read_reg_burst+0x220>
{
int i;
for (i = 0; i < len; i++)
1102c: 2300 movs r3, #0
1102e: 643b str r3, [r7, #64] ; 0x40
11030: e030 b.n 11094 <read_reg_burst+0x218>
dest[i] = rd[i + 1];
11032: 6c3b ldr r3, [r7, #64] ; 0x40
11034: 687a ldr r2, [r7, #4]
11036: 18d4 adds r4, r2, r3
11038: 6c3b ldr r3, [r7, #64] ; 0x40
1103a: 3301 adds r3, #1
1103c: 6bba ldr r2, [r7, #56] ; 0x38
1103e: 18d5 adds r5, r2, r3
11040: 2d00 cmp r5, #0
11042: d106 bne.n 11052 <read_reg_burst+0x1d6>
11044: f249 40d0 movw r0, #38096 ; 0x94d0
11048: f2c0 0002 movt r0, #2
1104c: 2100 movs r1, #0
1104e: f7ff ec9a blx 10984 <__ubsan_handle_type_mismatch@plt>
11052: 782d ldrb r5, [r5, #0]
11054: 2c00 cmp r4, #0
11056: d106 bne.n 11066 <read_reg_burst+0x1ea>
11058: f249 40e8 movw r0, #38120 ; 0x94e8
1105c: f2c0 0002 movt r0, #2
11060: 2100 movs r1, #0
11062: f7ff ec90 blx 10984 <__ubsan_handle_type_mismatch@plt>
11066: 462b mov r3, r5
11068: 7023 strb r3, [r4, #0]
}
#endif
if (dest)
{
int i;
for (i = 0; i < len; i++)
1106a: 6c3b ldr r3, [r7, #64] ; 0x40
1106c: 1c5c adds r4, r3, #1
1106e: 2301 movs r3, #1
11070: 2b00 cmp r3, #0
11072: db03 blt.n 1107c <read_reg_burst+0x200>
11074: 6c3b ldr r3, [r7, #64] ; 0x40
11076: 429c cmp r4, r3
11078: da0b bge.n 11092 <read_reg_burst+0x216>
1107a: e002 b.n 11082 <read_reg_burst+0x206>
1107c: 6c3b ldr r3, [r7, #64] ; 0x40
1107e: 429c cmp r4, r3
11080: dd07 ble.n 11092 <read_reg_burst+0x216>
11082: f249 5048 movw r0, #38216 ; 0x9548
11086: f2c0 0002 movt r0, #2
1108a: 6c39 ldr r1, [r7, #64] ; 0x40
1108c: 2201 movs r2, #1
1108e: f7ff ec5c blx 10948 <__ubsan_handle_add_overflow@plt>
11092: 643c str r4, [r7, #64] ; 0x40
11094: 7aba ldrb r2, [r7, #10]
11096: 6c3b ldr r3, [r7, #64] ; 0x40