1 |
diff -ruN proll_18.orig/Makefile proll-patch8/Makefile |
diff -ruN proll_18.orig/Makefile proll-patch10/Makefile |
2 |
--- proll_18.orig/Makefile 2002-09-13 14:16:59.000000000 +0000 |
--- proll_18.orig/Makefile 2002-09-13 14:16:59.000000000 +0000 |
3 |
+++ proll-patch8/Makefile 2004-11-13 15:50:49.000000000 +0000 |
+++ proll-patch10/Makefile 2004-11-13 15:50:49.000000000 +0000 |
4 |
@@ -4,6 +4,7 @@ |
@@ -4,6 +4,7 @@ |
5 |
make -C krups-ser all |
make -C krups-ser all |
6 |
make -C espresso all |
make -C espresso all |
14 |
make -C espresso clean |
make -C espresso clean |
15 |
make -C espresso-ser clean |
make -C espresso-ser clean |
16 |
+ make -C qemu clean |
+ make -C qemu clean |
17 |
diff -ruN proll_18.orig/qemu/Makefile proll-patch8/qemu/Makefile |
diff -ruN proll_18.orig/qemu/Makefile proll-patch10/qemu/Makefile |
18 |
--- proll_18.orig/qemu/Makefile 1970-01-01 00:00:00.000000000 +0000 |
--- proll_18.orig/qemu/Makefile 1970-01-01 00:00:00.000000000 +0000 |
19 |
+++ proll-patch8/qemu/Makefile 2005-03-02 16:41:50.000000000 +0000 |
+++ proll-patch10/qemu/Makefile 2005-04-12 14:42:23.000000000 +0000 |
20 |
@@ -0,0 +1,122 @@ |
@@ -0,0 +1,123 @@ |
21 |
+# |
+# |
22 |
+# proll: |
+# proll: |
23 |
+# qemu/Makefile - make PROLL for QEMU |
+# qemu/Makefile - make PROLL for QEMU |
47 |
+# want to shift it to form a PGD entry. A relocatable label will not work. |
+# want to shift it to form a PGD entry. A relocatable label will not work. |
48 |
+# Linux kernel expects us to be at LINUX_OPPROM_BEGVM <asm-sparc/openprom.h>. |
+# Linux kernel expects us to be at LINUX_OPPROM_BEGVM <asm-sparc/openprom.h>. |
49 |
+PROLBASE = 0xffd00000 |
+PROLBASE = 0xffd00000 |
50 |
+PROLRODATA = 0xffd07000 |
+PROLRODATA = 0xffd08000 |
51 |
+PROLDATA = 0xffd09000 |
+PROLDATA = 0xffd0b000 |
52 |
+PROLSIZE = 240*1024 |
+PROLSIZE = 240*1024 |
53 |
+ |
+ |
54 |
+# Linux |
+# Linux |
68 |
+OBJS = head.o wuf.o wof.o main.o $(CONSOLE) \ |
+OBJS = head.o wuf.o wof.o main.o $(CONSOLE) \ |
69 |
+ printf.o le.o system_qemu.o iommu.o \ |
+ printf.o le.o system_qemu.o iommu.o \ |
70 |
+ arp.o netinit.o bootp.o packet.o tftp.o udp.o sched_4m.o openprom.o \ |
+ arp.o netinit.o bootp.o packet.o tftp.o udp.o sched_4m.o openprom.o \ |
71 |
+ vconsole.o hconsole.o rconsole.o vcons_zs.o |
+ vconsole.o hconsole.o rconsole.o vcons_zs.o esp.o |
72 |
+ |
+ |
73 |
+all: $(ALL) |
+all: $(ALL) |
74 |
+ |
+ |
106 |
+ $(CROSSCC) $(CFLAGS) -c $(SRC)/$*.c |
+ $(CROSSCC) $(CFLAGS) -c $(SRC)/$*.c |
107 |
+le.o: $(SRC)/le.c $(SRC)/dma.h $(SRC)/system.h $(SRC)/netpriv.h $(SRC)/romlib.h $(SRC)/general.h $(SRC)/net.h $(SRC)/phys_jj.h |
+le.o: $(SRC)/le.c $(SRC)/dma.h $(SRC)/system.h $(SRC)/netpriv.h $(SRC)/romlib.h $(SRC)/general.h $(SRC)/net.h $(SRC)/phys_jj.h |
108 |
+ $(CROSSCC) $(CFLAGS) -c $(SRC)/$*.c |
+ $(CROSSCC) $(CFLAGS) -c $(SRC)/$*.c |
109 |
+ |
+esp.o: $(SRC)/esp.c $(SRC)/dma.h $(SRC)/system.h $(SRC)/romlib.h $(SRC)/general.h $(SRC)/phys_jj.h |
110 |
|
+ $(CROSSCC) $(CFLAGS) -c $(SRC)/$*.c |
111 |
+arp.o: $(SRC)/arp.c $(SRC)/general.h $(SRC)/net.h $(SRC)/romlib.h $(SRC)/netpriv.h $(SRC)/arp.h |
+arp.o: $(SRC)/arp.c $(SRC)/general.h $(SRC)/net.h $(SRC)/romlib.h $(SRC)/netpriv.h $(SRC)/arp.h |
112 |
+ $(CROSSCC) $(CFLAGS) -c $(SRC)/$*.c |
+ $(CROSSCC) $(CFLAGS) -c $(SRC)/$*.c |
113 |
+netinit.o: $(SRC)/netinit.c $(SRC)/general.h $(SRC)/net.h $(SRC)/romlib.h $(SRC)/netpriv.h $(SRC)/arp.h $(SRC)/ip.h $(SRC)/udp.h |
+netinit.o: $(SRC)/netinit.c $(SRC)/general.h $(SRC)/net.h $(SRC)/romlib.h $(SRC)/netpriv.h $(SRC)/arp.h $(SRC)/ip.h $(SRC)/udp.h |
141 |
+ |
+ |
142 |
+proll.aout: $(PROLLEXE) |
+proll.aout: $(PROLLEXE) |
143 |
+ $(ELFTOAOUT) -o proll.aout $(PROLLEXE) |
+ $(ELFTOAOUT) -o proll.aout $(PROLLEXE) |
144 |
diff -ruN proll_18.orig/qemu/head.S proll-patch8/qemu/head.S |
diff -ruN proll_18.orig/qemu/head.S proll-patch10/qemu/head.S |
145 |
--- proll_18.orig/qemu/head.S 1970-01-01 00:00:00.000000000 +0000 |
--- proll_18.orig/qemu/head.S 1970-01-01 00:00:00.000000000 +0000 |
146 |
+++ proll-patch8/qemu/head.S 2005-03-02 15:30:47.000000000 +0000 |
+++ proll-patch10/qemu/head.S 2005-03-02 15:30:47.000000000 +0000 |
147 |
@@ -0,0 +1,539 @@ |
@@ -0,0 +1,539 @@ |
148 |
+/** |
+/** |
149 |
+ ** Standalone startup code for Linux PROM emulator. |
+ ** Standalone startup code for Linux PROM emulator. |
684 |
+C_LABEL(ldb_bypass): |
+C_LABEL(ldb_bypass): |
685 |
+ retl |
+ retl |
686 |
+ lduba [%o0] ASI_M_BYPASS, %o0 |
+ lduba [%o0] ASI_M_BYPASS, %o0 |
687 |
diff -ruN proll_18.orig/qemu/main.c proll-patch8/qemu/main.c |
diff -ruN proll_18.orig/qemu/main.c proll-patch10/qemu/main.c |
688 |
--- proll_18.orig/qemu/main.c 1970-01-01 00:00:00.000000000 +0000 |
--- proll_18.orig/qemu/main.c 1970-01-01 00:00:00.000000000 +0000 |
689 |
+++ proll-patch8/qemu/main.c 2005-04-03 11:58:46.000000000 +0000 |
+++ proll-patch10/qemu/main.c 2005-04-16 18:03:23.000000000 +0000 |
690 |
@@ -0,0 +1,173 @@ |
@@ -0,0 +1,185 @@ |
691 |
+/** |
+/** |
692 |
+ ** Proll (PROM replacement) |
+ ** Proll (PROM replacement) |
693 |
+ ** Copyright 1999 Pete Zaitcev |
+ ** Copyright 1999 Pete Zaitcev |
712 |
+void *init_openprom_qemu(int bankc, struct bank *bankv, unsigned hiphybas, const char *cmdline, char boot_device, int nographic); |
+void *init_openprom_qemu(int bankc, struct bank *bankv, unsigned hiphybas, const char *cmdline, char boot_device, int nographic); |
713 |
+int vcon_zs_init(struct vconterm *t, unsigned int a0); |
+int vcon_zs_init(struct vconterm *t, unsigned int a0); |
714 |
+int vcon_zs_write(struct vconterm *t, char *data, int leng); |
+int vcon_zs_write(struct vconterm *t, char *data, int leng); |
715 |
+ |
+int vcon_zs_getch(struct vconterm *t); |
716 |
|
+void esp_probe(); |
717 |
|
+int esp_boot(int unit); |
718 |
+static void init_idprom(void); |
+static void init_idprom(void); |
719 |
+ |
+ |
720 |
+struct vconterm dp0; |
+struct vconterm dp0; |
736 |
+} *hw_idprom; |
+} *hw_idprom; |
737 |
+ |
+ |
738 |
+int ignore_fault, fault_ignored; |
+int ignore_fault, fault_ignored; |
739 |
+void *printk_fn; |
+void *printk_fn, *getch_fn; |
740 |
+unsigned int q_height, q_width; |
+unsigned int q_height, q_width; |
741 |
+ |
+ |
742 |
+/* |
+/* |
748 |
+ unsigned int hiphybas; |
+ unsigned int hiphybas; |
749 |
+ const void *romvec; |
+ const void *romvec; |
750 |
+ unsigned int ram_size; |
+ unsigned int ram_size; |
751 |
+ char nographic; |
+ char nographic, bootdev; |
752 |
+ |
+ |
753 |
+ nographic = ldb_bypass(PHYS_JJ_EEPROM + 0x2F); |
+ nographic = ldb_bypass(PHYS_JJ_EEPROM + 0x2F); |
754 |
+ if (!nographic) { |
+ if (!nographic) { |
756 |
+ q_height = ldh_bypass(PHYS_JJ_EEPROM + 0x56); |
+ q_height = ldh_bypass(PHYS_JJ_EEPROM + 0x56); |
757 |
+ vcon_init(&dp0, PHYS_JJ_TCX_FB); |
+ vcon_init(&dp0, PHYS_JJ_TCX_FB); |
758 |
+ printk_fn = vcon_write; |
+ printk_fn = vcon_write; |
759 |
|
+ getch_fn = vcon_getch; |
760 |
+ } |
+ } |
761 |
+ else { |
+ else { |
762 |
+ vcon_zs_init(&dp0, 0x71100004); |
+ vcon_zs_init(&dp0, 0x71100004); |
763 |
+ printk_fn = vcon_zs_write; |
+ printk_fn = vcon_zs_write; |
764 |
|
+ getch_fn = vcon_zs_getch; |
765 |
+ } |
+ } |
766 |
+ |
+ |
767 |
+ |
+ |
795 |
+ sched_init(); |
+ sched_init(); |
796 |
+ le_probe(); |
+ le_probe(); |
797 |
+ init_net(); |
+ init_net(); |
798 |
|
+ esp_probe(); |
799 |
+ |
+ |
800 |
+ printk("Boot device: %c\n", hw_idprom->boot_device); |
+ bootdev = hw_idprom->boot_device; |
801 |
+ if (hw_idprom->boot_device == 'n') { |
+ printk("Boot device: %c\n", bootdev); |
802 |
|
+ if (hw_idprom->kernel_size > 0) { |
803 |
|
+ printk("Kernel already loaded\n"); |
804 |
|
+ } else if (bootdev == 'n') { |
805 |
+ if (bootp() != 0) fatal(); |
+ if (bootp() != 0) fatal(); |
806 |
+ /* |
+ /* |
807 |
+ * boot_rec.bp_file cannot be used because system PROM |
+ * boot_rec.bp_file cannot be used because system PROM |
818 |
+ fname[14] = 0; |
+ fname[14] = 0; |
819 |
+ |
+ |
820 |
+ if (load(boot_rec.bp_siaddr, fname) != 0) fatal(); |
+ if (load(boot_rec.bp_siaddr, fname) != 0) fatal(); |
821 |
|
+ } else if (bootdev == 'c') { |
822 |
|
+ if (esp_boot(0) != 0) fatal(); |
823 |
|
+ } else if (bootdev == 'd') { |
824 |
|
+ if (esp_boot(2) != 0) fatal(); |
825 |
+ } |
+ } |
826 |
+ |
+ |
827 |
+ romvec = init_openprom_qemu(bb.nbanks, bb.bankv, hiphybas, |
+ romvec = init_openprom_qemu(bb.nbanks, bb.bankv, hiphybas, |
873 |
+ hw_idprom = va_prom; |
+ hw_idprom = va_prom; |
874 |
+} |
+} |
875 |
+ |
+ |
876 |
diff -ruN proll_18.orig/qemu/openprom.c proll-patch8/qemu/openprom.c |
diff -ruN proll_18.orig/qemu/openprom.c proll-patch10/qemu/openprom.c |
877 |
--- proll_18.orig/qemu/openprom.c 1970-01-01 00:00:00.000000000 +0000 |
--- proll_18.orig/qemu/openprom.c 1970-01-01 00:00:00.000000000 +0000 |
878 |
+++ proll-patch8/qemu/openprom.c 2005-04-06 16:53:31.000000000 +0000 |
+++ proll-patch10/qemu/openprom.c 2005-04-16 17:30:19.000000000 +0000 |
879 |
@@ -0,0 +1,665 @@ |
@@ -0,0 +1,741 @@ |
880 |
+/* |
+/* |
881 |
+ * PROM interface support |
+ * PROM interface support |
882 |
+ * Copyright 1996 The Australian National University. |
+ * Copyright 1996 The Australian National University. |
895 |
+ |
+ |
896 |
+//#define DEBUG_OBP |
+//#define DEBUG_OBP |
897 |
+ |
+ |
898 |
|
+#define PAGE_SIZE 4096 |
899 |
|
+ |
900 |
+struct property { |
+struct property { |
901 |
+ const char *name; |
+ const char *name; |
902 |
+ const char *value; |
+ const char *value; |
1290 |
+static int obp_devopen(char *str); |
+static int obp_devopen(char *str); |
1291 |
+static int obp_devclose(int dev_desc); |
+static int obp_devclose(int dev_desc); |
1292 |
+static int obp_rdblkdev(int dev_desc, int num_blks, int blk_st, char *buf); |
+static int obp_rdblkdev(int dev_desc, int num_blks, int blk_st, char *buf); |
1293 |
|
+static char *obp_dumb_mmap(char *va, int which_io, unsigned int pa, unsigned int size); |
1294 |
|
+static void obp_dumb_munmap(char *va, unsigned int size); |
1295 |
+ |
+ |
1296 |
+static void doublewalk(unsigned ptab1, unsigned va) |
+static void doublewalk(unsigned ptab1, unsigned va) |
1297 |
+{ |
+{ |
1370 |
+ romvec0.pv_nbgetchar = obp_nbgetchar; |
+ romvec0.pv_nbgetchar = obp_nbgetchar; |
1371 |
+ romvec0.pv_nbputchar = obp_nbputchar; |
+ romvec0.pv_nbputchar = obp_nbputchar; |
1372 |
+ romvec0.pv_reboot = obp_reboot; |
+ romvec0.pv_reboot = obp_reboot; |
1373 |
|
+ romvec0.pv_printf = (void (*)(const char *fmt, ...))printk; |
1374 |
+ romvec0.pv_abort = obp_abort; |
+ romvec0.pv_abort = obp_abort; |
1375 |
+ romvec0.pv_halt = obp_halt; |
+ romvec0.pv_halt = obp_halt; |
1376 |
+ romvec0.pv_synchook = &synch_hook; |
+ romvec0.pv_synchook = &synch_hook; |
1377 |
+ romvec0.pv_v0bootargs = &obp_argp; |
+ romvec0.pv_v0bootargs = &obp_argp; |
1378 |
|
+ romvec0.pv_v2devops.v2_dumb_mmap = obp_dumb_mmap; |
1379 |
|
+ romvec0.pv_v2devops.v2_dumb_munmap = obp_dumb_munmap; |
1380 |
|
+ obp_arg.boot_dev_ctrl = 0; |
1381 |
|
+ obp_arg.boot_dev_unit = '0'; |
1382 |
+ switch(boot_device) { |
+ switch(boot_device) { |
1383 |
+ default: |
+ default: |
1384 |
+ case 'a': |
+ case 'a': |
1385 |
+ obp_arg.argv[0] = "fd()"; |
+ obp_arg.argv[0] = "fd()"; |
1386 |
|
+ obp_arg.boot_dev[0] = 'f'; |
1387 |
|
+ obp_arg.boot_dev[1] = 'd'; |
1388 |
+ break; |
+ break; |
1389 |
|
+ case 'd': |
1390 |
|
+ obp_arg.boot_dev_unit = '2'; |
1391 |
|
+ // Fall through |
1392 |
+ case 'c': |
+ case 'c': |
1393 |
+ obp_arg.argv[0] = "sd()"; |
+ obp_arg.argv[0] = "sd()"; |
1394 |
|
+ obp_arg.boot_dev[0] = 's'; |
1395 |
|
+ obp_arg.boot_dev[1] = 'd'; |
1396 |
+ break; |
+ break; |
1397 |
+ case 'n': |
+ case 'n': |
1398 |
+ obp_arg.argv[0] = "le()"; |
+ obp_arg.argv[0] = "le()"; |
1399 |
|
+ obp_arg.boot_dev[0] = 'l'; |
1400 |
|
+ obp_arg.boot_dev[1] = 'e'; |
1401 |
+ break; |
+ break; |
1402 |
+ } |
+ } |
1403 |
+ obp_arg.argv[1] = cmdline; |
+ obp_arg.argv[1] = cmdline; |
1514 |
+ return (const char *)-1; |
+ return (const char *)-1; |
1515 |
+} |
+} |
1516 |
+ |
+ |
1517 |
|
+extern int (*getch_fn)(struct vconterm *v); |
1518 |
|
+ |
1519 |
+static int obp_nbgetchar(void) { |
+static int obp_nbgetchar(void) { |
1520 |
+ extern struct vconterm dp0; |
+ extern struct vconterm dp0; |
1521 |
+ return vcon_getch(&dp0); |
+ return getch_fn(&dp0); |
1522 |
+} |
+} |
1523 |
+ |
+ |
1524 |
+static int obp_nbputchar(int ch) { |
+static int obp_nbputchar(int ch) { |
1540 |
+ printk("halt, freezing\n"); |
+ printk("halt, freezing\n"); |
1541 |
+ for (;;) {} |
+ for (;;) {} |
1542 |
+} |
+} |
1543 |
+ |
+#define isnum(c) ((c >= '0') && (c < '9')) |
1544 |
|
+#define ctoi(c) (c - '0') |
1545 |
+static int obp_devopen(char *str) { |
+static int obp_devopen(char *str) { |
1546 |
+#ifdef DEBUG_OBP |
+#ifdef DEBUG_OBP |
1547 |
+ printk("open %s\n", str); |
+ printk("obp_devopen(%s)\n", str); |
1548 |
+#endif |
+#endif |
1549 |
|
+ if (str[0] == 's' && str[1] == 'd' && str[4] == ',') { |
1550 |
|
+ unsigned int target; |
1551 |
|
+ |
1552 |
|
+ if (str[5] < 7) |
1553 |
|
+ target = str[5]; |
1554 |
|
+ else if (isnum(str[6]) && isnum(str[5])) { |
1555 |
|
+ target = (ctoi(str[5]) * 10 + ctoi(str[6])) & 7; |
1556 |
|
+ } |
1557 |
|
+ else { |
1558 |
|
+ target = ctoi(str[5]) & 7; |
1559 |
|
+ } |
1560 |
|
+ return 's' + target; |
1561 |
|
+ } |
1562 |
+ return 0; |
+ return 0; |
1563 |
+} |
+} |
1564 |
+ |
+ |
1565 |
+static int obp_devclose(int dev_desc) { |
+static int obp_devclose(int dev_desc) { |
1566 |
+#ifdef DEBUG_OBP |
+#ifdef DEBUG_OBP |
1567 |
+ printk("close %d\n", dev_desc); |
+ printk("obp_devclose %d\n", dev_desc); |
1568 |
+#endif |
+#endif |
1569 |
+ return 0; |
+ return 0; |
1570 |
+} |
+} |
1571 |
+ |
+ |
1572 |
+static int obp_rdblkdev(int dev_desc, int num_blks, int blk_st, char *buf) { |
+extern void *esp_read(int unit, int offset, short len); |
1573 |
|
+ |
1574 |
|
+static int obp_rdblkdev(int dev_desc, int num_blks, int offset, char *buf) |
1575 |
|
+{ |
1576 |
|
+ unsigned int i; |
1577 |
|
+ void *src; |
1578 |
|
+ |
1579 |
+#ifdef DEBUG_OBP |
+#ifdef DEBUG_OBP |
1580 |
+ printk("rdblkdev: fd %d, num_blks %d, blk_st %d, buf 0x%x\n", dev_desc, num_blks, blk_st, buf); |
+ printk("obp_rdblkdev: fd %d, num_blks %d, offset %d, buf 0x%x\n", dev_desc, num_blks, offset, buf); |
1581 |
+#endif |
+#endif |
1582 |
+ //buf[8] = 'L'; |
+ if (dev_desc >= 's' && dev_desc < 'v') { |
1583 |
+ return num_blks; |
+ for(i = 0; i < num_blks; i++) { |
1584 |
|
+ src = esp_read(dev_desc - 's', offset + i, 1); |
1585 |
|
+ memcpy(&buf[i << 9], src, 512); |
1586 |
|
+ } |
1587 |
|
+ return num_blks; |
1588 |
|
+ } |
1589 |
|
+ return -1; |
1590 |
+} |
+} |
1591 |
diff -ruN proll_18.orig/qemu/system_qemu.c proll-patch8/qemu/system_qemu.c |
+ |
1592 |
|
+static char *obp_dumb_mmap(char *va, int which_io, unsigned int pa, unsigned int size) |
1593 |
|
+{ |
1594 |
|
+ unsigned int npages; |
1595 |
|
+ unsigned int off; |
1596 |
|
+ unsigned int mva; |
1597 |
|
+ |
1598 |
|
+#ifdef DEBUG_OBP |
1599 |
|
+ printk("obp_dumb_mmap: virta %x, which_io %d, paddr %x, sz %d\n", va, which_io, pa, size); |
1600 |
|
+#endif |
1601 |
|
+ off = pa & (PAGE_SIZE-1); |
1602 |
|
+ npages = (off + size + (PAGE_SIZE-1)) / PAGE_SIZE; |
1603 |
|
+ pa &= ~(PAGE_SIZE-1); |
1604 |
|
+ |
1605 |
|
+ mva = (unsigned int) va; |
1606 |
|
+ while (npages-- != 0) { |
1607 |
|
+ map_page(pmem.pl1, mva, pa, 1, pmem.pbas); |
1608 |
|
+ mva += PAGE_SIZE; |
1609 |
|
+ pa += PAGE_SIZE; |
1610 |
|
+ } |
1611 |
|
+ return va; |
1612 |
|
+} |
1613 |
|
+ |
1614 |
|
+static void obp_dumb_munmap(char *va, unsigned int size) |
1615 |
|
+{ |
1616 |
|
+#ifdef DEBUG_OBP |
1617 |
|
+ printk("obp_dumb_munmap: virta %x, sz %d\n", va, size); |
1618 |
|
+#endif |
1619 |
|
+ |
1620 |
|
+} |
1621 |
|
diff -ruN proll_18.orig/qemu/system_qemu.c proll-patch10/qemu/system_qemu.c |
1622 |
--- proll_18.orig/qemu/system_qemu.c 1970-01-01 00:00:00.000000000 +0000 |
--- proll_18.orig/qemu/system_qemu.c 1970-01-01 00:00:00.000000000 +0000 |
1623 |
+++ proll-patch8/qemu/system_qemu.c 2005-03-02 16:10:20.000000000 +0000 |
+++ proll-patch10/qemu/system_qemu.c 2005-04-16 06:16:20.000000000 +0000 |
1624 |
@@ -0,0 +1,416 @@ |
@@ -0,0 +1,430 @@ |
1625 |
+/** |
+/** |
1626 |
+ ** Proll (PROM replacement) |
+ ** Proll (PROM replacement) |
1627 |
+ ** system.c: shared miscallenea. |
+ ** system.c: shared miscallenea. |
1948 |
+{ |
+{ |
1949 |
+ char *p; |
+ char *p; |
1950 |
+ |
+ |
1951 |
+ if ((p = mem_alloc(t, size, align)) != 0) bzero(p, size); |
+ if ((p = mem_alloc(t, size, align)) != 0) memset(p, 0, size); |
1952 |
+ return p; |
+ return p; |
1953 |
+} |
+} |
1954 |
+ |
+ |
1955 |
+/* |
+/* |
1956 |
+ * Library functions |
+ * Library functions |
1957 |
+ */ |
+ */ |
1958 |
+void bzero(void *s, int len) { |
+void *memset(void *s, int c, size_t len) |
1959 |
+ while (len--) *((char *)s)++ = 0; |
+{ |
1960 |
|
+ void *p = s; |
1961 |
|
+ |
1962 |
|
+ while (len--) { |
1963 |
|
+ *(char *)s = c; |
1964 |
|
+ s++; |
1965 |
|
+ } |
1966 |
|
+ return p; |
1967 |
+} |
+} |
1968 |
+ |
+ |
1969 |
+void bcopy(const void *f, void *t, int len) { |
+void bcopy(const void *f, void *t, int len) { |
1970 |
+ while (len--) *((char *)t)++ = *((char *)f)++; |
+ while (len--) { |
1971 |
|
+ *(char *)t = *(char *)f; |
1972 |
|
+ f++; |
1973 |
|
+ t++; |
1974 |
|
+ } |
1975 |
+} |
+} |
1976 |
+ |
+ |
1977 |
+/* Comparison is 7-bit */ |
+/* Comparison is 7-bit */ |
1981 |
+ char ch; |
+ char ch; |
1982 |
+ |
+ |
1983 |
+ while (len--) { |
+ while (len--) { |
1984 |
+ ch = *((char *)s1)++; |
+ ch = *(char *)s1; |
1985 |
+ if ((i = ch - *((char *)s2)++) != 0) |
+ i = ch - *(char *)s2; |
1986 |
|
+ s1++; |
1987 |
|
+ s2++; |
1988 |
|
+ if (i != 0) |
1989 |
+ return i; |
+ return i; |
1990 |
+ if (ch == 0) |
+ if (ch == 0) |
1991 |
+ return 0; |
+ return 0; |
2052 |
+ n = (n>>24 & 0xFF) | (n>>8 & 0xFF00) | ((n&0xFF00) << 8) | (n<<24); |
+ n = (n>>24 & 0xFF) | (n>>8 & 0xFF00) | ((n&0xFF00) << 8) | (n<<24); |
2053 |
+ st_bypass(ptr, n); |
+ st_bypass(ptr, n); |
2054 |
+}; |
+}; |
2055 |
diff -ruN proll_18.orig/src/arp.c proll-patch8/src/arp.c |
diff -ruN proll_18.orig/src/arp.c proll-patch10/src/arp.c |
2056 |
--- proll_18.orig/src/arp.c 2001-12-24 05:12:31.000000000 +0000 |
--- proll_18.orig/src/arp.c 2001-12-24 05:12:31.000000000 +0000 |
2057 |
+++ proll-patch8/src/arp.c 2004-11-13 15:50:49.000000000 +0000 |
+++ proll-patch10/src/arp.c 2004-11-13 15:50:49.000000000 +0000 |
2058 |
@@ -45,7 +45,7 @@ |
@@ -45,7 +45,7 @@ |
2059 |
#endif |
#endif |
2060 |
static struct arp_cache arp_list[ARPNUM]; /* ARP address cache */ |
static struct arp_cache arp_list[ARPNUM]; /* ARP address cache */ |
2089 |
+ def_gw = IP_ANY; |
+ def_gw = IP_ANY; |
2090 |
return(TRUE); |
return(TRUE); |
2091 |
} |
} |
2092 |
diff -ruN proll_18.orig/src/arp.h proll-patch8/src/arp.h |
diff -ruN proll_18.orig/src/arp.h proll-patch10/src/arp.h |
2093 |
--- proll_18.orig/src/arp.h 1999-03-18 03:39:43.000000000 +0000 |
--- proll_18.orig/src/arp.h 1999-03-18 03:39:43.000000000 +0000 |
2094 |
+++ proll-patch8/src/arp.h 2004-11-13 15:50:49.000000000 +0000 |
+++ proll-patch10/src/arp.h 2004-11-13 15:50:49.000000000 +0000 |
2095 |
@@ -104,7 +104,7 @@ |
@@ -104,7 +104,7 @@ |
2096 |
extern int init_arp __P((void)); |
extern int init_arp __P((void)); |
2097 |
|
|
2101 |
|
|
2102 |
/* Add a new antry to the ARP cache */ |
/* Add a new antry to the ARP cache */ |
2103 |
extern void addcache __P((unsigned char *ha, t_ipaddr ip)); |
extern void addcache __P((unsigned char *ha, t_ipaddr ip)); |
2104 |
diff -ruN proll_18.orig/src/hconsole.c proll-patch8/src/hconsole.c |
diff -ruN proll_18.orig/src/esp.c proll-patch10/src/esp.c |
2105 |
|
--- proll_18.orig/src/esp.c 1970-01-01 00:00:00.000000000 +0000 |
2106 |
|
+++ proll-patch10/src/esp.c 2005-04-16 06:24:23.000000000 +0000 |
2107 |
|
@@ -0,0 +1,252 @@ |
2108 |
|
+#include <system.h> /* == <asm/system.h> */ |
2109 |
|
+#include <general.h> /* __P for netpriv.h */ |
2110 |
|
+#include <dma.h> /* dmaga */ |
2111 |
|
+#include <romlib.h> |
2112 |
|
+ |
2113 |
|
+#define PHYS_JJ_ESPDMA 0x78400000 /* ESP DMA controller */ |
2114 |
|
+#define PHYS_JJ_ESP 0x78800000 /* ESP SCSI */ |
2115 |
|
+#define PHYS_JJ_ESP_IRQ 4 |
2116 |
|
+#define BUFSIZE 4096 |
2117 |
|
+/* |
2118 |
|
+ * XXX Crude |
2119 |
|
+ */ |
2120 |
|
+struct esp_dma { |
2121 |
|
+ struct sparc_dma_registers *regs; |
2122 |
|
+ enum dvma_rev revision; |
2123 |
|
+}; |
2124 |
|
+ |
2125 |
|
+struct esp_regs { |
2126 |
|
+ unsigned int regs[16]; |
2127 |
|
+}; |
2128 |
|
+ |
2129 |
|
+struct esp_private { |
2130 |
|
+ int active; /* initialized */ |
2131 |
|
+ int inst; /* iface number */ |
2132 |
|
+ |
2133 |
|
+ volatile struct esp_regs *ll; |
2134 |
|
+ __u32 buffer_dvma; |
2135 |
|
+ unsigned int irq; /* device IRQ number */ |
2136 |
|
+ int interrupt; |
2137 |
|
+ |
2138 |
|
+ struct esp_dma *espdma; /* If set this points to espdma */ |
2139 |
|
+ |
2140 |
|
+ unsigned char *buffer; |
2141 |
|
+}; |
2142 |
|
+ |
2143 |
|
+static void esp_interrupt(void *dev_id) |
2144 |
|
+{ |
2145 |
|
+ struct esp_private *lp = (struct esp_private *)dev_id; |
2146 |
|
+ |
2147 |
|
+ lp->interrupt = 1; |
2148 |
|
+ /* Acknowledge all the interrupt sources ASAP */ |
2149 |
|
+ |
2150 |
|
+ lp->interrupt = 0; |
2151 |
|
+} |
2152 |
|
+ |
2153 |
|
+static int esp_open (void *dev) |
2154 |
|
+{ |
2155 |
|
+ struct esp_private *lp = (struct esp_private *)dev; |
2156 |
|
+ int status = 0; |
2157 |
|
+ |
2158 |
|
+ if (request_irq(lp->irq, &esp_interrupt, (void *)dev)) { |
2159 |
|
+ printk ("Esp: Can't get irq %d\n", lp->irq); |
2160 |
|
+ return -1; |
2161 |
|
+ } |
2162 |
|
+ |
2163 |
|
+ /* On the 4m, setup the espdma to provide the upper bits for buffers */ |
2164 |
|
+ if (lp->espdma) |
2165 |
|
+ lp->espdma->regs->dma_test = ((__u32) lp->buffer_dvma) & 0xff000000; |
2166 |
|
+ |
2167 |
|
+ return status; |
2168 |
|
+} |
2169 |
|
+ |
2170 |
|
+static int esp_close (void *dev) |
2171 |
|
+{ |
2172 |
|
+ struct esp_private *lp = (struct esp_private *)dev; |
2173 |
|
+ |
2174 |
|
+ free_irq (lp->irq, (void *) dev); |
2175 |
|
+ return 0; |
2176 |
|
+} |
2177 |
|
+ |
2178 |
|
+static int |
2179 |
|
+esp_init(struct esp_private *esp, struct esp_dma *espdma, int irq) |
2180 |
|
+{ |
2181 |
|
+ volatile struct esp_regs *ll; |
2182 |
|
+ |
2183 |
|
+ /* Get the IO region */ |
2184 |
|
+ ll = map_io(PHYS_JJ_ESP, sizeof (struct esp_regs)); |
2185 |
|
+ if (ll == 0) return -1; |
2186 |
|
+ |
2187 |
|
+ esp->buffer = dvma_alloc(BUFSIZE, &esp->buffer_dvma); |
2188 |
|
+ esp->ll = ll; |
2189 |
|
+ esp->espdma = espdma; |
2190 |
|
+ esp->irq = irq; |
2191 |
|
+ |
2192 |
|
+ // Chip reset |
2193 |
|
+ stb_bypass((int)ll + 3*2, 2); |
2194 |
|
+ return 0; |
2195 |
|
+} |
2196 |
|
+ |
2197 |
|
+static int espdma_init(struct esp_dma *espdma) |
2198 |
|
+{ |
2199 |
|
+ void *p; |
2200 |
|
+ |
2201 |
|
+ /* Hardcode everything for MrCoffee. */ |
2202 |
|
+ if ((p = map_io(PHYS_JJ_ESPDMA, 0x10)) == 0) { |
2203 |
|
+ printk("espdma_init: cannot map registers\n"); |
2204 |
|
+ return -1; |
2205 |
|
+ } |
2206 |
|
+ espdma->regs = p; |
2207 |
|
+ |
2208 |
|
+ printk("dma1: "); |
2209 |
|
+ |
2210 |
|
+ switch((espdma->regs->cond_reg)&DMA_DEVICE_ID) { |
2211 |
|
+ case DMA_VERS0: |
2212 |
|
+ espdma->revision=dvmarev0; |
2213 |
|
+ printk("Revision 0 "); |
2214 |
|
+ break; |
2215 |
|
+ case DMA_ESCV1: |
2216 |
|
+ espdma->revision=dvmaesc1; |
2217 |
|
+ printk("ESC Revision 1 "); |
2218 |
|
+ break; |
2219 |
|
+ case DMA_VERS1: |
2220 |
|
+ espdma->revision=dvmarev1; |
2221 |
|
+ printk("Revision 1 "); |
2222 |
|
+ break; |
2223 |
|
+ case DMA_VERS2: |
2224 |
|
+ espdma->revision=dvmarev2; |
2225 |
|
+ printk("Revision 2 "); |
2226 |
|
+ break; |
2227 |
|
+ case DMA_VERHME: |
2228 |
|
+ espdma->revision=dvmahme; |
2229 |
|
+ printk("HME DVMA gate array "); |
2230 |
|
+ break; |
2231 |
|
+ case DMA_VERSPLUS: |
2232 |
|
+ espdma->revision=dvmarevplus; |
2233 |
|
+ printk("Revision 1 PLUS "); |
2234 |
|
+ break; |
2235 |
|
+ default: |
2236 |
|
+ printk("unknown dma version %x", |
2237 |
|
+ (espdma->regs->cond_reg)&DMA_DEVICE_ID); |
2238 |
|
+ /* espdma->allocated = 1; */ |
2239 |
|
+ break; |
2240 |
|
+ } |
2241 |
|
+ printk("\n"); |
2242 |
|
+ return 0; |
2243 |
|
+} |
2244 |
|
+ |
2245 |
|
+static struct esp_dma espdma0; |
2246 |
|
+static struct esp_private esp; |
2247 |
|
+/* |
2248 |
|
+ * Find all the esp cards on the system and initialize them |
2249 |
|
+ */ |
2250 |
|
+void esp_probe () |
2251 |
|
+{ |
2252 |
|
+ if (espdma_init(&espdma0) != 0) { |
2253 |
|
+ return; |
2254 |
|
+ } |
2255 |
|
+ |
2256 |
|
+ if (esp_init(&esp, &espdma0, PHYS_JJ_ESP_IRQ) != 0) { |
2257 |
|
+ printk("esp_probe: esp0 init failed\n"); |
2258 |
|
+ return; |
2259 |
|
+ } |
2260 |
|
+ return; |
2261 |
|
+} |
2262 |
|
+ |
2263 |
|
+void *esp_read(int unit, int offset, short len) |
2264 |
|
+{ |
2265 |
|
+ // Set SCSI target |
2266 |
|
+ stb_bypass(PHYS_JJ_ESP + 4*4, unit & 7); |
2267 |
|
+ // Set DMA address |
2268 |
|
+ st_bypass(PHYS_JJ_ESPDMA + 4, esp.buffer_dvma); |
2269 |
|
+ // Set DMA length |
2270 |
|
+ stb_bypass(PHYS_JJ_ESP + 0*4, 10); |
2271 |
|
+ stb_bypass(PHYS_JJ_ESP + 1*4, 0); |
2272 |
|
+ // Set DMA direction |
2273 |
|
+ st_bypass(PHYS_JJ_ESPDMA + 0, 0x000); |
2274 |
|
+ // Setup command = Read(10) |
2275 |
|
+ esp.buffer[0] = 0x80; |
2276 |
|
+ esp.buffer[1] = 0x28; |
2277 |
|
+ esp.buffer[2] = 0x00; |
2278 |
|
+ esp.buffer[3] = (offset >> 24) & 0xff; |
2279 |
|
+ esp.buffer[4] = (offset >> 16) & 0xff; |
2280 |
|
+ esp.buffer[5] = (offset >> 8) & 0xff; |
2281 |
|
+ esp.buffer[6] = offset & 0xff; |
2282 |
|
+ esp.buffer[7] = 0x00; |
2283 |
|
+ esp.buffer[8] = (len >> 8) & 0xff; |
2284 |
|
+ esp.buffer[9] = len & 0xff; |
2285 |
|
+ // Set ATN, issue command |
2286 |
|
+ stb_bypass(PHYS_JJ_ESP + 3*4, 0x42); |
2287 |
|
+ |
2288 |
|
+ // Set DMA length = 512 * read length |
2289 |
|
+ stb_bypass(PHYS_JJ_ESP + 0*4, 0); |
2290 |
|
+ stb_bypass(PHYS_JJ_ESP + 1*4, (len << 1) & 0xff); |
2291 |
|
+ // Set DMA direction |
2292 |
|
+ st_bypass(PHYS_JJ_ESPDMA + 0, 0x100); |
2293 |
|
+ // Transfer |
2294 |
|
+ stb_bypass(PHYS_JJ_ESP + 3*4, 0x10); |
2295 |
|
+ return esp.buffer; |
2296 |
|
+} |
2297 |
|
+ |
2298 |
|
+// Sparc boot sequence can be found in SILO docs, |
2299 |
|
+// first-isofs/README.SILO_ISOFS |
2300 |
|
+int esp_boot(int unit) |
2301 |
|
+{ |
2302 |
|
+ struct sun_disklabel { |
2303 |
|
+ unsigned char info[128]; /* Informative text string */ |
2304 |
|
+ unsigned char spare0[14]; |
2305 |
|
+ struct sun_info { |
2306 |
|
+ unsigned char spare1; |
2307 |
|
+ unsigned char id; |
2308 |
|
+ unsigned char spare2; |
2309 |
|
+ unsigned char flags; |
2310 |
|
+ } infos[8]; |
2311 |
|
+ unsigned char spare[246]; /* Boot information etc. */ |
2312 |
|
+ short rspeed; /* Disk rotational speed */ |
2313 |
|
+ short pcylcount; /* Physical cylinder count */ |
2314 |
|
+ short sparecyl; /* extra sects per cylinder */ |
2315 |
|
+ unsigned char spare2[4]; /* More magic... */ |
2316 |
|
+ short ilfact; /* Interleave factor */ |
2317 |
|
+ short ncyl; /* Data cylinder count */ |
2318 |
|
+ short nacyl; /* Alt. cylinder count */ |
2319 |
|
+ short ntrks; /* Tracks per cylinder */ |
2320 |
|
+ short nsect; /* Sectors per track */ |
2321 |
|
+ unsigned char spare3[4]; /* Even more magic... */ |
2322 |
|
+ struct sun_partition { |
2323 |
|
+ int start_cylinder; |
2324 |
|
+ int num_sectors; |
2325 |
|
+ } partitions[8]; |
2326 |
|
+ short magic; /* Magic number */ |
2327 |
|
+ short csum; /* Label xor'd checksum */ |
2328 |
|
+ } *label; |
2329 |
|
+ unsigned int i, offset; |
2330 |
|
+ void *src, *dst; |
2331 |
|
+ |
2332 |
|
+ printk("Loading partition table from target %d:\n", unit); |
2333 |
|
+ // Chip reset |
2334 |
|
+ stb_bypass(PHYS_JJ_ESP + 3*4, 2); |
2335 |
|
+ |
2336 |
|
+ esp_open(&esp); |
2337 |
|
+ |
2338 |
|
+ label = esp_read(unit, 0, 1); |
2339 |
|
+ printk("CHS: %d/%d/%d, partitions:\n", label->ncyl, label->ntrks, label->nsect); |
2340 |
|
+ for (i = 0; i < 8; i++) { |
2341 |
|
+ printk("%c: %d + %d\n", 'a' + i, label->partitions[i].start_cylinder, |
2342 |
|
+ label->partitions[i].num_sectors); |
2343 |
|
+ } |
2344 |
|
+ offset = label->partitions[4].start_cylinder * label->ntrks * label->nsect + 1; |
2345 |
|
+ printk("booting sd(0,%d,0):d (offset %d)\n", unit, offset); |
2346 |
|
+ // Skip a.out header (0x20) |
2347 |
|
+ dst = (void *)0x4000; |
2348 |
|
+ src = esp_read(unit, offset, 1); |
2349 |
|
+ src = (void *)((unsigned int) src + 0x20); |
2350 |
|
+ memcpy(dst, src, 512 - 0x20); |
2351 |
|
+ dst = (void *)0x4000 + 512 - 0x20; |
2352 |
|
+ for (i = 1; i < 7680/512; i++) { |
2353 |
|
+ src = esp_read(unit, offset + i, 1); |
2354 |
|
+ memcpy(dst, src, 512); |
2355 |
|
+ dst += 512; |
2356 |
|
+ } |
2357 |
|
+ esp_close(&esp); |
2358 |
|
+ return 0; |
2359 |
|
+} |
2360 |
|
diff -ruN proll_18.orig/src/hconsole.c proll-patch10/src/hconsole.c |
2361 |
--- proll_18.orig/src/hconsole.c 2002-07-23 05:52:48.000000000 +0000 |
--- proll_18.orig/src/hconsole.c 2002-07-23 05:52:48.000000000 +0000 |
2362 |
+++ proll-patch8/src/hconsole.c 2005-03-02 17:03:09.000000000 +0000 |
+++ proll-patch10/src/hconsole.c 2005-03-02 17:03:09.000000000 +0000 |
2363 |
@@ -29,6 +29,10 @@ |
@@ -29,6 +29,10 @@ |
2364 |
struct raster r_master; /* For a case of resize, whole fb */ |
struct raster r_master; /* For a case of resize, whole fb */ |
2365 |
struct raster r_0; /* malloc() erzatz */ |
struct raster r_0; /* malloc() erzatz */ |
2383 |
t->r_ = r; |
t->r_ = r; |
2384 |
t->r0_ = q; |
t->r0_ = q; |
2385 |
t->f_ = &f_master; |
t->f_ = &f_master; |
2386 |
diff -ruN proll_18.orig/src/lat7_2.bm proll-patch8/src/lat7_2.bm |
diff -ruN proll_18.orig/src/hme.c proll-patch10/src/hme.c |
2387 |
|
--- proll_18.orig/src/hme.c 2002-07-23 05:52:52.000000000 +0000 |
2388 |
|
+++ proll-patch10/src/hme.c 2005-04-16 06:16:20.000000000 +0000 |
2389 |
|
@@ -655,10 +655,10 @@ |
2390 |
|
unsigned int flags, |
2391 |
|
unsigned int addr) |
2392 |
|
{ |
2393 |
|
- __asm__ __volatile__(" |
2394 |
|
- stwa %3, [%0] %2 |
2395 |
|
- stwa %4, [%1] %2 |
2396 |
|
-" : /* no outputs */ |
2397 |
|
+ __asm__ __volatile__( |
2398 |
|
+ "stwa %3, [%0] %2\n\t" |
2399 |
|
+ "stwa %4, [%1] %2\n\t" |
2400 |
|
+ : /* no outputs */ |
2401 |
|
: "r" (&rp->rx_addr), "r" (&rp->rx_flags), |
2402 |
|
"i" (ASI_PL), "r" (addr), "r" (flags)); |
2403 |
|
} |
2404 |
|
@@ -667,10 +667,10 @@ |
2405 |
|
unsigned int flags, |
2406 |
|
unsigned int addr) |
2407 |
|
{ |
2408 |
|
- __asm__ __volatile__(" |
2409 |
|
- stwa %3, [%0] %2 |
2410 |
|
- stwa %4, [%1] %2 |
2411 |
|
-" : /* no outputs */ |
2412 |
|
+ __asm__ __volatile__( |
2413 |
|
+ "stwa %3, [%0] %2\n\t" |
2414 |
|
+ "stwa %4, [%1] %2\n\t" |
2415 |
|
+ : /* no outputs */ |
2416 |
|
: "r" (&tp->tx_addr), "r" (&tp->tx_flags), |
2417 |
|
"i" (ASI_PL), "r" (addr), "r" (flags)); |
2418 |
|
} |
2419 |
|
@@ -2404,7 +2404,7 @@ |
2420 |
|
TXD(("[%d]", elem)); |
2421 |
|
this = &txbase[elem]; |
2422 |
|
#ifdef __sparc_v9__ |
2423 |
|
- __asm__ __volatile__("lduwa [%1] %2, %0" |
2424 |
|
+ __asm__ __volatile__("lduwa [%1] %2, %0\n\t" |
2425 |
|
: "=r" (flags) |
2426 |
|
: "r" (&this->tx_flags), "i" (ASI_PL)); |
2427 |
|
#else |
2428 |
|
@@ -2447,7 +2447,7 @@ |
2429 |
|
RXD(("RX<")); |
2430 |
|
this = &rxbase[elem]; |
2431 |
|
#ifdef __sparc_v9__ |
2432 |
|
- __asm__ __volatile__("lduwa [%1] %2, %0" |
2433 |
|
+ __asm__ __volatile__("lduwa [%1] %2, %0\n\t" |
2434 |
|
: "=r" (flags) |
2435 |
|
: "r" (&this->rx_flags), "i" (ASI_PL)); |
2436 |
|
#else |
2437 |
|
@@ -2530,7 +2530,7 @@ |
2438 |
|
elem = NEXT_RX(elem); |
2439 |
|
this = &rxbase[elem]; |
2440 |
|
#ifdef __sparc_v9__ |
2441 |
|
- __asm__ __volatile__("lduwa [%1] %2, %0" |
2442 |
|
+ __asm__ __volatile__("lduwa [%1] %2, %0\n\t" |
2443 |
|
: "=r" (flags) |
2444 |
|
: "r" (&this->rx_flags), "i" (ASI_PL)); |
2445 |
|
#else |
2446 |
|
diff -ruN proll_18.orig/src/lat7_2.bm proll-patch10/src/lat7_2.bm |
2447 |
--- proll_18.orig/src/lat7_2.bm 1999-02-27 05:48:54.000000000 +0000 |
--- proll_18.orig/src/lat7_2.bm 1999-02-27 05:48:54.000000000 +0000 |
2448 |
+++ proll-patch8/src/lat7_2.bm 2004-11-13 15:50:49.000000000 +0000 |
+++ proll-patch10/src/lat7_2.bm 2004-11-13 15:50:49.000000000 +0000 |
2449 |
@@ -1,6 +1,6 @@ |
@@ -1,6 +1,6 @@ |
2450 |
#define lat7_2_width 128 |
#define lat7_2_width 128 |
2451 |
#define lat7_2_height 88 |
#define lat7_2_height 88 |
2454 |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
2455 |
0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0x12, 0x1e, 0x0c, 0x02, 0x70, 0x18, |
0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0x12, 0x1e, 0x0c, 0x02, 0x70, 0x18, |
2456 |
0x22, 0x22, 0x18, 0x00, 0x00, 0x18, 0x18, 0xff, 0x18, 0x00, 0x12, 0x02, |
0x22, 0x22, 0x18, 0x00, 0x00, 0x18, 0x18, 0xff, 0x18, 0x00, 0x12, 0x02, |
2457 |
diff -ruN proll_18.orig/src/lat7_2_swapped.bm proll-patch8/src/lat7_2_swapped.bm |
diff -ruN proll_18.orig/src/lat7_2_swapped.bm proll-patch10/src/lat7_2_swapped.bm |
2458 |
--- proll_18.orig/src/lat7_2_swapped.bm 1970-01-01 00:00:00.000000000 +0000 |
--- proll_18.orig/src/lat7_2_swapped.bm 1970-01-01 00:00:00.000000000 +0000 |
2459 |
+++ proll-patch8/src/lat7_2_swapped.bm 2004-11-13 15:50:49.000000000 +0000 |
+++ proll-patch10/src/lat7_2_swapped.bm 2004-11-13 15:50:49.000000000 +0000 |
2460 |
@@ -0,0 +1,121 @@ |
@@ -0,0 +1,121 @@ |
2461 |
+#define lat7_2_width 128 |
+#define lat7_2_width 128 |
2462 |
+#define lat7_2_height 88 |
+#define lat7_2_height 88 |
2579 |
+ 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x36, 0x6c, 0x00, 0x00, 0x00, |
+ 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x36, 0x6c, 0x00, 0x00, 0x00, |
2580 |
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x42, 0x00, 0x00, 0x00, 0x00, |
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x42, 0x00, 0x00, 0x00, 0x00, |
2581 |
+ 0x00, 0x00, 0x00, 0x00}; |
+ 0x00, 0x00, 0x00, 0x00}; |
2582 |
diff -ruN proll_18.orig/src/le.c proll-patch8/src/le.c |
diff -ruN proll_18.orig/src/le.c proll-patch10/src/le.c |
2583 |
--- proll_18.orig/src/le.c 2002-07-23 05:52:49.000000000 +0000 |
--- proll_18.orig/src/le.c 2002-07-23 05:52:49.000000000 +0000 |
2584 |
+++ proll-patch8/src/le.c 2004-11-13 15:50:49.000000000 +0000 |
+++ proll-patch10/src/le.c 2005-04-16 06:16:20.000000000 +0000 |
2585 |
@@ -185,8 +185,6 @@ |
@@ -185,8 +185,6 @@ |
2586 |
unsigned short rap; /* register address port */ |
unsigned short rap; /* register address port */ |
2587 |
}; |
}; |
2591 |
/* The Lance uses 24 bit addresses */ |
/* The Lance uses 24 bit addresses */ |
2592 |
/* On the Sun4c the DVMA will provide the remaining bytes for us */ |
/* On the Sun4c the DVMA will provide the remaining bytes for us */ |
2593 |
/* On the Sun4m we have to instruct the ledma to provide them */ |
/* On the Sun4m we have to instruct the ledma to provide them */ |
2594 |
diff -ruN proll_18.orig/src/netinit.c proll-patch8/src/netinit.c |
@@ -771,7 +769,7 @@ |
2595 |
|
/* Clear the slack of the packet, do I need this? */ |
2596 |
|
/* For a firewall its a good idea - AC */ |
2597 |
|
if (len != skblen) |
2598 |
|
- bzero((char *) &ib->tx_buf [entry][skblen], len - skblen); |
2599 |
|
+ memset((char *) &ib->tx_buf [entry][skblen], 0, len - skblen); |
2600 |
|
|
2601 |
|
/* Now, give the packet to the lance */ |
2602 |
|
ib->btx_ring [entry].tmd1_bits = (LE_T1_POK|LE_T1_OWN); |
2603 |
|
diff -ruN proll_18.orig/src/netinit.c proll-patch10/src/netinit.c |
2604 |
--- proll_18.orig/src/netinit.c 2002-09-13 21:53:33.000000000 +0000 |
--- proll_18.orig/src/netinit.c 2002-09-13 21:53:33.000000000 +0000 |
2605 |
+++ proll-patch8/src/netinit.c 2004-11-13 15:50:49.000000000 +0000 |
+++ proll-patch10/src/netinit.c 2004-11-13 15:50:49.000000000 +0000 |
2606 |
@@ -49,13 +49,20 @@ |
@@ -49,13 +49,20 @@ |
2607 |
unsigned char myhwaddr[ETH_ALEN]; /* my own hardware addr */ |
unsigned char myhwaddr[ETH_ALEN]; /* my own hardware addr */ |
2608 |
t_ipaddr myipaddr; /* my own IP address */ |
t_ipaddr myipaddr; /* my own IP address */ |
2646 |
fatal(); |
fatal(); |
2647 |
} |
} |
2648 |
} |
} |
2649 |
diff -ruN proll_18.orig/src/netpriv.h proll-patch8/src/netpriv.h |
diff -ruN proll_18.orig/src/netpriv.h proll-patch10/src/netpriv.h |
2650 |
--- proll_18.orig/src/netpriv.h 1999-04-27 05:39:37.000000000 +0000 |
--- proll_18.orig/src/netpriv.h 1999-04-27 05:39:37.000000000 +0000 |
2651 |
+++ proll-patch8/src/netpriv.h 2004-11-13 15:50:49.000000000 +0000 |
+++ proll-patch10/src/netpriv.h 2004-11-13 15:50:49.000000000 +0000 |
2652 |
@@ -130,10 +130,9 @@ |
@@ -130,10 +130,9 @@ |
2653 |
* |
* |
2654 |
*/ |
*/ |
2670 |
|
|
2671 |
/* Empty read buffer */ |
/* Empty read buffer */ |
2672 |
extern void empty_buf __P((void)); |
extern void empty_buf __P((void)); |
2673 |
diff -ruN proll_18.orig/src/openprom.h proll-patch8/src/openprom.h |
diff -ruN proll_18.orig/src/openprom.h proll-patch10/src/openprom.h |
2674 |
--- proll_18.orig/src/openprom.h 2002-07-14 02:26:30.000000000 +0000 |
--- proll_18.orig/src/openprom.h 2002-07-14 02:26:30.000000000 +0000 |
2675 |
+++ proll-patch8/src/openprom.h 2004-11-13 15:50:49.000000000 +0000 |
+++ proll-patch10/src/openprom.h 2004-11-13 15:50:49.000000000 +0000 |
2676 |
@@ -54,20 +54,20 @@ |
@@ -54,20 +54,20 @@ |
2677 |
}; |
}; |
2678 |
|
|
2734 |
}; |
}; |
2735 |
|
|
2736 |
/* More fun PROM structures for device probing. */ |
/* More fun PROM structures for device probing. */ |
2737 |
diff -ruN proll_18.orig/src/packet.c proll-patch8/src/packet.c |
diff -ruN proll_18.orig/src/packet.c proll-patch10/src/packet.c |
2738 |
--- proll_18.orig/src/packet.c 2000-02-11 04:56:45.000000000 +0000 |
--- proll_18.orig/src/packet.c 2000-02-11 04:56:45.000000000 +0000 |
2739 |
+++ proll-patch8/src/packet.c 2004-11-13 15:50:49.000000000 +0000 |
+++ proll-patch10/src/packet.c 2004-11-13 15:50:49.000000000 +0000 |
2740 |
@@ -41,7 +41,7 @@ |
@@ -41,7 +41,7 @@ |
2741 |
int aligner; |
int aligner; |
2742 |
} wbuf; |
} wbuf; |
2764 |
{ |
{ |
2765 |
struct sk_buff *skb; |
struct sk_buff *skb; |
2766 |
unsigned char *s; |
unsigned char *s; |
2767 |
diff -ruN proll_18.orig/src/printf.c proll-patch8/src/printf.c |
diff -ruN proll_18.orig/src/printf.c proll-patch10/src/printf.c |
2768 |
--- proll_18.orig/src/printf.c 1999-03-19 07:03:59.000000000 +0000 |
--- proll_18.orig/src/printf.c 1999-03-19 07:03:59.000000000 +0000 |
2769 |
+++ proll-patch8/src/printf.c 2004-11-13 15:50:49.000000000 +0000 |
+++ proll-patch10/src/printf.c 2004-11-13 15:50:49.000000000 +0000 |
2770 |
@@ -19,7 +19,7 @@ |
@@ -19,7 +19,7 @@ |
2771 |
static void printn(struct prf_fp *, unsigned long, unsigned int); |
static void printn(struct prf_fp *, unsigned long, unsigned int); |
2772 |
static void putchar(char, struct prf_fp *); |
static void putchar(char, struct prf_fp *); |
2794 |
putchar(c,filog); |
putchar(c,filog); |
2795 |
} else if (c == 'l' || c == 'O') { |
} else if (c == 'l' || c == 'O') { |
2796 |
printn(filog, (long)va_arg(adx,long), c=='l'?10:8); |
printn(filog, (long)va_arg(adx,long), c=='l'?10:8); |
2797 |
diff -ruN proll_18.orig/src/rconsole.c proll-patch8/src/rconsole.c |
diff -ruN proll_18.orig/src/rconsole.c proll-patch10/src/rconsole.c |
2798 |
--- proll_18.orig/src/rconsole.c 1999-01-16 07:16:55.000000000 +0000 |
--- proll_18.orig/src/rconsole.c 1999-01-16 07:16:55.000000000 +0000 |
2799 |
+++ proll-patch8/src/rconsole.c 2004-11-13 15:50:49.000000000 +0000 |
+++ proll-patch10/src/rconsole.c 2005-04-16 06:16:20.000000000 +0000 |
2800 |
@@ -28,12 +28,18 @@ |
@@ -28,12 +28,18 @@ |
2801 |
* move to California. Only plain lat7 survived. |
* move to California. Only plain lat7 survived. |
2802 |
* I recreated lat7-1 changes in lat7-2. --zaitcev |
* I recreated lat7-1 changes in lat7-2. --zaitcev |
2816 |
|
|
2817 |
#if 1 |
#if 1 |
2818 |
/* |
/* |
2819 |
|
@@ -46,18 +52,18 @@ |
2820 |
|
#endif |
2821 |
|
|
2822 |
|
static __inline__ void stfb_w(void *ptr, unsigned int data) { |
2823 |
|
- __asm__ __volatile__ ("sta %0, [%1] %2" : : |
2824 |
|
+ __asm__ __volatile__ ("sta %0, [%1] %2\n\t" : : |
2825 |
|
"r" (data), "r" (ptr), "i" (ASI_M_BYPASS)); |
2826 |
|
} |
2827 |
|
|
2828 |
|
static __inline__ void stfb_b(void *ptr, unsigned int data) { |
2829 |
|
- __asm__ __volatile__ ("stba %0, [%1] %2" : : |
2830 |
|
+ __asm__ __volatile__ ("stba %0, [%1] %2\n\t" : : |
2831 |
|
"r" (data), "r" (ptr), "i" (ASI_M_BYPASS)); |
2832 |
|
} |
2833 |
|
|
2834 |
|
static __inline__ unsigned int ldfb_w(void *ptr) { |
2835 |
|
unsigned int data; |
2836 |
|
- __asm__ __volatile__ ("lda [%1] %2, %0" : |
2837 |
|
+ __asm__ __volatile__ ("lda [%1] %2, %0\n\t" : |
2838 |
|
"=r" (data) : |
2839 |
|
"r" (ptr), "i" (ASI_M_BYPASS)); |
2840 |
|
return data; |
2841 |
|
@@ -65,7 +71,7 @@ |
2842 |
|
|
2843 |
|
static __inline__ unsigned int ldfb_b(void *ptr) { |
2844 |
|
unsigned int data; |
2845 |
|
- __asm__ __volatile__ ("lduba [%1] %2, %0" : |
2846 |
|
+ __asm__ __volatile__ ("lduba [%1] %2, %0\n\t" : |
2847 |
|
"=r" (data) : |
2848 |
|
"r" (ptr), "i" (ASI_M_BYPASS)); |
2849 |
|
return data; |
2850 |
@@ -94,6 +100,7 @@ |
@@ -94,6 +100,7 @@ |
2851 |
|
|
2852 |
#endif |
#endif |
2882 |
p->nchars_ = LAT7_NCHARS; |
p->nchars_ = LAT7_NCHARS; |
2883 |
p->width_ = LAT7_WIDTH; |
p->width_ = LAT7_WIDTH; |
2884 |
p->height_ = LAT7_HEIGHT; |
p->height_ = LAT7_HEIGHT; |
2885 |
diff -ruN proll_18.orig/src/rconsole.h proll-patch8/src/rconsole.h |
diff -ruN proll_18.orig/src/rconsole.h proll-patch10/src/rconsole.h |
2886 |
--- proll_18.orig/src/rconsole.h 1999-01-16 05:00:59.000000000 +0000 |
--- proll_18.orig/src/rconsole.h 1999-01-16 05:00:59.000000000 +0000 |
2887 |
+++ proll-patch8/src/rconsole.h 2004-11-13 15:50:49.000000000 +0000 |
+++ proll-patch10/src/rconsole.h 2004-11-13 15:50:49.000000000 +0000 |
2888 |
@@ -13,10 +13,10 @@ |
@@ -13,10 +13,10 @@ |
2889 |
*/ |
*/ |
2890 |
|
|
2898 |
int nchars_; /* 128 for ASCII ... 65536 for Unicode */ |
int nchars_; /* 128 for ASCII ... 65536 for Unicode */ |
2899 |
int width_; /* [Pixels]. Maximum size is 16. */ |
int width_; /* [Pixels]. Maximum size is 16. */ |
2900 |
int height_; /* [Pixels == scan lines]. */ |
int height_; /* [Pixels == scan lines]. */ |
2901 |
diff -ruN proll_18.orig/src/romlib.h proll-patch8/src/romlib.h |
diff -ruN proll_18.orig/src/romlib.h proll-patch10/src/romlib.h |
2902 |
--- proll_18.orig/src/romlib.h 1999-04-20 04:26:45.000000000 +0000 |
--- proll_18.orig/src/romlib.h 1999-04-20 04:26:45.000000000 +0000 |
2903 |
+++ proll-patch8/src/romlib.h 2004-11-13 15:50:49.000000000 +0000 |
+++ proll-patch10/src/romlib.h 2005-04-16 20:32:49.000000000 +0000 |
2904 |
@@ -73,12 +73,12 @@ |
@@ -72,13 +72,13 @@ |
2905 |
|
*/ |
2906 |
#define memcpy(dst, src, len) bcopy(src, dst, len) |
#define memcpy(dst, src, len) bcopy(src, dst, len) |
2907 |
#define memcmp(x1, x2, len) bcmp(x1, x2, len) |
#define memcmp(x1, x2, len) bcmp(x1, x2, len) |
2908 |
#define memset(p, len, zero) bzero(p, len) |
-#define memset(p, len, zero) bzero(p, len) |
2909 |
-extern void bcopy(void *b1, void *b2, int length); |
-extern void bcopy(void *b1, void *b2, int length); |
2910 |
-extern int bcmp(void *b1, void *b2, int length); |
-extern int bcmp(void *b1, void *b2, int length); |
2911 |
|
-extern void bzero(void *b, int c); |
2912 |
+extern void bcopy(const void *b1, void *b2, int length); |
+extern void bcopy(const void *b1, void *b2, int length); |
2913 |
+extern int bcmp(const void *b1, const void *b2, int length); |
+extern int bcmp(const void *b1, const void *b2, int length); |
2914 |
extern void bzero(void *b, int c); |
+typedef unsigned int size_t; |
2915 |
|
+extern void *memset(void *p, int c, size_t len); |
2916 |
/* gcc complains about "conflicting types for builtin function strlen". */ |
/* gcc complains about "conflicting types for builtin function strlen". */ |
2917 |
#define strlen(s) ssize(s) |
#define strlen(s) ssize(s) |
2918 |
-extern int ssize(char *s); |
-extern int ssize(char *s); |
2920 |
|
|
2921 |
|
|
2922 |
/* |
/* |
2923 |
diff -ruN proll_18.orig/src/sched_4m.c proll-patch8/src/sched_4m.c |
diff -ruN proll_18.orig/src/sched_4m.c proll-patch10/src/sched_4m.c |
2924 |
--- proll_18.orig/src/sched_4m.c 1999-04-27 05:48:51.000000000 +0000 |
--- proll_18.orig/src/sched_4m.c 1999-04-27 05:48:51.000000000 +0000 |
2925 |
+++ proll-patch8/src/sched_4m.c 2004-11-13 15:50:49.000000000 +0000 |
+++ proll-patch10/src/sched_4m.c 2004-11-13 15:50:49.000000000 +0000 |
2926 |
@@ -108,7 +108,7 @@ |
@@ -108,7 +108,7 @@ |
2927 |
static int set_bolt; /* Tick counter limit */ |
static int set_bolt; /* Tick counter limit */ |
2928 |
static struct handsc hndv[16]; |
static struct handsc hndv[16]; |
2932 |
0, 0, 0, 0, 0, 0, SUN4M_INT_ETHERNET, 0, |
0, 0, 0, 0, 0, 0, SUN4M_INT_ETHERNET, 0, |
2933 |
0, 0, 0, 0, 0, 0, 0, 0, |
0, 0, 0, 0, 0, 0, 0, 0, |
2934 |
}; |
}; |
2935 |
diff -ruN proll_18.orig/src/swap.c proll-patch8/src/swap.c |
diff -ruN proll_18.orig/src/swap.c proll-patch10/src/swap.c |
2936 |
--- proll_18.orig/src/swap.c 1970-01-01 00:00:00.000000000 +0000 |
--- proll_18.orig/src/swap.c 1970-01-01 00:00:00.000000000 +0000 |
2937 |
+++ proll-patch8/src/swap.c 2004-11-13 15:50:49.000000000 +0000 |
+++ proll-patch10/src/swap.c 2004-11-13 15:50:49.000000000 +0000 |
2938 |
@@ -0,0 +1,21 @@ |
@@ -0,0 +1,21 @@ |
2939 |
+// Convert the lat7 font so that no conversion is needed at runtime. |
+// Convert the lat7 font so that no conversion is needed at runtime. |
2940 |
+#define ORIG |
+#define ORIG |
2957 |
+ } |
+ } |
2958 |
+ printf("\n"); |
+ printf("\n"); |
2959 |
+} |
+} |
2960 |
diff -ruN proll_18.orig/src/system.c proll-patch8/src/system.c |
diff -ruN proll_18.orig/src/system.c proll-patch10/src/system.c |
2961 |
--- proll_18.orig/src/system.c 2002-07-23 05:52:49.000000000 +0000 |
--- proll_18.orig/src/system.c 2002-07-23 05:52:49.000000000 +0000 |
2962 |
+++ proll-patch8/src/system.c 2004-11-13 15:50:49.000000000 +0000 |
+++ proll-patch10/src/system.c 2005-04-16 06:16:20.000000000 +0000 |
2963 |
@@ -298,8 +298,8 @@ |
@@ -298,8 +298,8 @@ |
2964 |
} |
} |
2965 |
|
|
2971 |
map_page(l1, va, pa, 0, highbase); |
map_page(l1, va, pa, 0, highbase); |
2972 |
pa += PAGE_SIZE; |
pa += PAGE_SIZE; |
2973 |
} |
} |
2974 |
@@ -518,12 +518,12 @@ |
@@ -507,30 +507,44 @@ |
2975 |
while (len--) *((char *)s)++ = 0; |
{ |
2976 |
|
char *p; |
2977 |
|
|
2978 |
|
- if ((p = mem_alloc(t, size, align)) != 0) bzero(p, size); |
2979 |
|
+ if ((p = mem_alloc(t, size, align)) != 0) memset(p, 0, size); |
2980 |
|
return p; |
2981 |
|
} |
2982 |
|
|
2983 |
|
/* |
2984 |
|
* Library functions |
2985 |
|
*/ |
2986 |
|
-void bzero(void *s, int len) { |
2987 |
|
- while (len--) *((char *)s)++ = 0; |
2988 |
|
+void *memset(void *s, int c, size_t len) |
2989 |
|
+{ |
2990 |
|
+ void *p = s; |
2991 |
|
+ |
2992 |
|
+ while (len--) { |
2993 |
|
+ *(char *)s = c; |
2994 |
|
+ s++; |
2995 |
|
+ } |
2996 |
|
+ return p; |
2997 |
} |
} |
2998 |
|
|
2999 |
-void bcopy(void *f, void *t, int len) { |
-void bcopy(void *f, void *t, int len) { |
3000 |
|
- while (len--) *((char *)t)++ = *((char *)f)++; |
3001 |
+void bcopy(const void *f, void *t, int len) { |
+void bcopy(const void *f, void *t, int len) { |
3002 |
while (len--) *((char *)t)++ = *((char *)f)++; |
+ while (len--) { |
3003 |
|
+ *(char *)t = *(char *)f; |
3004 |
|
+ f++; |
3005 |
|
+ t++; |
3006 |
|
+ } |
3007 |
} |
} |
3008 |
|
|
3009 |
/* Comparison is 7-bit */ |
/* Comparison is 7-bit */ |
3012 |
{ |
{ |
3013 |
int i; |
int i; |
3014 |
char ch; |
char ch; |
3015 |
@@ -538,8 +538,8 @@ |
|
3016 |
|
while (len--) { |
3017 |
|
- ch = *((char *)s1)++; |
3018 |
|
- if ((i = ch - *((char *)s2)++) != 0) |
3019 |
|
+ ch = *(char *)s1; |
3020 |
|
+ i = ch - *(char *)s2; |
3021 |
|
+ s1++; |
3022 |
|
+ s2++; |
3023 |
|
+ if (i != 0) |
3024 |
|
return i; |
3025 |
|
if (ch == 0) |
3026 |
|
return 0; |
3027 |
|
@@ -538,8 +552,8 @@ |
3028 |
return 0; |
return 0; |
3029 |
} |
} |
3030 |
|
|
3035 |
for (p = s; *p != 0; p++) { } |
for (p = s; *p != 0; p++) { } |
3036 |
return p - s; |
return p - s; |
3037 |
} |
} |
3038 |
@@ -560,14 +560,6 @@ |
@@ -560,14 +574,6 @@ |
3039 |
va_end(x1); |
va_end(x1); |
3040 |
} |
} |
3041 |
|
|
3050 |
void fatal() |
void fatal() |
3051 |
{ |
{ |
3052 |
printk("fatal."); |
printk("fatal."); |
3053 |
diff -ruN proll_18.orig/src/system.h proll-patch8/src/system.h |
diff -ruN proll_18.orig/src/system.h proll-patch10/src/system.h |
3054 |
--- proll_18.orig/src/system.h 2002-09-13 21:53:32.000000000 +0000 |
--- proll_18.orig/src/system.h 2002-09-13 21:53:32.000000000 +0000 |
3055 |
+++ proll-patch8/src/system.h 2004-11-13 15:50:49.000000000 +0000 |
+++ proll-patch10/src/system.h 2005-04-16 06:16:20.000000000 +0000 |
3056 |
@@ -16,7 +16,7 @@ |
@@ -16,7 +16,7 @@ |
3057 |
#define IOMAPSIZE (1*1024*1024) /* 1 Meg maximum: we do not map framebuffer. */ |
#define IOMAPSIZE (1*1024*1024) /* 1 Meg maximum: we do not map framebuffer. */ |
3058 |
#define NCTX_SWIFT 0x100 |
#define NCTX_SWIFT 0x100 |
3062 |
|
|
3063 |
#ifndef __ASSEMBLY__ |
#ifndef __ASSEMBLY__ |
3064 |
struct bank { |
struct bank { |
3065 |
diff -ruN proll_18.orig/src/udp.c proll-patch8/src/udp.c |
@@ -164,10 +164,10 @@ |
3066 |
|
|
3067 |
|
extern __inline__ void setipl(unsigned long __orig_psr) |
3068 |
|
{ |
3069 |
|
- __asm__ __volatile__(" |
3070 |
|
- wr %0, 0x0, %%psr |
3071 |
|
- nop; nop; nop |
3072 |
|
-" : /* no outputs */ |
3073 |
|
+ __asm__ __volatile__( |
3074 |
|
+ "wr %0, 0x0, %%psr\n\t" |
3075 |
|
+ "nop; nop; nop\n\t" |
3076 |
|
+ : /* no outputs */ |
3077 |
|
: "r" (__orig_psr) |
3078 |
|
: "memory", "cc"); |
3079 |
|
} |
3080 |
|
@@ -176,13 +176,13 @@ |
3081 |
|
{ |
3082 |
|
unsigned long tmp; |
3083 |
|
|
3084 |
|
- __asm__ __volatile__(" |
3085 |
|
- rd %%psr, %0 |
3086 |
|
- nop; nop; nop; /* Sun4m + Cypress + SMP bug */ |
3087 |
|
- or %0, %1, %0 |
3088 |
|
- wr %0, 0x0, %%psr |
3089 |
|
- nop; nop; nop |
3090 |
|
-" : "=r" (tmp) |
3091 |
|
+ __asm__ __volatile__( |
3092 |
|
+ "rd %%psr, %0\n\t" |
3093 |
|
+ "nop; nop; nop;\n\t" /* Sun4m + Cypress + SMP bug */ |
3094 |
|
+ "or %0, %1, %0\n\t" |
3095 |
|
+ "wr %0, 0x0, %%psr\n\t" |
3096 |
|
+ "nop; nop; nop\n\t" |
3097 |
|
+ : "=r" (tmp) |
3098 |
|
: "i" (PSR_PIL) |
3099 |
|
: "memory"); |
3100 |
|
} |
3101 |
|
@@ -191,13 +191,13 @@ |
3102 |
|
{ |
3103 |
|
unsigned long tmp; |
3104 |
|
|
3105 |
|
- __asm__ __volatile__(" |
3106 |
|
- rd %%psr, %0 |
3107 |
|
- nop; nop; nop; /* Sun4m + Cypress + SMP bug */ |
3108 |
|
- andn %0, %1, %0 |
3109 |
|
- wr %0, 0x0, %%psr |
3110 |
|
- nop; nop; nop |
3111 |
|
-" : "=r" (tmp) |
3112 |
|
+ __asm__ __volatile__( |
3113 |
|
+ "rd %%psr, %0\n\t" |
3114 |
|
+ "nop; nop; nop;\n\t" /* Sun4m + Cypress + SMP bug */ |
3115 |
|
+ "andn %0, %1, %0\n\t" |
3116 |
|
+ "wr %0, 0x0, %%psr\n\t" |
3117 |
|
+ "nop; nop; nop\n\t" |
3118 |
|
+ : "=r" (tmp) |
3119 |
|
: "i" (PSR_PIL) |
3120 |
|
: "memory"); |
3121 |
|
} |
3122 |
|
@@ -214,18 +214,18 @@ |
3123 |
|
{ |
3124 |
|
unsigned long retval; |
3125 |
|
|
3126 |
|
- __asm__ __volatile__(" |
3127 |
|
- rd %%psr, %0 |
3128 |
|
- nop; nop; nop; /* Sun4m + Cypress + SMP bug */ |
3129 |
|
- and %0, %2, %%g1 |
3130 |
|
- and %1, %2, %%g2 |
3131 |
|
- xorcc %%g1, %%g2, %%g0 |
3132 |
|
- be 1f |
3133 |
|
- nop |
3134 |
|
- wr %0, %2, %%psr |
3135 |
|
- nop; nop; nop; |
3136 |
|
-1: |
3137 |
|
-" : "=r" (retval) |
3138 |
|
+ __asm__ __volatile__( |
3139 |
|
+ "rd %%psr, %0\n\t" |
3140 |
|
+ "nop; nop; nop;\n\t" /* Sun4m + Cypress + SMP bug */ |
3141 |
|
+ "and %0, %2, %%g1\n\t" |
3142 |
|
+ "and %1, %2, %%g2\n\t" |
3143 |
|
+ "xorcc %%g1, %%g2, %%g0\n\t" |
3144 |
|
+ "be 1f\n\t" |
3145 |
|
+ "nop\n\t" |
3146 |
|
+ "wr %0, %2, %%psr\n\t" |
3147 |
|
+ "nop; nop; nop;\n\t" |
3148 |
|
+ "1:\n\t" |
3149 |
|
+ : "=r" (retval) |
3150 |
|
: "r" (__new_psr), "i" (PSR_PIL) |
3151 |
|
: "g1", "g2", "memory", "cc"); |
3152 |
|
|
3153 |
|
@@ -236,13 +236,13 @@ |
3154 |
|
{ |
3155 |
|
unsigned long retval; |
3156 |
|
|
3157 |
|
- __asm__ __volatile__(" |
3158 |
|
- rd %%psr, %0 |
3159 |
|
- nop; nop; nop; /* Sun4m + Cypress + SMP bug */ |
3160 |
|
- or %0, %1, %%g1 |
3161 |
|
- wr %%g1, 0x0, %%psr |
3162 |
|
- nop; nop; nop |
3163 |
|
-" : "=r" (retval) |
3164 |
|
+ __asm__ __volatile__( |
3165 |
|
+ "rd %%psr, %0\n\t" |
3166 |
|
+ "nop; nop; nop;\n\t" /* Sun4m + Cypress + SMP bug */ |
3167 |
|
+ "or %0, %1, %%g1\n\t" |
3168 |
|
+ "wr %%g1, 0x0, %%psr\n\t" |
3169 |
|
+ "nop; nop; nop\n\t" |
3170 |
|
+ : "=r" (retval) |
3171 |
|
: "i" (PSR_PIL) |
3172 |
|
: "g1", "memory"); |
3173 |
|
|
3174 |
|
diff -ruN proll_18.orig/src/udp.c proll-patch10/src/udp.c |
3175 |
--- proll_18.orig/src/udp.c 2001-12-24 05:12:53.000000000 +0000 |
--- proll_18.orig/src/udp.c 2001-12-24 05:12:53.000000000 +0000 |
3176 |
+++ proll-patch8/src/udp.c 2004-11-13 15:50:49.000000000 +0000 |
+++ proll-patch10/src/udp.c 2004-11-13 15:50:49.000000000 +0000 |
3177 |
@@ -81,7 +81,7 @@ |
@@ -81,7 +81,7 @@ |
3178 |
int source; |
int source; |
3179 |
int dest; |
int dest; |
3193 |
/* Register IP packet type and set write buffer pointer */ |
/* Register IP packet type and set write buffer pointer */ |
3194 |
if ((writebuf = reg_type(htons(ETH_P_IP), ip_recv)) == NULL) |
if ((writebuf = reg_type(htons(ETH_P_IP), ip_recv)) == NULL) |
3195 |
return(FALSE); |
return(FALSE); |
3196 |
diff -ruN proll_18.orig/src/vcons_zs.c proll-patch8/src/vcons_zs.c |
diff -ruN proll_18.orig/src/vcons_zs.c proll-patch10/src/vcons_zs.c |
3197 |
--- proll_18.orig/src/vcons_zs.c 1970-01-01 00:00:00.000000000 +0000 |
--- proll_18.orig/src/vcons_zs.c 1970-01-01 00:00:00.000000000 +0000 |
3198 |
+++ proll-patch8/src/vcons_zs.c 2005-03-20 10:25:39.000000000 +0000 |
+++ proll-patch10/src/vcons_zs.c 2005-04-10 07:01:03.000000000 +0000 |
3199 |
@@ -0,0 +1,68 @@ |
@@ -0,0 +1,68 @@ |
3200 |
+/** |
+/** |
3201 |
+ ** Console over 'zs' (Zilog serial port) |
+ ** Console over 'zs' (Zilog serial port) |
3257 |
+ unsigned zs_ptr = (unsigned) t->impl; |
+ unsigned zs_ptr = (unsigned) t->impl; |
3258 |
+ |
+ |
3259 |
+ while ((ldb_bypass(zs_ptr) & 1) != 1) { } |
+ while ((ldb_bypass(zs_ptr) & 1) != 1) { } |
3260 |
+ return ldb_bypass(zs_ptr + ZS_DATA); |
+ return ldb_bypass(zs_ptr + ZS_DATA) & 0xff; |
3261 |
+} |
+} |
3262 |
+ |
+ |
3263 |
+void vcon_zs_fini(struct vconterm *t) |
+void vcon_zs_fini(struct vconterm *t) |
3265 |
+ /* violent crash in the end */ |
+ /* violent crash in the end */ |
3266 |
+ ; |
+ ; |
3267 |
+} |
+} |
3268 |
diff -ruN proll_18.orig/src/vconsole.c proll-patch8/src/vconsole.c |
diff -ruN proll_18.orig/src/vconsole.c proll-patch10/src/vconsole.c |
3269 |
--- proll_18.orig/src/vconsole.c 1999-11-08 03:10:28.000000000 +0000 |
--- proll_18.orig/src/vconsole.c 1999-11-08 03:10:28.000000000 +0000 |
3270 |
+++ proll-patch8/src/vconsole.c 2005-03-02 14:29:05.000000000 +0000 |
+++ proll-patch10/src/vconsole.c 2005-04-17 19:23:21.000000000 +0000 |
3271 |
@@ -13,6 +13,10 @@ |
@@ -7,12 +7,17 @@ |
3272 |
|
#include "vconsole.h" |
3273 |
|
|
3274 |
|
#include "hconsole.h" |
3275 |
|
+#include <system.h> |
3276 |
|
|
3277 |
|
static void vcon_i_cursfeed(struct vconterm *t); |
3278 |
|
static void vcon_i_backflush(struct vconterm *t); |
3279 |
|
|
3280 |
struct hconsole hcons0; |
struct hconsole hcons0; |
3281 |
|
|
3286 |
int vcon_init(struct vconterm *t, unsigned int a0) |
int vcon_init(struct vconterm *t, unsigned int a0) |
3287 |
{ |
{ |
3288 |
struct hconsole *hconp; |
struct hconsole *hconp; |
3289 |
@@ -25,11 +29,49 @@ |
@@ -25,11 +30,49 @@ |
3290 |
|
|
3291 |
t->vc_x = 0; t->vc_y = 0; |
t->vc_x = 0; t->vc_y = 0; |
3292 |
t->backp = 0; t->backc = 0; |
t->backp = 0; t->backc = 0; |
3336 |
int vcon_write(struct vconterm *t, char *data, int leng) |
int vcon_write(struct vconterm *t, char *data, int leng) |
3337 |
{ |
{ |
3338 |
int l = leng; |
int l = leng; |
3339 |
@@ -40,29 +82,84 @@ |
@@ -40,29 +83,99 @@ |
3340 |
if (l <= 0) break; |
if (l <= 0) break; |
3341 |
c = *data++; --l; |
c = *data++; --l; |
3342 |
|
|
3357 |
+ case 'M': |
+ case 'M': |
3358 |
+ hcon_scroll(hconp, 0, hcon_qydim(hconp), SM_UP, 1); |
+ hcon_scroll(hconp, 0, hcon_qydim(hconp), SM_UP, 1); |
3359 |
+ break; |
+ break; |
3360 |
|
+ default: |
3361 |
|
+ printk("Unhandled escape code '%c'\n", c); |
3362 |
|
+ break; |
3363 |
+ } |
+ } |
3364 |
break; |
break; |
3365 |
- case 0x0D: /* Return */ |
- case 0x0D: /* Return */ |
3387 |
+ if (t->vc_par[1]) t->vc_par[1]--; |
+ if (t->vc_par[1]) t->vc_par[1]--; |
3388 |
+ gotoxay(t, t->vc_par[1], t->vc_par[0]); |
+ gotoxay(t, t->vc_par[1], t->vc_par[0]); |
3389 |
+ break; |
+ break; |
3390 |
|
+ case 'J': |
3391 |
|
+ if (t->vc_par[0] == 0) { |
3392 |
|
+ //erase from cursor to end of display |
3393 |
|
+ hcon_clear(hconp, t->vc_y, t->vc_x, hconp->ydim_, hconp->xdim_); |
3394 |
|
+ } |
3395 |
|
+ break; |
3396 |
+ case 'M': |
+ case 'M': |
3397 |
+ hcon_scroll(hconp, 0, hcon_qydim(hconp), SM_UP, 1); |
+ hcon_scroll(hconp, 0, hcon_qydim(hconp), SM_UP, 1); |
3398 |
+ break; |
+ break; |
3399 |
|
+ case 'm': |
3400 |
|
+ break; |
3401 |
|
+ default: |
3402 |
|
+ printk("Unhandled escape code '%c', par[%d, %d, %d, %d, %d]\n", |
3403 |
|
+ c, t->vc_par[0], t->vc_par[1], t->vc_par[2], t->vc_par[3], t->vc_par[4]); |
3404 |
|
+ break; |
3405 |
+ } |
+ } |
3406 |
break; |
break; |
3407 |
default: |
default: |
3454 |
} |
} |
3455 |
} |
} |
3456 |
} |
} |
3457 |
diff -ruN proll_18.orig/src/vconsole.h proll-patch8/src/vconsole.h |
@@ -100,9 +213,62 @@ |
3458 |
|
return 0; |
3459 |
|
} |
3460 |
|
|
3461 |
|
+static const unsigned char sunkbd_keycode[128] = { |
3462 |
|
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
3463 |
|
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
3464 |
|
+ '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=', 0, 8, |
3465 |
|
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, |
3466 |
|
+ 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', |
3467 |
|
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
3468 |
|
+ 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', '\'', '\\', 13, |
3469 |
|
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
3470 |
|
+ 'z', 'x', 'c', 'v', 'b', 'n', 'm', ',', '.', '/', |
3471 |
|
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
3472 |
|
+ ' ', |
3473 |
|
+}; |
3474 |
|
+ |
3475 |
|
+static const unsigned char sunkbd_keycode_shifted[128] = { |
3476 |
|
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
3477 |
|
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
3478 |
|
+ '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+', 0, 8, |
3479 |
|
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, |
3480 |
|
+ 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '{', '}', |
3481 |
|
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
3482 |
|
+ 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', '"', '|', 13, |
3483 |
|
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
3484 |
|
+ 'Z', 'X', 'C', 'V', 'B', 'N', 'M', '<', '>', '?', |
3485 |
|
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
3486 |
|
+ ' ', |
3487 |
|
+}; |
3488 |
|
+ |
3489 |
|
+static int shiftstate; |
3490 |
|
+ |
3491 |
|
int vcon_getch(struct vconterm *t) |
3492 |
|
{ |
3493 |
|
- return -1; |
3494 |
|
+ int ch; |
3495 |
|
+ |
3496 |
|
+ while ((ldb_bypass(0x71000004) & 1) != 1) { } |
3497 |
|
+ do { |
3498 |
|
+ ch = ldb_bypass(0x71000006) & 0xff; |
3499 |
|
+ if (ch == 99) |
3500 |
|
+ shiftstate |= 1; |
3501 |
|
+ else if (ch == 110) |
3502 |
|
+ shiftstate |= 2; |
3503 |
|
+ else if (ch == 227) |
3504 |
|
+ shiftstate &= ~1; |
3505 |
|
+ else if (ch == 238) |
3506 |
|
+ shiftstate &= ~2; |
3507 |
|
+ //printk("getch: %d\n", ch); |
3508 |
|
+ } |
3509 |
|
+ while ((ch & 0x80) == 0 || ch == 238 || ch == 227); // Wait for key release |
3510 |
|
+ //printk("getch rel: %d\n", ch); |
3511 |
|
+ ch &= 0x7f; |
3512 |
|
+ if (shiftstate) |
3513 |
|
+ ch = sunkbd_keycode_shifted[ch]; |
3514 |
|
+ else |
3515 |
|
+ ch = sunkbd_keycode[ch]; |
3516 |
|
+ //printk("getch xlate: %d\n", ch); |
3517 |
|
+ return ch; |
3518 |
|
} |
3519 |
|
|
3520 |
|
void vcon_fini(struct vconterm *t) |
3521 |
|
diff -ruN proll_18.orig/src/vconsole.h proll-patch10/src/vconsole.h |
3522 |
--- proll_18.orig/src/vconsole.h 1999-11-08 00:58:13.000000000 +0000 |
--- proll_18.orig/src/vconsole.h 1999-11-08 00:58:13.000000000 +0000 |
3523 |
+++ proll-patch8/src/vconsole.h 2005-03-02 12:40:12.000000000 +0000 |
+++ proll-patch10/src/vconsole.h 2005-03-02 12:40:12.000000000 +0000 |
3524 |
@@ -6,6 +6,8 @@ |
@@ -6,6 +6,8 @@ |
3525 |
#ifndef VCONSOLE_H |
#ifndef VCONSOLE_H |
3526 |
#define VCONSOLE_H |
#define VCONSOLE_H |