-
Notifications
You must be signed in to change notification settings - Fork 157
/
nlib-zippatch.patch
11872 lines (11837 loc) · 351 KB
/
nlib-zippatch.patch
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
diff -Naur '--exclude=*.swp' newlib-4.1.0/config.sub newlib-4.1.0-zip/config.sub
--- newlib-4.1.0/config.sub 2020-12-18 18:50:49.000000000 -0500
+++ newlib-4.1.0-zip/config.sub 2021-05-10 15:44:32.152966105 -0400
@@ -632,6 +632,10 @@
basic_machine=ymp-cray
os=unicos
;;
+ zip*)
+ basic_machine=zip
+ os=none
+ ;;
*)
basic_machine=$1
os=
@@ -1248,7 +1252,7 @@
| x86 | x86_64 | xc16x | xgate | xps100 \
| xstormy16 | xtensa* \
| ymp \
- | z8k | z80)
+ | z8k | z80 | zip*)
;;
*)
@@ -1511,6 +1515,9 @@
;;
*-eabi)
;;
+ zip*)
+ os=none
+ ;;
*)
echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
exit 1
diff -Naur '--exclude=*.swp' newlib-4.1.0/configure newlib-4.1.0-zip/configure
--- newlib-4.1.0/configure 2020-12-18 18:50:49.000000000 -0500
+++ newlib-4.1.0-zip/configure 2021-05-10 15:15:37.376300595 -0400
@@ -3549,6 +3549,9 @@
ft32-*-*)
noconfigdirs="$noconfigdirs ${libgcj}"
;;
+ zip*)
+ noconfigdirs="$noconfigdirs ${libgcj}"
+ ;;
*-*-lynxos*)
noconfigdirs="$noconfigdirs ${libgcj}"
;;
@@ -3576,6 +3579,9 @@
*-*-aix*)
noconfigdirs="$noconfigdirs target-libgo"
;;
+ zip*)
+ noconfigdirs="$noconfigdirs target-libgo"
+ ;;
esac
fi
@@ -4723,13 +4729,13 @@
CFLAGS=$ac_save_CFLAGS
elif test $ac_cv_prog_cc_g = yes; then
if test "$GCC" = yes; then
- CFLAGS="-g -O2"
+ CFLAGS="-O3"
else
CFLAGS="-g"
fi
else
if test "$GCC" = yes; then
- CFLAGS="-O2"
+ CFLAGS="-O3"
else
CFLAGS=
fi
@@ -5071,13 +5077,13 @@
CXXFLAGS=$ac_save_CXXFLAGS
elif test $ac_cv_prog_cxx_g = yes; then
if test "$GXX" = yes; then
- CXXFLAGS="-g -O2"
+ CXXFLAGS="-O3"
else
CXXFLAGS="-g"
fi
else
if test "$GXX" = yes; then
- CXXFLAGS="-O2"
+ CXXFLAGS="-O3"
else
CXXFLAGS=
fi
@@ -6773,16 +6779,16 @@
# might be empty or "-g". We don't require a C++ compiler, so CXXFLAGS
# might also be empty (or "-g", if a non-GCC C++ compiler is in the path).
# We want to ensure that TARGET libraries (which we know are built with
-# gcc) are built with "-O2 -g", so include those options when setting
+# gcc) are built with "-O3 -g", so include those options when setting
# CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET.
if test "x$CFLAGS_FOR_TARGET" = x; then
if test "x${is_cross_compiler}" = xyes; then
- CFLAGS_FOR_TARGET="-g -O2"
+ CFLAGS_FOR_TARGET="-O3"
else
CFLAGS_FOR_TARGET=$CFLAGS
case " $CFLAGS " in
- *" -O2 "*) ;;
- *) CFLAGS_FOR_TARGET="-O2 $CFLAGS_FOR_TARGET" ;;
+ *" -O3 "*) ;;
+ *) CFLAGS_FOR_TARGET="-O3 $CFLAGS_FOR_TARGET" ;;
esac
case " $CFLAGS " in
*" -g "* | *" -g3 "*) ;;
@@ -6794,12 +6800,12 @@
if test "x$CXXFLAGS_FOR_TARGET" = x; then
if test "x${is_cross_compiler}" = xyes; then
- CXXFLAGS_FOR_TARGET="-g -O2"
+ CXXFLAGS_FOR_TARGET="-O3"
else
CXXFLAGS_FOR_TARGET=$CXXFLAGS
case " $CXXFLAGS " in
- *" -O2 "*) ;;
- *) CXXFLAGS_FOR_TARGET="-O2 $CXXFLAGS_FOR_TARGET" ;;
+ *" -O3 "*) ;;
+ *) CXXFLAGS_FOR_TARGET="-O3 $CXXFLAGS_FOR_TARGET" ;;
esac
case " $CXXFLAGS " in
*" -g "* | *" -g3 "*) ;;
@@ -6972,7 +6978,7 @@
;;
esac
-# If --enable-target-optspace always use -Os instead of -O2 to build
+# If --enable-target-optspace always use -Os instead of -O3 to build
# the target libraries, similarly if it is not specified, use -Os
# on selected platforms.
ospace_frag=/dev/null
diff -Naur '--exclude=*.swp' newlib-4.1.0/configure.ac newlib-4.1.0-zip/configure.ac
--- newlib-4.1.0/configure.ac 2020-12-18 18:50:49.000000000 -0500
+++ newlib-4.1.0-zip/configure.ac 2021-05-10 15:17:40.756623894 -0400
@@ -2377,16 +2377,16 @@
# might be empty or "-g". We don't require a C++ compiler, so CXXFLAGS
# might also be empty (or "-g", if a non-GCC C++ compiler is in the path).
# We want to ensure that TARGET libraries (which we know are built with
-# gcc) are built with "-O2 -g", so include those options when setting
+# gcc) are built with "-O3 -g", so include those options when setting
# CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET.
if test "x$CFLAGS_FOR_TARGET" = x; then
if test "x${is_cross_compiler}" = xyes; then
- CFLAGS_FOR_TARGET="-g -O2"
+ CFLAGS_FOR_TARGET="-O3"
else
CFLAGS_FOR_TARGET=$CFLAGS
case " $CFLAGS " in
- *" -O2 "*) ;;
- *) CFLAGS_FOR_TARGET="-O2 $CFLAGS_FOR_TARGET" ;;
+ *" -O3 "*) ;;
+ *) CFLAGS_FOR_TARGET="-O3 $CFLAGS_FOR_TARGET" ;;
esac
case " $CFLAGS " in
*" -g "* | *" -g3 "*) ;;
@@ -2398,12 +2398,12 @@
if test "x$CXXFLAGS_FOR_TARGET" = x; then
if test "x${is_cross_compiler}" = xyes; then
- CXXFLAGS_FOR_TARGET="-g -O2"
+ CXXFLAGS_FOR_TARGET="-O3"
else
CXXFLAGS_FOR_TARGET=$CXXFLAGS
case " $CXXFLAGS " in
- *" -O2 "*) ;;
- *) CXXFLAGS_FOR_TARGET="-O2 $CXXFLAGS_FOR_TARGET" ;;
+ *" -O3 "*) ;;
+ *) CXXFLAGS_FOR_TARGET="-O3 $CXXFLAGS_FOR_TARGET" ;;
esac
case " $CXXFLAGS " in
*" -g "* | *" -g3 "*) ;;
@@ -2576,7 +2576,7 @@
;;
esac
-# If --enable-target-optspace always use -Os instead of -O2 to build
+# If --enable-target-optspace always use -Os instead of -O3 to build
# the target libraries, similarly if it is not specified, use -Os
# on selected platforms.
ospace_frag=/dev/null
diff -Naur '--exclude=*.swp' newlib-4.1.0/libgloss/configure newlib-4.1.0-zip/libgloss/configure
--- newlib-4.1.0/libgloss/configure 2020-12-18 18:50:49.000000000 -0500
+++ newlib-4.1.0-zip/libgloss/configure 2021-05-10 15:18:32.952760244 -0400
@@ -713,6 +713,7 @@
or1k
pru
nios2
+zip
libnosys'
# Initialize some variables set by options.
@@ -2601,6 +2602,9 @@
subdirs="$subdirs nios2"
;;
+ zip*)
+ subdirs="$subdirs zip"
+ ;;
esac
diff -Naur '--exclude=*.swp' newlib-4.1.0/libgloss/configure.in newlib-4.1.0-zip/libgloss/configure.in
--- newlib-4.1.0/libgloss/configure.in 2020-12-18 18:50:49.000000000 -0500
+++ newlib-4.1.0-zip/libgloss/configure.in 2021-05-10 15:19:02.716837886 -0400
@@ -185,6 +185,9 @@
nios2-*-*)
AC_CONFIG_SUBDIRS([nios2])
;;
+ zip*)
+ AC_CONFIG_SUBDIRS([zip])
+ ;;
esac
dnl For now, don't bother configuring testsuite
diff -Naur '--exclude=*.swp' newlib-4.1.0/libgloss/libnosys/configure.in newlib-4.1.0-zip/libgloss/libnosys/configure.in
--- newlib-4.1.0/libgloss/libnosys/configure.in 2020-12-18 18:50:49.000000000 -0500
+++ newlib-4.1.0-zip/libgloss/libnosys/configure.in 2021-05-10 15:20:16.921031109 -0400
@@ -85,6 +85,8 @@
;;
z8k-*-*)
;;
+ zip*)
+ ;;
*)
AC_DEFINE(MISSING_SYSCALL_NAMES)
;;
diff -Naur '--exclude=*.swp' newlib-4.1.0/libgloss/zip/board.h newlib-4.1.0-zip/libgloss/zip/board.h
--- newlib-4.1.0/libgloss/zip/board.h 1969-12-31 19:00:00.000000000 -0500
+++ newlib-4.1.0-zip/libgloss/zip/board.h 2022-01-31 16:44:21.703011719 -0500
@@ -0,0 +1,219 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Filename: zipbasic.h
+// {{{
+// Project: Zip CPU -- a small, lightweight, RISC CPU soft core
+//
+// Purpose: A description of the hardware and I/O parts and pieces specific
+// to the ZipBasic distribution, for the purpose of writing
+// ZipCPU software that will run on the board.
+//
+// Creator: Dan Gisselquist, Ph.D.
+// Gisselquist Technology, LLC
+//
+////////////////////////////////////////////////////////////////////////////////
+// }}}
+// Copyright (C) 2017-2022, Gisselquist Technology, LLC
+// {{{
+// This program is free software (firmware): you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as published
+// by the Free Software Foundation, either version 3 of the License, or (at
+// your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program. (It's in the $(ROOT)/doc directory, run make with no
+// target there if the PDF file isn't present.) If not, see
+// <http://www.gnu.org/licenses/> for a copy.
+// }}}
+// License: GPL, v3, as defined and found on www.gnu.org,
+// {{{
+// http://www.gnu.org/licenses/gpl.html
+//
+////////////////////////////////////////////////////////////////////////////////
+//
+// }}}
+#ifndef BOARD_H
+#define BOARD_H
+
+#include <stdint.h>
+
+#define _HAVE_ZIPSYS
+#define PIC _zip->z_pic
+
+#ifdef INCLUDE_ZIPCPU
+#ifdef INCLUDE_DMA_CONTROLLER
+#define _HAVE_ZIPSYS_DMA
+#endif // INCLUDE_DMA_CONTROLLER
+#ifdef INCLUDE_ACCOUNTING_COUNTERS
+#define _HAVE_ZIPSYS_PERFORMANCE_COUNTERS
+#endif // INCLUDE_ACCOUNTING_COUNTERS
+#endif // INCLUDE_ZIPCPU
+
+
+#define SDSPI_SETAUX 0x0000ff
+#define SDSPI_READAUX 0x0000bf
+#define SDSPI_CMD 0x000040
+#define SDSPI_ACMD (0x040+55) // CMD55
+#define SDSPI_FIFO_OP 0x000800 // Read only
+#define SDSPI_WRITEOP 0x000c00 // Write to the FIFO
+#define SDSPI_ALTFIFO 0x001000
+#define SDSPI_BUSY 0x004000
+#define SDSPI_ERROR 0x008000
+#define SDSPI_CLEARERR 0x008000
+// #define SDSPI_CRCERR 0x010000
+// #define SDSPI_ERRTOK 0x020000
+#define SDSPI_REMOVED 0x040000
+#define SDSPI_PRESENTN 0x080000
+#define SDSPI_RESET 0x100000 // Read only
+#define SDSPI_WATCHDOG 0x200000 // Read only
+#define SDSPI_GO_IDLE ((SDSPI_REMOVED|SDSPI_CLEARERR|SDSPI_CMD)+0)
+#define SDSPI_READ_SECTOR ((SDSPI_CMD|SDSPI_CLEARERR|SDSPI_FIFO_OP)+17)
+#define SDSPI_WRITE_SECTOR ((SDSPI_CMD|SDSPI_CLEARERR|SDSPI_WRITEOP)+24)
+
+typedef struct SDSPI_S {
+ unsigned sd_ctrl, sd_data, sd_fifo[2];
+} SDSPI;
+
+
+
+
+#define BUSPIC(X) (1<<X)
+
+
+//
+// GPIO input wires
+//
+#define GPIO_SD_DETECTED 0x000010000
+#define GPIO_SYSCLK_LOCKED 0x000020000
+//
+// GPIO output wires
+//
+#define GPIO_SET(WIRE) (((WIRE)<<16)|(WIRE))
+#define GPIO_CLR(WIRE) ((WIRE)<<16)
+//
+#define GPIO_SD_RESET 0x000000001
+//
+#define GPIO_SD_RESET_SET GPIO_SET(GPIO_SD_RESET)
+#define GPIO_SD_RESET_CLR GPIO_CLR(GPIO_SD_RESET)
+
+
+typedef struct RTCLIGHT_S {
+ unsigned r_clock, r_stopwatch, r_timer, r_alarm;
+} RTCLIGHT;
+
+typedef struct CONSOLE_S {
+ unsigned u_setup;
+ unsigned u_fifo;
+ unsigned u_rx, u_tx;
+} CONSOLE;
+
+#define _uart_txbusy ((_uart->u_fifo & 0x10000)==0)
+
+
+#define ALTPIC(A) (1<<(A))
+
+
+#define SYSPIC(A) (1<<(A))
+
+
+#ifdef SDSPI_ACCESS
+#define _BOARD_HAS_SDSPI
+static volatile SDSPI *const _sdcard = ((SDSPI *)0x04000000);
+#endif // SDSPI_ACCESS
+#define _BOARD_HAS_VERSION
+static volatile unsigned *const _version = ((unsigned *)0x0a00001c);
+#ifdef SIGCPU_ACCESS
+#define _BOARD_HAS_SIGCPU
+static volatile SIGCPU *const _sigcpu = ((SIGCPU *)0x0c000000);
+#endif // SIGCPU_ACCESS
+#ifdef SPIO_ACCESS
+#define _BOARD_HAS_SPIO
+static volatile unsigned *const _spio = ((unsigned *)0x0a000018);
+#endif // SPIO_ACCESS
+#ifdef BUSPIC_ACCESS
+#define _BOARD_HAS_BUSPIC
+static volatile unsigned *const _buspic = ((unsigned *)0x0a00000c);
+#endif // BUSPIC_ACCESS
+#ifdef FLASH_ACCESS
+#define _BOARD_HAS_FLASH
+extern int _flash[1];
+#endif // FLASH_ACCESS
+#define _BOARD_HAS_BUILDTIME
+static volatile unsigned *const _buildtime = ((unsigned *)0x0a000004);
+#ifdef GPIO_ACCESS
+#define _BOARD_HAS_GPIO
+static volatile unsigned *const _gpio = ((unsigned *)0x0a000010);
+#endif // GPIO_ACCESS
+#ifdef FLASHCFG_ACCESS
+#define _BOARD_HAS_FLASHCFG
+static volatile unsigned * const _flashcfg = ((unsigned *)(0x02000000));
+#endif // FLASHCFG_ACCESS
+#ifdef SDRAM_ACCESS
+#define _BOARD_HAS_SDRAM
+extern char _streamram[0x20000000];
+#endif // SDRAM_ACCESS
+#ifdef RTC_ACCESS
+#define _BOARD_HAS_RTC
+static volatile RTCLIGHT *const _rtc = ((RTCLIGHT *)0x08000000);
+#endif // RTC_ACCESS
+#ifdef BKRAM_ACCESS
+#define _BOARD_HAS_BKRAM
+extern char _bkram[0x00040000];
+#endif // BKRAM_ACCESS
+#ifdef PWRCOUNT_ACCESS
+static volatile unsigned *const _pwrcount = ((unsigned *)0x0a000014);
+#endif // PWRCOUNT_ACCESS
+#define _BOARD_HAS_BUSERR
+static volatile unsigned *const _buserr = ((unsigned *)0x0a000008);
+#ifdef CFG_ACCESS
+#define _BOARD_HAS_ICAPTETWO
+static volatile unsigned *const _icape = ((unsigned *)0x0e000000);
+#endif // CFG_ACCESS
+#ifdef BEAMFORMER_ACCESS
+#define _BOARD_HAS_BEAMFORMER
+static volatile unsigned *const _beamer = ((unsigned *)0x0a000000);
+#endif // BEAMFORMER_ACCESS
+#ifdef BUSCONSOLE_ACCESS
+#define _BOARD_HAS_BUSCONSOLE
+static volatile CONSOLE *const _uart = ((CONSOLE *)0x06000000);
+#endif // BUSCONSOLE_ACCESS
+#ifdef BKROM_ACCESS
+#define _BOARD_HAS_BKROM
+extern char _bkrom[0x00010000];
+#endif // BKROM_ACCESS
+//
+// Interrupt assignments (3 PICs)
+//
+// PIC: buspic
+#define BUSPIC_SDCARD BUSPIC(0)
+#define BUSPIC_SPIO BUSPIC(1)
+// PIC: altpic
+#define ALTPIC_UIC ALTPIC(0)
+#define ALTPIC_UOC ALTPIC(1)
+#define ALTPIC_UPC ALTPIC(2)
+#define ALTPIC_UTC ALTPIC(3)
+#define ALTPIC_MIC ALTPIC(4)
+#define ALTPIC_MOC ALTPIC(5)
+#define ALTPIC_MPC ALTPIC(6)
+#define ALTPIC_MTC ALTPIC(7)
+#define ALTPIC_GPIO ALTPIC(8)
+#define ALTPIC_RTC ALTPIC(9)
+#define ALTPIC_UARTTX ALTPIC(10)
+#define ALTPIC_UARTRX ALTPIC(11)
+// PIC: syspic
+#define SYSPIC_DMAC SYSPIC(0)
+#define SYSPIC_JIFFIES SYSPIC(1)
+#define SYSPIC_TMC SYSPIC(2)
+#define SYSPIC_TMB SYSPIC(3)
+#define SYSPIC_TMA SYSPIC(4)
+#define SYSPIC_ALT SYSPIC(5)
+#define SYSPIC_BUS SYSPIC(6)
+#define SYSPIC_SDCARD SYSPIC(7)
+#define SYSPIC_UARTTXF SYSPIC(8)
+#define SYSPIC_UARTRXF SYSPIC(9)
+#endif // BOARD_H
diff -Naur '--exclude=*.swp' newlib-4.1.0/libgloss/zip/boards/zipbasic.h newlib-4.1.0-zip/libgloss/zip/boards/zipbasic.h
--- newlib-4.1.0/libgloss/zip/boards/zipbasic.h 1969-12-31 19:00:00.000000000 -0500
+++ newlib-4.1.0-zip/libgloss/zip/boards/zipbasic.h 2022-01-31 16:44:21.703011719 -0500
@@ -0,0 +1,219 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Filename: zipbasic.h
+// {{{
+// Project: Zip CPU -- a small, lightweight, RISC CPU soft core
+//
+// Purpose: A description of the hardware and I/O parts and pieces specific
+// to the ZipBasic distribution, for the purpose of writing
+// ZipCPU software that will run on the board.
+//
+// Creator: Dan Gisselquist, Ph.D.
+// Gisselquist Technology, LLC
+//
+////////////////////////////////////////////////////////////////////////////////
+// }}}
+// Copyright (C) 2017-2022, Gisselquist Technology, LLC
+// {{{
+// This program is free software (firmware): you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as published
+// by the Free Software Foundation, either version 3 of the License, or (at
+// your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program. (It's in the $(ROOT)/doc directory, run make with no
+// target there if the PDF file isn't present.) If not, see
+// <http://www.gnu.org/licenses/> for a copy.
+// }}}
+// License: GPL, v3, as defined and found on www.gnu.org,
+// {{{
+// http://www.gnu.org/licenses/gpl.html
+//
+////////////////////////////////////////////////////////////////////////////////
+//
+// }}}
+#ifndef BOARD_H
+#define BOARD_H
+
+#include <stdint.h>
+
+#define _HAVE_ZIPSYS
+#define PIC _zip->z_pic
+
+#ifdef INCLUDE_ZIPCPU
+#ifdef INCLUDE_DMA_CONTROLLER
+#define _HAVE_ZIPSYS_DMA
+#endif // INCLUDE_DMA_CONTROLLER
+#ifdef INCLUDE_ACCOUNTING_COUNTERS
+#define _HAVE_ZIPSYS_PERFORMANCE_COUNTERS
+#endif // INCLUDE_ACCOUNTING_COUNTERS
+#endif // INCLUDE_ZIPCPU
+
+
+#define SDSPI_SETAUX 0x0000ff
+#define SDSPI_READAUX 0x0000bf
+#define SDSPI_CMD 0x000040
+#define SDSPI_ACMD (0x040+55) // CMD55
+#define SDSPI_FIFO_OP 0x000800 // Read only
+#define SDSPI_WRITEOP 0x000c00 // Write to the FIFO
+#define SDSPI_ALTFIFO 0x001000
+#define SDSPI_BUSY 0x004000
+#define SDSPI_ERROR 0x008000
+#define SDSPI_CLEARERR 0x008000
+// #define SDSPI_CRCERR 0x010000
+// #define SDSPI_ERRTOK 0x020000
+#define SDSPI_REMOVED 0x040000
+#define SDSPI_PRESENTN 0x080000
+#define SDSPI_RESET 0x100000 // Read only
+#define SDSPI_WATCHDOG 0x200000 // Read only
+#define SDSPI_GO_IDLE ((SDSPI_REMOVED|SDSPI_CLEARERR|SDSPI_CMD)+0)
+#define SDSPI_READ_SECTOR ((SDSPI_CMD|SDSPI_CLEARERR|SDSPI_FIFO_OP)+17)
+#define SDSPI_WRITE_SECTOR ((SDSPI_CMD|SDSPI_CLEARERR|SDSPI_WRITEOP)+24)
+
+typedef struct SDSPI_S {
+ unsigned sd_ctrl, sd_data, sd_fifo[2];
+} SDSPI;
+
+
+
+
+#define BUSPIC(X) (1<<X)
+
+
+//
+// GPIO input wires
+//
+#define GPIO_SD_DETECTED 0x000010000
+#define GPIO_SYSCLK_LOCKED 0x000020000
+//
+// GPIO output wires
+//
+#define GPIO_SET(WIRE) (((WIRE)<<16)|(WIRE))
+#define GPIO_CLR(WIRE) ((WIRE)<<16)
+//
+#define GPIO_SD_RESET 0x000000001
+//
+#define GPIO_SD_RESET_SET GPIO_SET(GPIO_SD_RESET)
+#define GPIO_SD_RESET_CLR GPIO_CLR(GPIO_SD_RESET)
+
+
+typedef struct RTCLIGHT_S {
+ unsigned r_clock, r_stopwatch, r_timer, r_alarm;
+} RTCLIGHT;
+
+typedef struct CONSOLE_S {
+ unsigned u_setup;
+ unsigned u_fifo;
+ unsigned u_rx, u_tx;
+} CONSOLE;
+
+#define _uart_txbusy ((_uart->u_fifo & 0x10000)==0)
+
+
+#define ALTPIC(A) (1<<(A))
+
+
+#define SYSPIC(A) (1<<(A))
+
+
+#ifdef SDSPI_ACCESS
+#define _BOARD_HAS_SDSPI
+static volatile SDSPI *const _sdcard = ((SDSPI *)0x04000000);
+#endif // SDSPI_ACCESS
+#define _BOARD_HAS_VERSION
+static volatile unsigned *const _version = ((unsigned *)0x0a00001c);
+#ifdef SIGCPU_ACCESS
+#define _BOARD_HAS_SIGCPU
+static volatile SIGCPU *const _sigcpu = ((SIGCPU *)0x0c000000);
+#endif // SIGCPU_ACCESS
+#ifdef SPIO_ACCESS
+#define _BOARD_HAS_SPIO
+static volatile unsigned *const _spio = ((unsigned *)0x0a000018);
+#endif // SPIO_ACCESS
+#ifdef BUSPIC_ACCESS
+#define _BOARD_HAS_BUSPIC
+static volatile unsigned *const _buspic = ((unsigned *)0x0a00000c);
+#endif // BUSPIC_ACCESS
+#ifdef FLASH_ACCESS
+#define _BOARD_HAS_FLASH
+extern int _flash[1];
+#endif // FLASH_ACCESS
+#define _BOARD_HAS_BUILDTIME
+static volatile unsigned *const _buildtime = ((unsigned *)0x0a000004);
+#ifdef GPIO_ACCESS
+#define _BOARD_HAS_GPIO
+static volatile unsigned *const _gpio = ((unsigned *)0x0a000010);
+#endif // GPIO_ACCESS
+#ifdef FLASHCFG_ACCESS
+#define _BOARD_HAS_FLASHCFG
+static volatile unsigned * const _flashcfg = ((unsigned *)(0x02000000));
+#endif // FLASHCFG_ACCESS
+#ifdef SDRAM_ACCESS
+#define _BOARD_HAS_SDRAM
+extern char _streamram[0x20000000];
+#endif // SDRAM_ACCESS
+#ifdef RTC_ACCESS
+#define _BOARD_HAS_RTC
+static volatile RTCLIGHT *const _rtc = ((RTCLIGHT *)0x08000000);
+#endif // RTC_ACCESS
+#ifdef BKRAM_ACCESS
+#define _BOARD_HAS_BKRAM
+extern char _bkram[0x00040000];
+#endif // BKRAM_ACCESS
+#ifdef PWRCOUNT_ACCESS
+static volatile unsigned *const _pwrcount = ((unsigned *)0x0a000014);
+#endif // PWRCOUNT_ACCESS
+#define _BOARD_HAS_BUSERR
+static volatile unsigned *const _buserr = ((unsigned *)0x0a000008);
+#ifdef CFG_ACCESS
+#define _BOARD_HAS_ICAPTETWO
+static volatile unsigned *const _icape = ((unsigned *)0x0e000000);
+#endif // CFG_ACCESS
+#ifdef BEAMFORMER_ACCESS
+#define _BOARD_HAS_BEAMFORMER
+static volatile unsigned *const _beamer = ((unsigned *)0x0a000000);
+#endif // BEAMFORMER_ACCESS
+#ifdef BUSCONSOLE_ACCESS
+#define _BOARD_HAS_BUSCONSOLE
+static volatile CONSOLE *const _uart = ((CONSOLE *)0x06000000);
+#endif // BUSCONSOLE_ACCESS
+#ifdef BKROM_ACCESS
+#define _BOARD_HAS_BKROM
+extern char _bkrom[0x00010000];
+#endif // BKROM_ACCESS
+//
+// Interrupt assignments (3 PICs)
+//
+// PIC: buspic
+#define BUSPIC_SDCARD BUSPIC(0)
+#define BUSPIC_SPIO BUSPIC(1)
+// PIC: altpic
+#define ALTPIC_UIC ALTPIC(0)
+#define ALTPIC_UOC ALTPIC(1)
+#define ALTPIC_UPC ALTPIC(2)
+#define ALTPIC_UTC ALTPIC(3)
+#define ALTPIC_MIC ALTPIC(4)
+#define ALTPIC_MOC ALTPIC(5)
+#define ALTPIC_MPC ALTPIC(6)
+#define ALTPIC_MTC ALTPIC(7)
+#define ALTPIC_GPIO ALTPIC(8)
+#define ALTPIC_RTC ALTPIC(9)
+#define ALTPIC_UARTTX ALTPIC(10)
+#define ALTPIC_UARTRX ALTPIC(11)
+// PIC: syspic
+#define SYSPIC_DMAC SYSPIC(0)
+#define SYSPIC_JIFFIES SYSPIC(1)
+#define SYSPIC_TMC SYSPIC(2)
+#define SYSPIC_TMB SYSPIC(3)
+#define SYSPIC_TMA SYSPIC(4)
+#define SYSPIC_ALT SYSPIC(5)
+#define SYSPIC_BUS SYSPIC(6)
+#define SYSPIC_SDCARD SYSPIC(7)
+#define SYSPIC_UARTTXF SYSPIC(8)
+#define SYSPIC_UARTRXF SYSPIC(9)
+#endif // BOARD_H
diff -Naur '--exclude=*.swp' newlib-4.1.0/libgloss/zip/bootloader.h newlib-4.1.0-zip/libgloss/zip/bootloader.h
--- newlib-4.1.0/libgloss/zip/bootloader.h 1969-12-31 19:00:00.000000000 -0500
+++ newlib-4.1.0-zip/libgloss/zip/bootloader.h 2022-01-31 16:44:42.342871211 -0500
@@ -0,0 +1,52 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Filename: bootloader.h
+// {{{
+// Project: Zip CPU -- a small, lightweight, RISC CPU soft core
+//
+// Purpose:
+//
+//
+// Creator: Dan Gisselquist, Ph.D.
+// Gisselquist Technology, LLC
+//
+////////////////////////////////////////////////////////////////////////////////
+// }}}
+// Copyright (C) 2015-2022, Gisselquist Technology, LLC
+// {{{
+// This program is free software (firmware): you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as published
+// by the Free Software Foundation, either version 3 of the License, or (at
+// your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program. (It's in the $(ROOT)/doc directory. Run make with no
+// target there if the PDF file isn't present.) If not, see
+// <http://www.gnu.org/licenses/> for a copy.
+// }}}
+// License: GPL, v3, as defined and found on www.gnu.org,
+// {{{
+// http://www.gnu.org/licenses/gpl.html
+//
+////////////////////////////////////////////////////////////////////////////////
+//
+// }}}
+#ifndef BOOTLOADER_H
+#define BOOTLOADER_H
+
+extern int _top_of_heap[1], _top_of_stack[1];
+extern int _boot_address[1];
+
+extern int _ram[1], _rom[1], _kram[1];
+
+extern int _boot_address[1],
+ _kram_start[1], _kram_end[1],
+ _ram_image_start[1], _ram_image_end[1],
+ _bss_image_end[1];
+
+#endif
diff -Naur '--exclude=*.swp' newlib-4.1.0/libgloss/zip/configure newlib-4.1.0-zip/libgloss/zip/configure
--- newlib-4.1.0/libgloss/zip/configure 1969-12-31 19:00:00.000000000 -0500
+++ newlib-4.1.0-zip/libgloss/zip/configure 2017-01-26 07:40:47.545551439 -0500
@@ -0,0 +1,3892 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.68 for libor1k 0.0.1.
+#
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+# Foundation, Inc.
+#
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test "x$CONFIG_SHELL" = x; then
+ as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+"
+ as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+ exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1"
+ as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+ eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1"
+ if (eval "$as_required") 2>/dev/null; then :
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ as_found=:
+ case $as_dir in #(
+ /*)
+ for as_base in sh bash ksh sh5; do
+ # Try only shells that exist, to save several forks.
+ as_shell=$as_dir/$as_base
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ CONFIG_SHELL=$as_shell as_have_required=yes
+ if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ break 2
+fi
+fi
+ done;;
+ esac
+ as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+ CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+ if test "x$CONFIG_SHELL" != x; then :
+ # We cannot yet assume a decent shell, so we have to provide a
+ # neutralization value for shells without unset; and this also
+ # works around shells that cannot unset nonexistent variables.
+ # Preserve -v and -x to the replacement shell.
+ BASH_ENV=/dev/null
+ ENV=/dev/null
+ (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+ export CONFIG_SHELL
+ case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+ esac
+ exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+fi
+
+ if test x$as_have_required = xno; then :
+ $as_echo "$0: This script requires a shell more modern than all"
+ $as_echo "$0: the shells that I found on your system."
+ if test x${ZSH_VERSION+set} = xset ; then
+ $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+ $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+ else
+ $as_echo "$0: Please tell [email protected] about your system,
+$0: including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
+ fi
+ exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS