Commit 9e61bde56a65c92ff67559f8ab94887f8aa57a4d

Authored by bellard
1 parent 4787c71d

sparc merge (Blue Swirl)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1620 c046a42c-6fe2-441c-8c8c-71466251a162
hw/esp.c
... ... @@ -29,6 +29,8 @@
29 29 #ifdef DEBUG_ESP
30 30 #define DPRINTF(fmt, args...) \
31 31 do { printf("ESP: " fmt , ##args); } while (0)
  32 +#define pic_set_irq(irq, level) \
  33 +do { printf("ESP: set_irq(%d): %d\n", (irq), (level)); pic_set_irq((irq),(level));} while (0)
32 34 #else
33 35 #define DPRINTF(fmt, args...)
34 36 #endif
... ... @@ -38,6 +40,8 @@ do { printf("ESP: " fmt , ##args); } while (0)
38 40 #define ESP_MAXREG 0x3f
39 41 #define TI_BUFSZ 65536
40 42 #define DMA_VER 0xa0000000
  43 +#define DMA_INTR 1
  44 +#define DMA_INTREN 0x10
41 45 #define DMA_LOADED 0x04000000
42 46  
43 47 typedef struct ESPState {
... ... @@ -66,6 +70,7 @@ typedef struct ESPState {
66 70 #define INTR_FC 0x08
67 71 #define INTR_BS 0x10
68 72 #define INTR_DC 0x20
  73 +#define INTR_RST 0x80
69 74  
70 75 #define SEQ_0 0x0
71 76 #define SEQ_CD 0x4
... ... @@ -98,11 +103,11 @@ static void handle_satn(ESPState *s)
98 103 s->ti_rptr = 0;
99 104 s->ti_wptr = 0;
100 105  
101   - if (target > 4 || !s->bd[target]) { // No such drive
  106 + if (target >= 4 || !s->bd[target]) { // No such drive
102 107 s->rregs[4] = STAT_IN;
103 108 s->rregs[5] = INTR_DC;
104 109 s->rregs[6] = SEQ_0;
105   - s->espdmaregs[0] |= 1;
  110 + s->espdmaregs[0] |= DMA_INTR;
106 111 pic_set_irq(s->irq, 1);
107 112 return;
108 113 }
... ... @@ -192,7 +197,7 @@ static void handle_satn(ESPState *s)
192 197 s->rregs[4] = STAT_IN | STAT_TC | STAT_DI;
193 198 s->rregs[5] = INTR_BS | INTR_FC;
194 199 s->rregs[6] = SEQ_CD;
195   - s->espdmaregs[0] |= 1;
  200 + s->espdmaregs[0] |= DMA_INTR;
196 201 pic_set_irq(s->irq, 1);
197 202 }
198 203  
... ... @@ -209,13 +214,14 @@ static void dma_write(ESPState *s, const uint8_t *buf, uint32_t len)
209 214 s->rregs[4] = STAT_IN | STAT_TC | STAT_ST;
210 215 s->rregs[5] = INTR_BS | INTR_FC;
211 216 s->rregs[6] = SEQ_CD;
212   - s->espdmaregs[0] |= 1;
213 217 } else {
214 218 memcpy(s->ti_buf, buf, len);
215 219 s->ti_size = dmalen;
216 220 s->ti_rptr = 0;
217 221 s->ti_wptr = 0;
  222 + s->rregs[7] = dmalen;
218 223 }
  224 + s->espdmaregs[0] |= DMA_INTR;
219 225 pic_set_irq(s->irq, 1);
220 226  
221 227 }
... ... @@ -242,11 +248,12 @@ static void handle_ti(ESPState *s)
242 248 s->rregs[4] = STAT_IN | STAT_TC | STAT_ST;
243 249 s->rregs[5] = INTR_BS;
244 250 s->rregs[6] = 0;
245   - s->espdmaregs[0] |= 1;
  251 + s->espdmaregs[0] |= DMA_INTR;
246 252 } else {
247 253 s->ti_size = dmalen;
248 254 s->ti_rptr = 0;
249 255 s->ti_wptr = 0;
  256 + s->rregs[7] = dmalen;
250 257 }
251 258 pic_set_irq(s->irq, 1);
252 259 }
... ... @@ -265,6 +272,7 @@ static uint32_t esp_mem_readb(void *opaque, target_phys_addr_t addr)
265 272 uint32_t saddr;
266 273  
267 274 saddr = (addr & ESP_MAXREG) >> 2;
  275 + DPRINTF("read reg[%d]: 0x%2.2x\n", saddr, s->rregs[saddr]);
268 276 switch (saddr) {
269 277 case 2:
270 278 // FIFO
... ... @@ -278,11 +286,16 @@ static uint32_t esp_mem_readb(void *opaque, target_phys_addr_t addr)
278 286 s->ti_wptr = 0;
279 287 }
280 288 break;
  289 + case 5:
  290 + // interrupt
  291 + // Clear status bits except TC
  292 + s->rregs[4] &= STAT_TC;
  293 + pic_set_irq(s->irq, 0);
  294 + s->espdmaregs[0] &= ~DMA_INTR;
  295 + break;
281 296 default:
282 297 break;
283 298 }
284   - DPRINTF("read reg[%d]: 0x%2.2x\n", saddr, s->rregs[saddr]);
285   -
286 299 return s->rregs[saddr];
287 300 }
288 301  
... ... @@ -317,8 +330,9 @@ static void esp_mem_writeb(void *opaque, target_phys_addr_t addr, uint32_t val)
317 330 break;
318 331 case 1:
319 332 DPRINTF("Flush FIFO (%2.2x)\n", val);
320   - s->rregs[6] = 0;
  333 + //s->ti_size = 0;
321 334 s->rregs[5] = INTR_FC;
  335 + s->rregs[6] = 0;
322 336 break;
323 337 case 2:
324 338 DPRINTF("Chip reset (%2.2x)\n", val);
... ... @@ -326,6 +340,11 @@ static void esp_mem_writeb(void *opaque, target_phys_addr_t addr, uint32_t val)
326 340 break;
327 341 case 3:
328 342 DPRINTF("Bus reset (%2.2x)\n", val);
  343 + s->rregs[5] = INTR_RST;
  344 + if (!(s->wregs[8] & 0x40)) {
  345 + s->espdmaregs[0] |= DMA_INTR;
  346 + pic_set_irq(s->irq, 1);
  347 + }
329 348 break;
330 349 case 0x10:
331 350 handle_ti(s);
... ... @@ -362,7 +381,10 @@ static void esp_mem_writeb(void *opaque, target_phys_addr_t addr, uint32_t val)
362 381 break;
363 382 case 9 ... 10:
364 383 break;
365   - case 11 ... 15:
  384 + case 11:
  385 + s->rregs[saddr] = val & 0x15;
  386 + break;
  387 + case 12 ... 15:
366 388 s->rregs[saddr] = val;
367 389 break;
368 390 default:
... ... @@ -403,7 +425,7 @@ static void espdma_mem_writel(void *opaque, target_phys_addr_t addr, uint32_t va
403 425 DPRINTF("write dmareg[%d]: 0x%8.8x -> 0x%8.8x\n", saddr, s->espdmaregs[saddr], val);
404 426 switch (saddr) {
405 427 case 0:
406   - if (!(val & 0x10))
  428 + if (!(val & DMA_INTREN))
407 429 pic_set_irq(s->irq, 0);
408 430 if (val & 0x80) {
409 431 esp_reset(s);
... ...
pc-bios/proll.elf
No preview for this file type
pc-bios/proll.patch
1   -diff -ruN proll_18.orig/Makefile proll-patch10/Makefile
  1 +diff -ruN proll_18.orig/Makefile proll-patch-15/Makefile
2 2 --- proll_18.orig/Makefile 2002-09-13 14:16:59.000000000 +0000
3   -+++ proll-patch10/Makefile 2004-11-13 15:50:49.000000000 +0000
  3 ++++ proll-patch-15/Makefile 2005-11-09 18:14:51.000000000 +0000
4 4 @@ -4,6 +4,7 @@
5 5 make -C krups-ser all
6 6 make -C espresso all
... ... @@ -14,14 +14,14 @@ diff -ruN proll_18.orig/Makefile proll-patch10/Makefile
14 14 make -C espresso clean
15 15 make -C espresso-ser clean
16 16 + make -C qemu clean
17   -diff -ruN proll_18.orig/qemu/Makefile proll-patch10/qemu/Makefile
  17 +diff -ruN proll_18.orig/qemu/Makefile proll-patch-15/qemu/Makefile
18 18 --- proll_18.orig/qemu/Makefile 1970-01-01 00:00:00.000000000 +0000
19   -+++ proll-patch10/qemu/Makefile 2005-04-12 14:42:23.000000000 +0000
  19 ++++ proll-patch-15/qemu/Makefile 2005-08-14 10:25:06.000000000 +0000
20 20 @@ -0,0 +1,123 @@
21 21 +#
22 22 +# proll:
23 23 +# qemu/Makefile - make PROLL for QEMU
24   -+# $Id: proll.patch,v 1.5 2005-04-26 21:02:48 bellard Exp $
  24 ++# $Id: proll.patch,v 1.6 2005-11-11 00:24:57 bellard Exp $
25 25 +#
26 26 +# Copyright 1999 Pete Zaitcev
27 27 +# This is Free Software is licensed under terms of GNU General Public License.
... ... @@ -55,8 +55,8 @@ diff -ruN proll_18.orig/qemu/Makefile proll-patch10/qemu/Makefile
55 55 +# Fixed %g6 is for arch/sparc/kernel/head.S, it seems ok w/o -ffixed-g6.
56 56 +# Kernel uses -fcall-used-g5 -fcall-used-g7, we probably do not need them.
57 57 +# __ANSI__ is supposed to be on by default but it is not.
58   -+CFLAGS = -O2 -Wall -DPROLBASE=$(PROLBASE) -DPROLDATA=$(PROLDATA) -DPROLRODATA=$(PROLRODATA) -D__ANSI__=1 -I$(SRC) -mcpu=hypersparc -g -DQEMU
59   -+ASFLAGS = -D__ASSEMBLY__ -I$(SRC) -DPROLRODATA=$(PROLRODATA) -DPROLDATA=$(PROLDATA) -DPROLSIZE=$(PROLSIZE) -g
  58 ++CFLAGS = -O2 -W -Wall -DPROLBASE=$(PROLBASE) -DPROLDATA=$(PROLDATA) -DPROLRODATA=$(PROLRODATA) -D__ANSI__=1 -I$(SRC) -mcpu=hypersparc -Wa,-xarch=v8 -g -DQEMU -m32 -fno-builtin
  59 ++ASFLAGS = -D__ASSEMBLY__ -I$(SRC) -DPROLRODATA=$(PROLRODATA) -DPROLDATA=$(PROLDATA) -DPROLSIZE=$(PROLSIZE) -g -Wa,-xarch=v8 -Wa,-32
60 60 +# Solaris or Linux/i386 cross compilation
61 61 +#CFLAGS = -Iinclude -O
62 62 +
... ... @@ -141,17 +141,17 @@ diff -ruN proll_18.orig/qemu/Makefile proll-patch10/qemu/Makefile
141 141 +
142 142 +proll.aout: $(PROLLEXE)
143 143 + $(ELFTOAOUT) -o proll.aout $(PROLLEXE)
144   -diff -ruN proll_18.orig/qemu/head.S proll-patch10/qemu/head.S
  144 +diff -ruN proll_18.orig/qemu/head.S proll-patch-15/qemu/head.S
145 145 --- proll_18.orig/qemu/head.S 1970-01-01 00:00:00.000000000 +0000
146   -+++ proll-patch10/qemu/head.S 2005-03-02 15:30:47.000000000 +0000
147   -@@ -0,0 +1,539 @@
  146 ++++ proll-patch-15/qemu/head.S 2005-07-12 22:24:17.000000000 +0000
  147 +@@ -0,0 +1,543 @@
148 148 +/**
149 149 + ** Standalone startup code for Linux PROM emulator.
150 150 + ** Copyright 1999 Pete A. Zaitcev
151 151 + ** This code is licensed under GNU General Public License.
152 152 + **/
153 153 +/*
154   -+ * $Id: proll.patch,v 1.5 2005-04-26 21:02:48 bellard Exp $
  154 ++ * $Id: proll.patch,v 1.6 2005-11-11 00:24:57 bellard Exp $
155 155 + */
156 156 +
157 157 +#include <psr.h>
... ... @@ -443,6 +443,10 @@ diff -ruN proll_18.orig/qemu/head.S proll-patch10/qemu/head.S
443 443 +C_LABEL(bootup_user_stack): .skip 0x2000
444 444 +
445 445 + .section ".text"
  446 ++ .register %g2, #scratch
  447 ++ .register %g3, #scratch
  448 ++ .register %g6, #scratch
  449 ++ .register %g7, #scratch
446 450 +
447 451 +goprol:
448 452 + ! %g1 contains end of memory
... ... @@ -684,9 +688,9 @@ diff -ruN proll_18.orig/qemu/head.S proll-patch10/qemu/head.S
684 688 +C_LABEL(ldb_bypass):
685 689 + retl
686 690 + lduba [%o0] ASI_M_BYPASS, %o0
687   -diff -ruN proll_18.orig/qemu/main.c proll-patch10/qemu/main.c
  691 +diff -ruN proll_18.orig/qemu/main.c proll-patch-15/qemu/main.c
688 692 --- proll_18.orig/qemu/main.c 1970-01-01 00:00:00.000000000 +0000
689   -+++ proll-patch10/qemu/main.c 2005-04-16 18:03:23.000000000 +0000
  693 ++++ proll-patch-15/qemu/main.c 2005-08-14 10:07:48.000000000 +0000
690 694 @@ -0,0 +1,185 @@
691 695 +/**
692 696 + ** Proll (PROM replacement)
... ... @@ -852,7 +856,7 @@ diff -ruN proll_18.orig/qemu/main.c proll-patch10/qemu/main.c
852 856 +
853 857 +/*
854 858 + */
855   -+void udelay(unsigned long usecs)
  859 ++void udelay(__attribute__((unused)) unsigned long usecs)
856 860 +{
857 861 + // Qemu hardware is perfect and does not need any delays!
858 862 +}
... ... @@ -873,10 +877,10 @@ diff -ruN proll_18.orig/qemu/main.c proll-patch10/qemu/main.c
873 877 + hw_idprom = va_prom;
874 878 +}
875 879 +
876   -diff -ruN proll_18.orig/qemu/openprom.c proll-patch10/qemu/openprom.c
  880 +diff -ruN proll_18.orig/qemu/openprom.c proll-patch-15/qemu/openprom.c
877 881 --- proll_18.orig/qemu/openprom.c 1970-01-01 00:00:00.000000000 +0000
878   -+++ proll-patch10/qemu/openprom.c 2005-04-16 17:30:19.000000000 +0000
879   -@@ -0,0 +1,741 @@
  882 ++++ proll-patch-15/qemu/openprom.c 2005-11-07 20:11:04.000000000 +0000
  883 +@@ -0,0 +1,910 @@
880 884 +/*
881 885 + * PROM interface support
882 886 + * Copyright 1996 The Australian National University.
... ... @@ -900,7 +904,7 @@ diff -ruN proll_18.orig/qemu/openprom.c proll-patch10/qemu/openprom.c
900 904 +struct property {
901 905 + const char *name;
902 906 + const char *value;
903   -+ const int length;
  907 ++ int length;
904 908 +};
905 909 +
906 910 +struct node {
... ... @@ -920,12 +924,13 @@ diff -ruN proll_18.orig/qemu/openprom.c proll-patch10/qemu/openprom.c
920 924 +static const struct property null_properties = { NULL, NULL, -1 };
921 925 +static const int prop_true = -1;
922 926 +
923   -+static const struct property propv_root[] = {
924   -+ {"name", "SUNW,JavaStation-1", sizeof("SUNW,JavaStation-1") },
  927 ++static struct property propv_root[7];
  928 ++
  929 ++static const struct property propv_root_templ[] = {
  930 ++ {"name", "SUNW,SparcStation-5", sizeof("SUNW,SparcStation-5") },
925 931 + {"idprom", obp_idprom, IDPROM_SIZE},
926   -+ {"banner-name", "JavaStation", sizeof("JavaStation")},
  932 ++ {"banner-name", "SparcStation", sizeof("SparcStation")},
927 933 + {"compatible", "sun4m", 6},
928   -+ {NULL, NULL, -1}
929 934 +};
930 935 +
931 936 +static const int prop_iommu_reg[] = {
... ... @@ -986,7 +991,7 @@ diff -ruN proll_18.orig/qemu/openprom.c proll-patch10/qemu/openprom.c
986 991 +static const int height = 0x300;
987 992 +static const int width = 0x400;
988 993 +static const int linebytes = 0x400;
989   -+static const int depth = 8;
  994 ++static const int depth = 24;
990 995 +static const int tcx_intr[] = { 5, 0 };
991 996 +static const int tcx_interrupts = 5;
992 997 +static const struct property propv_sbus_tcx[] = {
... ... @@ -1004,7 +1009,7 @@ diff -ruN proll_18.orig/qemu/openprom.c proll-patch10/qemu/openprom.c
1004 1009 + {"linebytes", (char*)&linebytes, sizeof(int)},
1005 1010 + {"depth", (char*)&depth, sizeof(int)},
1006 1011 + {"reg", (char*)&prop_tcx_regs[0], sizeof(prop_tcx_regs)},
1007   -+ {"tcx-8-bit", (char*)&prop_true, 0},
  1012 ++ {"tcx-8-bit", 0, -1},
1008 1013 + {"intr", (char*)&tcx_intr[0], sizeof(tcx_intr)},
1009 1014 + {"interrupts", (char*)&tcx_interrupts, sizeof(tcx_interrupts)},
1010 1015 + {"device_type", "display", sizeof("display")},
... ... @@ -1101,15 +1106,17 @@ diff -ruN proll_18.orig/qemu/openprom.c proll-patch10/qemu/openprom.c
1101 1106 +static const int prop_zs_reg[] = {
1102 1107 + 0x0, 0x00000000, 0x00000008,
1103 1108 +};
1104   -+static const int prop_zs_slave[] = { 1 };
1105 1109 +static void *prop_zs_addr;
  1110 ++static const int prop_zs_slave = 1;
1106 1111 +static const struct property propv_obio_zs[] = {
1107 1112 + {"name", "zs", sizeof("zs")},
1108 1113 + {"reg", (char*)&prop_zs_reg[0], sizeof(prop_zs_reg) },
1109   -+ {"slave", (char*)&prop_zs_slave[0], sizeof(prop_zs_slave) },
  1114 ++ {"slave", (char*)&prop_zs_slave, sizeof(prop_zs_slave) },
1110 1115 + {"device_type", "serial", sizeof("serial") },
1111 1116 + {"intr", (char*)&prop_zs_intr[0], sizeof(prop_zs_intr) },
1112 1117 + {"address", (char*)&prop_zs_addr, sizeof(prop_zs_addr) },
  1118 ++ {"keyboard", (char*)&prop_true, 0},
  1119 ++ {"mouse", (char*)&prop_true, 0},
1113 1120 + {NULL, NULL, -1}
1114 1121 +};
1115 1122 +
... ... @@ -1118,11 +1125,11 @@ diff -ruN proll_18.orig/qemu/openprom.c proll-patch10/qemu/openprom.c
1118 1125 + 0x0, 0x00100000, 0x00000008,
1119 1126 +};
1120 1127 +static void *prop_zs1_addr;
1121   -+static const int prop_zs1_slave[] = { 0 };
  1128 ++static const int prop_zs1_slave = 0;
1122 1129 +static const struct property propv_obio_zs1[] = {
1123 1130 + {"name", "zs", sizeof("zs")},
1124 1131 + {"reg", (char*)&prop_zs1_reg[0], sizeof(prop_zs1_reg) },
1125   -+ {"slave", (char*)&prop_zs1_slave[0], sizeof(prop_zs1_slave) },
  1132 ++ {"slave", (char*)&prop_zs1_slave, sizeof(prop_zs1_slave) },
1126 1133 + {"device_type", "serial", sizeof("serial") },
1127 1134 + {"intr", (char*)&prop_zs1_intr[0], sizeof(prop_zs1_intr) },
1128 1135 + {"address", (char*)&prop_zs1_addr, sizeof(prop_zs1_addr) },
... ... @@ -1185,6 +1192,15 @@ diff -ruN proll_18.orig/qemu/openprom.c proll-patch10/qemu/openprom.c
1185 1192 + {NULL, NULL, -1}
1186 1193 +};
1187 1194 +
  1195 ++static const int prop_apc_reg[] = {
  1196 ++ 0x4, 0x0a000000, 0x00000010,
  1197 ++};
  1198 ++static const struct property propv_sbus_apc[] = {
  1199 ++ {"name", "xxxpower-management", sizeof("xxxpower-management")},
  1200 ++ {"reg", (char*)&prop_apc_reg[0], sizeof(prop_apc_reg) },
  1201 ++ {NULL, NULL, -1}
  1202 ++};
  1203 ++
1188 1204 +static const int prop_fd_intr[] = { 0x2b, 0x0 };
1189 1205 +static const int prop_fd_reg[] = {
1190 1206 + 0x0, 0x00400000, 0x0000000f,
... ... @@ -1221,41 +1237,62 @@ diff -ruN proll_18.orig/qemu/openprom.c proll-patch10/qemu/openprom.c
1221 1237 + {"name", "options", sizeof("options")},
1222 1238 + {"screen-#columns", "80", sizeof("80")},
1223 1239 + {"screen-#rows", "25", sizeof("25")},
1224   -+ {"tpe-link-test?", "true", sizeof("true")},
  1240 ++ {"tpe-link-test?", (char *)&prop_true, 0},
1225 1241 + {"ttya-mode", "9600,8,n,1,-", sizeof("9600,8,n,1,-")},
1226   -+ {"ttya-ignore-cd", "true", sizeof("true")},
1227   -+ {"ttya-rts-dtr-off", "false", sizeof("false")},
  1242 ++ {"ttya-ignore-cd", (char *)&prop_true, 0},
  1243 ++ {"ttya-rts-dtr-off", 0, -1},
1228 1244 + {"ttyb-mode", "9600,8,n,1,-", sizeof("9600,8,n,1,-")},
1229   -+ {"ttyb-ignore-cd", "true", sizeof("true")},
1230   -+ {"ttyb-rts-dtr-off", "false", sizeof("false")},
  1245 ++ {"ttyb-ignore-cd", (char *)&prop_true, 0},
  1246 ++ {"ttyb-rts-dtr-off", 0, -1},
  1247 ++ {NULL, NULL, -1}
  1248 ++};
  1249 ++
  1250 ++static int prop_mem_reg[3];
  1251 ++static int prop_mem_avail[3];
  1252 ++
  1253 ++static const struct property propv_memory[] = {
  1254 ++ {"name", "memory", sizeof("memory")},
  1255 ++ {"reg", (char*)&prop_mem_reg[0], sizeof(prop_mem_reg) },
  1256 ++ {"available", (char*)&prop_mem_avail[0], sizeof(prop_mem_avail) },
  1257 ++ {NULL, NULL, -1}
  1258 ++};
  1259 ++
  1260 ++static int prop_vmem_avail[6];
  1261 ++
  1262 ++static const struct property propv_vmemory[] = {
  1263 ++ {"name", "virtual-memory", sizeof("virtual-memory")},
  1264 ++ {"available", (char*)&prop_vmem_avail[0], sizeof(prop_vmem_avail) },
1231 1265 + {NULL, NULL, -1}
1232 1266 +};
1233 1267 +
1234 1268 +static const struct node nodes[] = {
1235 1269 + { &null_properties, 1, 0 }, /* 0 = big brother of root */
1236 1270 + { propv_root, 0, 2 }, /* 1 "/" */
1237   -+ { propv_iommu, 11, 3 }, /* 2 "/iommu" */
  1271 ++ { propv_iommu, 12, 3 }, /* 2 "/iommu" */
1238 1272 + { propv_sbus, 0, 4 }, /* 3 "/iommu/sbus" */
1239 1273 + { propv_sbus_tcx, 5, 0 }, /* 4 "/iommu/sbus/SUNW,tcx" */
1240 1274 + { propv_sbus_ledma, 7, 6 }, /* 5 "/iommu/sbus/ledma" */
1241 1275 + { propv_sbus_ledma_le, 0, 0 }, /* 6 "/iommu/sbus/ledma/le" */
1242 1276 + { propv_sbus_cs4231, 8, 0 }, /* 7 "/iommu/sbus/SUNW,CS4231 */
1243 1277 + { propv_sbus_bpp, 9, 0 }, /* 8 "/iommu/sbus/SUNW,bpp */
1244   -+ { propv_sbus_espdma, 0, 10 }, /* 9 "/iommu/sbus/espdma" */
  1278 ++ { propv_sbus_espdma, 11, 10 }, /* 9 "/iommu/sbus/espdma" */
1245 1279 + { propv_sbus_espdma_esp, 0, 0 }, /* 10 "/iommu/sbus/espdma/esp" */
1246   -+ { propv_cpu, 12, 0 }, /* 11 "/STP1012PGA" */
1247   -+ { propv_obio, 22, 13 }, /* 12 "/obio" */
1248   -+ { propv_obio_int, 14, 0 }, /* 13 "/obio/interrupt" */
1249   -+ { propv_obio_cnt, 15, 0 }, /* 14 "/obio/counter" */
1250   -+ { propv_obio_eep, 16, 0 }, /* 15 "/obio/eeprom" */
1251   -+ { propv_obio_auxio, 17, 0 }, /* 16 "/obio/auxio" */
1252   -+ { propv_obio_zs1, 18, 0 }, /* 17 "/obio/zs@0,100000"
  1280 ++ { propv_sbus_apc, 0, 0 }, /* 11 "/iommu/sbus/power-management */
  1281 ++ { propv_cpu, 13, 0 }, /* 12 "/STP1012PGA" */
  1282 ++ { propv_obio, 23, 14 }, /* 13 "/obio" */
  1283 ++ { propv_obio_int, 15, 0 }, /* 14 "/obio/interrupt" */
  1284 ++ { propv_obio_cnt, 16, 0 }, /* 15 "/obio/counter" */
  1285 ++ { propv_obio_eep, 17, 0 }, /* 16 "/obio/eeprom" */
  1286 ++ { propv_obio_auxio, 18, 0 }, /* 17 "/obio/auxio" */
  1287 ++ { propv_obio_zs1, 19, 0 }, /* 18 "/obio/zs@0,100000"
1253 1288 + Must be before zs@0,0! */
1254   -+ { propv_obio_zs, 19, 0 }, /* 18 "/obio/zs@0,0" */
1255   -+ { propv_obio_fd, 20, 0 }, /* 19 "/obio/SUNW,fdtwo" */
1256   -+ { propv_obio_pw, 21, 0 }, /* 20 "/obio/power" */
1257   -+ { propv_obio_cf, 0, 0 }, /* 21 "/obio/slavioconfig@0,800000" */
1258   -+ { propv_options, 0, 0 }, /* 22 "/options" */
  1289 ++ { propv_obio_zs, 20, 0 }, /* 19 "/obio/zs@0,0" */
  1290 ++ { propv_obio_fd, 21, 0 }, /* 20 "/obio/SUNW,fdtwo" */
  1291 ++ { propv_obio_pw, 22, 0 }, /* 21 "/obio/power" */
  1292 ++ { propv_obio_cf, 0, 0 }, /* 22 "/obio/slavioconfig@0,800000" */
  1293 ++ { propv_options, 24, 0 }, /* 23 "/options" */
  1294 ++ { propv_memory, 25, 0 }, /* 24 "/memory" */
  1295 ++ { propv_vmemory, 0, 0 }, /* 25 "/virtual-memory" */
1259 1296 +};
1260 1297 +
1261 1298 +static struct linux_mlist_v0 totphys[MAX_BANKS];
... ... @@ -1281,6 +1318,7 @@ diff -ruN proll_18.orig/qemu/openprom.c proll-patch10/qemu/openprom.c
1281 1318 +
1282 1319 +static void (*synch_hook)(void);
1283 1320 +static char obp_stdin, obp_stdout;
  1321 ++static int obp_fd_stdin, obp_fd_stdout;
1284 1322 +
1285 1323 +static int obp_nbgetchar(void);
1286 1324 +static int obp_nbputchar(int ch);
... ... @@ -1289,9 +1327,13 @@ diff -ruN proll_18.orig/qemu/openprom.c proll-patch10/qemu/openprom.c
1289 1327 +static void obp_halt(void);
1290 1328 +static int obp_devopen(char *str);
1291 1329 +static int obp_devclose(int dev_desc);
  1330 ++static int obp_devread(int dev_desc, char *buf, int nbytes);
  1331 ++static int obp_devwrite(int dev_desc, char *buf, int nbytes);
  1332 ++static int obp_devseek(int dev_desc, int hi, int lo);
1292 1333 +static int obp_rdblkdev(int dev_desc, int num_blks, int blk_st, char *buf);
1293 1334 +static char *obp_dumb_mmap(char *va, int which_io, unsigned int pa, unsigned int size);
1294 1335 +static void obp_dumb_munmap(char *va, unsigned int size);
  1336 ++static int obp_inst2pkg(int dev_desc);
1295 1337 +
1296 1338 +static void doublewalk(unsigned ptab1, unsigned va)
1297 1339 +{
... ... @@ -1304,6 +1346,17 @@ diff -ruN proll_18.orig/qemu/openprom.c proll-patch10/qemu/openprom.c
1304 1346 +
1305 1347 +static struct linux_romvec romvec0;
1306 1348 +
  1349 ++struct fd {
  1350 ++ int unit, part;
  1351 ++ int offset;
  1352 ++ int (*pread)(int dev_desc, int offset, char *buf, unsigned int nbytes);
  1353 ++ int (*pwrite)(int dev_desc, int offset, char *buf, unsigned int nbytes);
  1354 ++} fd_table[16];
  1355 ++
  1356 ++static int fd_index;
  1357 ++static int con_pread(int dev_desc, int offset, char *buf, unsigned int nbytes);
  1358 ++static int con_pwrite(int dev_desc, int offset, char *buf, unsigned int nbytes);
  1359 ++
1307 1360 +void *
1308 1361 +init_openprom_qemu(int bankc, struct bank *bankv, unsigned hiphybas,
1309 1362 + const char *cmdline, char boot_device, int nographic)
... ... @@ -1345,6 +1398,18 @@ diff -ruN proll_18.orig/qemu/openprom.c proll-patch10/qemu/openprom.c
1345 1398 + totmap[0].theres_more = 0;
1346 1399 + totmap[0].start_adr = (char*) PROLBASE;
1347 1400 + totmap[0].num_bytes = PROLSIZE;
  1401 ++ prop_mem_reg[0] = 0;
  1402 ++ prop_mem_reg[1] = 0;
  1403 ++ prop_mem_reg[2] = bankv[0].length;
  1404 ++ prop_mem_avail[0] = 0;
  1405 ++ prop_mem_avail[1] = 0;
  1406 ++ prop_mem_avail[2] = hiphybas;
  1407 ++ prop_vmem_avail[0] = 0;
  1408 ++ prop_vmem_avail[1] = 0;
  1409 ++ prop_vmem_avail[2] = PROLBASE-1;
  1410 ++ prop_vmem_avail[3] = 0;
  1411 ++ prop_vmem_avail[4] = 0xffe00000;
  1412 ++ prop_vmem_avail[5] = 0x00200000;
1348 1413 +
1349 1414 + /*
1350 1415 + * idprom
... ... @@ -1353,6 +1418,7 @@ diff -ruN proll_18.orig/qemu/openprom.c proll-patch10/qemu/openprom.c
1353 1418 +
1354 1419 + // Linux wants a R/W romvec table
1355 1420 + romvec0.pv_magic_cookie = LINUX_OPPROM_MAGIC;
  1421 ++ romvec0.pv_romvers = 3;
1356 1422 + romvec0.pv_plugin_revision = 77;
1357 1423 + romvec0.pv_printrev = 0x10203;
1358 1424 + romvec0.pv_v0mem.v0_totphys = &ptphys;
... ... @@ -1375,10 +1441,17 @@ diff -ruN proll_18.orig/qemu/openprom.c proll-patch10/qemu/openprom.c
1375 1441 + romvec0.pv_halt = obp_halt;
1376 1442 + romvec0.pv_synchook = &synch_hook;
1377 1443 + romvec0.pv_v0bootargs = &obp_argp;
  1444 ++ romvec0.pv_v2devops.v2_inst2pkg = obp_inst2pkg;
1378 1445 + romvec0.pv_v2devops.v2_dumb_mmap = obp_dumb_mmap;
1379 1446 + romvec0.pv_v2devops.v2_dumb_munmap = obp_dumb_munmap;
  1447 ++ romvec0.pv_v2devops.v2_dev_open = obp_devopen;
  1448 ++ romvec0.pv_v2devops.v2_dev_close = (void (*)(int))obp_devclose;
  1449 ++ romvec0.pv_v2devops.v2_dev_read = obp_devread;
  1450 ++ romvec0.pv_v2devops.v2_dev_write = obp_devwrite;
  1451 ++ romvec0.pv_v2devops.v2_dev_seek = obp_devseek;
1380 1452 + obp_arg.boot_dev_ctrl = 0;
1381 1453 + obp_arg.boot_dev_unit = '0';
  1454 ++ obp_arg.argv[0] = "sd(0,0,0):d";
1382 1455 + switch(boot_device) {
1383 1456 + default:
1384 1457 + case 'a':
... ... @@ -1388,9 +1461,9 @@ diff -ruN proll_18.orig/qemu/openprom.c proll-patch10/qemu/openprom.c
1388 1461 + break;
1389 1462 + case 'd':
1390 1463 + obp_arg.boot_dev_unit = '2';
  1464 ++ obp_arg.argv[0] = "sd(0,2,0):d";
1391 1465 + // Fall through
1392 1466 + case 'c':
1393   -+ obp_arg.argv[0] = "sd()";
1394 1467 + obp_arg.boot_dev[0] = 's';
1395 1468 + obp_arg.boot_dev[1] = 'd';
1396 1469 + break;
... ... @@ -1401,13 +1474,39 @@ diff -ruN proll_18.orig/qemu/openprom.c proll-patch10/qemu/openprom.c
1401 1474 + break;
1402 1475 + }
1403 1476 + obp_arg.argv[1] = cmdline;
1404   -+
  1477 ++ romvec0.pv_v2bootargs.bootpath = &obp_arg.argv[0];
  1478 ++ romvec0.pv_v2bootargs.bootargs = &cmdline;
  1479 ++ romvec0.pv_v2bootargs.fd_stdin = &obp_fd_stdin;
  1480 ++ romvec0.pv_v2bootargs.fd_stdout = &obp_fd_stdout;
  1481 ++
  1482 ++ bcopy(propv_root_templ, propv_root, sizeof(propv_root_templ));
  1483 ++ propv_root[4].name = "stdin-path";
  1484 ++ propv_root[5].name = "stdout-path";
  1485 ++ obp_fd_stdin = 0;
  1486 ++ obp_fd_stdout = 1;
  1487 ++ fd_table[0].pread = con_pread;
  1488 ++ fd_table[0].pwrite = con_pwrite;
  1489 ++ fd_table[1].pread = con_pread;
  1490 ++ fd_table[1].pwrite = con_pwrite;
  1491 ++ fd_index = 2;
1405 1492 + if (nographic) {
1406 1493 + obp_stdin = PROMDEV_TTYA;
  1494 ++ propv_root[4].value = "/obio/zs@0,100000:a";
  1495 ++ propv_root[4].length = sizeof("/obio/zs@0,100000:a");
  1496 ++ fd_table[0].unit = 18;
1407 1497 + obp_stdout = PROMDEV_TTYA;
  1498 ++ propv_root[5].value = "/obio/zs@0,100000:a";
  1499 ++ propv_root[5].length = sizeof("/obio/zs@0,100000:a");
  1500 ++ fd_table[1].unit = 18;
1408 1501 + } else {
1409 1502 + obp_stdin = PROMDEV_KBD;
  1503 ++ propv_root[4].value = "/obio/zs@0,0";
  1504 ++ propv_root[4].length = sizeof("/obio/zs@0,0");
  1505 ++ fd_table[0].unit = 19;
1410 1506 + obp_stdout = PROMDEV_SCREEN;
  1507 ++ propv_root[5].value = "/iommu/sbus/SUNW,tcx";
  1508 ++ propv_root[5].length = sizeof("/iommu/sbus/SUNW,tcx");
  1509 ++ fd_table[1].unit = 4;
1411 1510 + }
1412 1511 + prop_zs_addr = map_io(0x71000000, 8);
1413 1512 + prop_zs1_addr = map_io(0x71100000, 8);
... ... @@ -1481,7 +1580,10 @@ diff -ruN proll_18.orig/qemu/openprom.c proll-patch10/qemu/openprom.c
1481 1580 + return -1;
1482 1581 +}
1483 1582 +
1484   -+static int obp_setprop(int node, char *name, char *value, int len)
  1583 ++static int obp_setprop(__attribute__((unused)) int node,
  1584 ++ __attribute__((unused)) char *name,
  1585 ++ __attribute__((unused)) char *value,
  1586 ++ __attribute__((unused)) int len)
1485 1587 +{
1486 1588 +#ifdef DEBUG_OBP
1487 1589 + printk("obp_setprop(%d, %s) = %s (%d)\n", node, name, value, len);
... ... @@ -1511,7 +1613,7 @@ diff -ruN proll_18.orig/qemu/openprom.c proll-patch10/qemu/openprom.c
1511 1613 +#ifdef DEBUG_OBP
1512 1614 + printk("obp_nextprop(%d, %s): not found\n", node, name);
1513 1615 +#endif
1514   -+ return (const char *)-1;
  1616 ++ return "";
1515 1617 +}
1516 1618 +
1517 1619 +extern int (*getch_fn)(struct vconterm *v);
... ... @@ -1527,21 +1629,60 @@ diff -ruN proll_18.orig/qemu/openprom.c proll-patch10/qemu/openprom.c
1527 1629 +}
1528 1630 +
1529 1631 +static void obp_reboot(char *str) {
1530   -+ printk("rebooting (%s): not implemented, freezing\n", str);
  1632 ++ printk("rebooting (%s)\n", str);
  1633 ++ stb_bypass(0x71f00000, 1);
1531 1634 + for (;;) {}
1532 1635 +}
1533 1636 +
1534 1637 +static void obp_abort() {
1535   -+ printk("abort, freezing\n");
  1638 ++ printk("abort, power off\n");
  1639 ++ stb_bypass(0x71910000, 1);
1536 1640 + for (;;) {}
1537 1641 +}
1538 1642 +
1539 1643 +static void obp_halt() {
1540   -+ printk("halt, freezing\n");
  1644 ++ printk("halt, power off\n");
  1645 ++ stb_bypass(0x71910000, 1);
1541 1646 + for (;;) {}
1542 1647 +}
  1648 ++
  1649 ++extern void *esp_read(int unit, int part, int offset, short len);
  1650 ++
  1651 ++static int esp_pread(int dev_desc, int offset, char *buf, unsigned int nbytes)
  1652 ++{
  1653 ++ unsigned int i;
  1654 ++ void *src;
  1655 ++
  1656 ++ for(i = 0; i < nbytes; i += 512) {
  1657 ++ src = esp_read(fd_table[dev_desc].unit, fd_table[dev_desc].part, (offset + i) / 512, 512);
  1658 ++ memcpy(&buf[i], src, 512);
  1659 ++ }
  1660 ++ return nbytes;
  1661 ++}
  1662 ++
  1663 ++static int con_pread(__attribute__((unused)) int dev_desc, __attribute__((unused)) int offset, char *buf, unsigned int nbytes)
  1664 ++{
  1665 ++ unsigned int i;
  1666 ++
  1667 ++ for(i = 0; i < nbytes; i ++) {
  1668 ++ buf[i] = obp_nbgetchar();
  1669 ++ }
  1670 ++ return nbytes;
  1671 ++}
  1672 ++
  1673 ++static int con_pwrite(__attribute__((unused)) int dev_desc, __attribute__((unused)) int offset, char *buf, unsigned int nbytes)
  1674 ++{
  1675 ++ unsigned int i;
  1676 ++
  1677 ++ for(i = 0; i < nbytes; i ++) {
  1678 ++ obp_nbputchar(buf[i]);
  1679 ++ }
  1680 ++ return nbytes;
  1681 ++}
  1682 ++
1543 1683 +#define isnum(c) ((c >= '0') && (c < '9'))
1544 1684 +#define ctoi(c) (c - '0')
  1685 ++
1545 1686 +static int obp_devopen(char *str) {
1546 1687 +#ifdef DEBUG_OBP
1547 1688 + printk("obp_devopen(%s)\n", str);
... ... @@ -1557,39 +1698,32 @@ diff -ruN proll_18.orig/qemu/openprom.c proll-patch10/qemu/openprom.c
1557 1698 + else {
1558 1699 + target = ctoi(str[5]) & 7;
1559 1700 + }
1560   -+ return 's' + target;
  1701 ++ fd_table[fd_index].unit = target;
  1702 ++ fd_table[fd_index].part = str[10] - 'a';
  1703 ++ fd_table[fd_index].pread = esp_pread;
  1704 ++ return fd_index++; // XXX
1561 1705 + }
1562 1706 + return 0;
1563 1707 +}
1564 1708 +
1565   -+static int obp_devclose(int dev_desc) {
  1709 ++static int obp_devclose(__attribute__((unused)) int dev_desc) {
1566 1710 +#ifdef DEBUG_OBP
1567 1711 + printk("obp_devclose %d\n", dev_desc);
1568 1712 +#endif
  1713 ++ fd_index--; // XXX
1569 1714 + return 0;
1570 1715 +}
1571 1716 +
1572   -+extern void *esp_read(int unit, int offset, short len);
1573   -+
1574 1717 +static int obp_rdblkdev(int dev_desc, int num_blks, int offset, char *buf)
1575 1718 +{
1576   -+ unsigned int i;
1577   -+ void *src;
1578   -+
1579 1719 +#ifdef DEBUG_OBP
1580 1720 + printk("obp_rdblkdev: fd %d, num_blks %d, offset %d, buf 0x%x\n", dev_desc, num_blks, offset, buf);
1581 1721 +#endif
1582   -+ if (dev_desc >= 's' && dev_desc < 'v') {
1583   -+ 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;
  1722 ++ return fd_table[dev_desc].pread(dev_desc, offset, buf, num_blks * 512);
1590 1723 +}
1591 1724 +
1592   -+static char *obp_dumb_mmap(char *va, int which_io, unsigned int pa, unsigned int size)
  1725 ++static char *obp_dumb_mmap(char *va, __attribute__((unused)) int which_io,
  1726 ++ unsigned int pa, unsigned int size)
1593 1727 +{
1594 1728 + unsigned int npages;
1595 1729 + unsigned int off;
... ... @@ -1611,16 +1745,55 @@ diff -ruN proll_18.orig/qemu/openprom.c proll-patch10/qemu/openprom.c
1611 1745 + return va;
1612 1746 +}
1613 1747 +
1614   -+static void obp_dumb_munmap(char *va, unsigned int size)
  1748 ++static void obp_dumb_munmap(__attribute__((unused)) char *va,
  1749 ++ __attribute__((unused)) unsigned int size)
1615 1750 +{
1616 1751 +#ifdef DEBUG_OBP
1617 1752 + printk("obp_dumb_munmap: virta %x, sz %d\n", va, size);
1618 1753 +#endif
1619   -+
1620 1754 +}
1621   -diff -ruN proll_18.orig/qemu/system_qemu.c proll-patch10/qemu/system_qemu.c
  1755 ++
  1756 ++static int obp_devread(int dev_desc, char *buf, int nbytes)
  1757 ++{
  1758 ++ int ret;
  1759 ++#ifdef DEBUG_OBP
  1760 ++ printk("obp_devread: fd %d, nbytes %d\n", dev_desc, nbytes);
  1761 ++#endif
  1762 ++ ret = fd_table[dev_desc].pread(dev_desc, fd_table[dev_desc].offset, buf, nbytes);
  1763 ++ fd_table[dev_desc].offset += nbytes;
  1764 ++ return ret;
  1765 ++}
  1766 ++
  1767 ++static int obp_devwrite(int dev_desc, char *buf, int nbytes)
  1768 ++{
  1769 ++ int ret;
  1770 ++#ifdef DEBUG_OBP
  1771 ++ printk("obp_devwrite: fd %d, buf %s, nbytes %d\n", dev_desc, buf, nbytes);
  1772 ++#endif
  1773 ++ ret = fd_table[dev_desc].pwrite(dev_desc, fd_table[dev_desc].offset, buf, nbytes);
  1774 ++ fd_table[dev_desc].offset += nbytes;
  1775 ++ return ret;
  1776 ++}
  1777 ++
  1778 ++static int obp_devseek(int dev_desc, __attribute__((unused)) int hi, int lo)
  1779 ++{
  1780 ++#ifdef DEBUG_OBP
  1781 ++ printk("obp_devseek: fd %d, hi %d, lo %d\n", dev_desc, hi, lo);
  1782 ++#endif
  1783 ++ fd_table[dev_desc].offset = lo;
  1784 ++ return 0;
  1785 ++}
  1786 ++
  1787 ++static int obp_inst2pkg(int dev_desc)
  1788 ++{
  1789 ++#ifdef DEBUG_OBP
  1790 ++ printk("obp_inst2pkg: fd %d\n", dev_desc);
  1791 ++#endif
  1792 ++ return fd_table[dev_desc].unit;
  1793 ++}
  1794 +diff -ruN proll_18.orig/qemu/system_qemu.c proll-patch-15/qemu/system_qemu.c
1622 1795 --- proll_18.orig/qemu/system_qemu.c 1970-01-01 00:00:00.000000000 +0000
1623   -+++ proll-patch10/qemu/system_qemu.c 2005-04-16 06:16:20.000000000 +0000
  1796 ++++ proll-patch-15/qemu/system_qemu.c 2005-04-16 06:16:20.000000000 +0000
1624 1797 @@ -0,0 +1,430 @@
1625 1798 +/**
1626 1799 + ** Proll (PROM replacement)
... ... @@ -2052,9 +2225,9 @@ diff -ruN proll_18.orig/qemu/system_qemu.c proll-patch10/qemu/system_qemu.c
2052 2225 + n = (n>>24 & 0xFF) | (n>>8 & 0xFF00) | ((n&0xFF00) << 8) | (n<<24);
2053 2226 + st_bypass(ptr, n);
2054 2227 +};
2055   -diff -ruN proll_18.orig/src/arp.c proll-patch10/src/arp.c
  2228 +diff -ruN proll_18.orig/src/arp.c proll-patch-15/src/arp.c
2056 2229 --- proll_18.orig/src/arp.c 2001-12-24 05:12:31.000000000 +0000
2057   -+++ proll-patch10/src/arp.c 2004-11-13 15:50:49.000000000 +0000
  2230 ++++ proll-patch-15/src/arp.c 2005-08-14 10:10:11.000000000 +0000
2058 2231 @@ -45,7 +45,7 @@
2059 2232 #endif
2060 2233 static struct arp_cache arp_list[ARPNUM]; /* ARP address cache */
... ... @@ -2064,7 +2237,19 @@ diff -ruN proll_18.orig/src/arp.c proll-patch10/src/arp.c
2064 2237  
2065 2238  
2066 2239  
2067   -@@ -144,7 +144,7 @@
  2240 +@@ -100,10 +100,7 @@
  2241 + *
  2242 + * ARP receiver routine
  2243 + */
  2244 +-static int arp_recv(buf, bufsize, addr)
  2245 +-unsigned char *buf;
  2246 +-int bufsize;
  2247 +-unsigned char *addr;
  2248 ++static int arp_recv(unsigned char *buf, unsigned int bufsize, unsigned char *addr)
  2249 + {
  2250 + register struct arphdr *ahp = (struct arphdr *)buf;
  2251 +
  2252 +@@ -144,7 +141,7 @@
2068 2253 *
2069 2254 * Resolve IP address and return pointer to hardware address.
2070 2255 */
... ... @@ -2073,7 +2258,7 @@ diff -ruN proll_18.orig/src/arp.c proll-patch10/src/arp.c
2073 2258 t_ipaddr ip;
2074 2259 {
2075 2260 int i;
2076   -@@ -230,14 +230,11 @@
  2261 +@@ -230,14 +227,11 @@
2077 2262 */
2078 2263 int init_arp()
2079 2264 {
... ... @@ -2089,9 +2274,9 @@ diff -ruN proll_18.orig/src/arp.c proll-patch10/src/arp.c
2089 2274 + def_gw = IP_ANY;
2090 2275 return(TRUE);
2091 2276 }
2092   -diff -ruN proll_18.orig/src/arp.h proll-patch10/src/arp.h
  2277 +diff -ruN proll_18.orig/src/arp.h proll-patch-15/src/arp.h
2093 2278 --- proll_18.orig/src/arp.h 1999-03-18 03:39:43.000000000 +0000
2094   -+++ proll-patch10/src/arp.h 2004-11-13 15:50:49.000000000 +0000
  2279 ++++ proll-patch-15/src/arp.h 2004-11-13 15:50:49.000000000 +0000
2095 2280 @@ -104,7 +104,7 @@
2096 2281 extern int init_arp __P((void));
2097 2282  
... ... @@ -2101,10 +2286,22 @@ diff -ruN proll_18.orig/src/arp.h proll-patch10/src/arp.h
2101 2286  
2102 2287 /* Add a new antry to the ARP cache */
2103 2288 extern void addcache __P((unsigned char *ha, t_ipaddr ip));
2104   -diff -ruN proll_18.orig/src/esp.c proll-patch10/src/esp.c
  2289 +diff -ruN proll_18.orig/src/bootp.c proll-patch-15/src/bootp.c
  2290 +--- proll_18.orig/src/bootp.c 1999-12-15 17:20:30.000000000 +0000
  2291 ++++ proll-patch-15/src/bootp.c 2005-08-14 10:16:09.000000000 +0000
  2292 +@@ -151,7 +151,7 @@
  2293 + while (TRUE) {
  2294 + boot_xid = get_ticks() + random();
  2295 + bootp_send();
  2296 +- i = udp_read((char *)(&boot_rec), BOOTP_REC_SIZE, timeout, CHR_ESC);
  2297 ++ i = udp_read((char *)(&boot_rec), BOOTP_REC_SIZE, timeout);
  2298 + if (i < 0) { /* user pressed ESC */
  2299 + printf("\nAborted\n");
  2300 + return(1);
  2301 +diff -ruN proll_18.orig/src/esp.c proll-patch-15/src/esp.c
2105 2302 --- 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 @@
  2303 ++++ proll-patch-15/src/esp.c 2005-08-15 18:42:46.000000000 +0000
  2304 +@@ -0,0 +1,305 @@
2108 2305 +#include <system.h> /* == <asm/system.h> */
2109 2306 +#include <general.h> /* __P for netpriv.h */
2110 2307 +#include <dma.h> /* dmaga */
... ... @@ -2138,6 +2335,10 @@ diff -ruN proll_18.orig/src/esp.c proll-patch10/src/esp.c
2138 2335 + struct esp_dma *espdma; /* If set this points to espdma */
2139 2336 +
2140 2337 + unsigned char *buffer;
  2338 ++ struct disk_info {
  2339 ++ unsigned int hw_sector;
  2340 ++ unsigned int part_offset[8];
  2341 ++ } disk[8];
2141 2342 +};
2142 2343 +
2143 2344 +static void esp_interrupt(void *dev_id)
... ... @@ -2260,7 +2461,7 @@ diff -ruN proll_18.orig/src/esp.c proll-patch10/src/esp.c
2260 2461 + return;
2261 2462 +}
2262 2463 +
2263   -+void *esp_read(int unit, int offset, short len)
  2464 ++void esp_read_capacity(int unit)
2264 2465 +{
2265 2466 + // Set SCSI target
2266 2467 + stb_bypass(PHYS_JJ_ESP + 4*4, unit & 7);
... ... @@ -2271,28 +2472,74 @@ diff -ruN proll_18.orig/src/esp.c proll-patch10/src/esp.c
2271 2472 + stb_bypass(PHYS_JJ_ESP + 1*4, 0);
2272 2473 + // Set DMA direction
2273 2474 + st_bypass(PHYS_JJ_ESPDMA + 0, 0x000);
  2475 ++ // Setup command = Read Capacity
  2476 ++ esp.buffer[0] = 0x80;
  2477 ++ esp.buffer[1] = 0x25;
  2478 ++ esp.buffer[2] = 0x00;
  2479 ++ esp.buffer[3] = 0x00;
  2480 ++ esp.buffer[4] = 0x00;
  2481 ++ esp.buffer[5] = 0x00;
  2482 ++ esp.buffer[6] = 0x00;
  2483 ++ esp.buffer[7] = 0x00;
  2484 ++ esp.buffer[8] = 0x00;
  2485 ++ esp.buffer[9] = 0x00;
  2486 ++ esp.buffer[10] = 0x00;
  2487 ++ // Set ATN, issue command
  2488 ++ stb_bypass(PHYS_JJ_ESP + 3*4, 0xc2);
  2489 ++
  2490 ++ // Set DMA length = 512 * read length
  2491 ++ stb_bypass(PHYS_JJ_ESP + 0*4, 0);
  2492 ++ stb_bypass(PHYS_JJ_ESP + 1*4, 8 & 0xff);
  2493 ++ // Set DMA direction
  2494 ++ st_bypass(PHYS_JJ_ESPDMA + 0, 0x100);
  2495 ++ // Transfer
  2496 ++ stb_bypass(PHYS_JJ_ESP + 3*4, 0x90);
  2497 ++ esp.disk[unit].hw_sector = (esp.buffer[4] << 24) | (esp.buffer[5] << 16) | (esp.buffer[6] << 8) | esp.buffer[7];
  2498 ++}
  2499 ++
  2500 ++// offset is multiple of 512, len in bytes
  2501 ++void *esp_read(int unit, int part, int offset, short len)
  2502 ++{
  2503 ++ int pos, hw_sect, sect_offset, spb;
  2504 ++
  2505 ++ // Set SCSI target
  2506 ++ stb_bypass(PHYS_JJ_ESP + 4*4, unit & 7);
  2507 ++ // Set DMA address
  2508 ++ st_bypass(PHYS_JJ_ESPDMA + 4, esp.buffer_dvma);
  2509 ++ // Set DMA length
  2510 ++ stb_bypass(PHYS_JJ_ESP + 0*4, 10);
  2511 ++ stb_bypass(PHYS_JJ_ESP + 1*4, 0);
  2512 ++ // Set DMA direction
  2513 ++ st_bypass(PHYS_JJ_ESPDMA + 0, 0x000);
  2514 ++ hw_sect = esp.disk[unit].hw_sector;
  2515 ++ offset += esp.disk[unit].part_offset[part];
  2516 ++ spb = hw_sect / 512;
  2517 ++ sect_offset = offset / spb;
  2518 ++ pos = (offset - sect_offset * spb) * 512;
  2519 ++ len /= 512;
  2520 ++ //printk("Read unit %d, offset %d -> offset %d, pos %d, hw_sect %d\n", unit, offset, sect_offset, pos, hw_sect);
2274 2521 + // Setup command = Read(10)
2275 2522 + esp.buffer[0] = 0x80;
2276 2523 + esp.buffer[1] = 0x28;
2277 2524 + 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;
  2525 ++ esp.buffer[3] = (sect_offset >> 24) & 0xff;
  2526 ++ esp.buffer[4] = (sect_offset >> 16) & 0xff;
  2527 ++ esp.buffer[5] = (sect_offset >> 8) & 0xff;
  2528 ++ esp.buffer[6] = sect_offset & 0xff;
2282 2529 + esp.buffer[7] = 0x00;
2283 2530 + esp.buffer[8] = (len >> 8) & 0xff;
2284 2531 + esp.buffer[9] = len & 0xff;
2285 2532 + // Set ATN, issue command
2286   -+ stb_bypass(PHYS_JJ_ESP + 3*4, 0x42);
  2533 ++ stb_bypass(PHYS_JJ_ESP + 3*4, 0xc2);
2287 2534 +
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);
  2535 ++ // Set DMA length = sector size * read length
  2536 ++ stb_bypass(PHYS_JJ_ESP + 0*4, (len * hw_sect) & 0xff);
  2537 ++ stb_bypass(PHYS_JJ_ESP + 1*4, ((len * hw_sect) >> 8) & 0xff);
2291 2538 + // Set DMA direction
2292 2539 + st_bypass(PHYS_JJ_ESPDMA + 0, 0x100);
2293 2540 + // Transfer
2294   -+ stb_bypass(PHYS_JJ_ESP + 3*4, 0x10);
2295   -+ return esp.buffer;
  2541 ++ stb_bypass(PHYS_JJ_ESP + 3*4, 0x90);
  2542 ++ return esp.buffer + pos;
2296 2543 +}
2297 2544 +
2298 2545 +// Sparc boot sequence can be found in SILO docs,
... ... @@ -2334,32 +2581,35 @@ diff -ruN proll_18.orig/src/esp.c proll-patch10/src/esp.c
2334 2581 + stb_bypass(PHYS_JJ_ESP + 3*4, 2);
2335 2582 +
2336 2583 + esp_open(&esp);
  2584 ++ esp_read_capacity(unit);
2337 2585 +
2338   -+ label = esp_read(unit, 0, 1);
2339   -+ printk("CHS: %d/%d/%d, partitions:\n", label->ncyl, label->ntrks, label->nsect);
  2586 ++ label = esp_read(unit, 0, 0, 512);
  2587 ++ printk("hw sector: %d, CHS: %d/%d/%d, partitions:\n", esp.disk[unit].hw_sector,
  2588 ++ label->ncyl, label->ntrks, label->nsect);
2340 2589 + 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);
  2590 ++ printk("%c: %d + %d, id %x, flags %x\n", 'a' + i, label->partitions[i].start_cylinder,
  2591 ++ label->partitions[i].num_sectors, label->infos[i].id, label->infos[i].flags);
  2592 ++ esp.disk[unit].part_offset[i] = label->partitions[3].start_cylinder * label->ntrks * label->nsect;
2343 2593 + }
2344   -+ offset = label->partitions[4].start_cylinder * label->ntrks * label->nsect + 1;
  2594 ++ offset = 1;
2345 2595 + printk("booting sd(0,%d,0):d (offset %d)\n", unit, offset);
2346 2596 + // Skip a.out header (0x20)
2347 2597 + dst = (void *)0x4000;
2348   -+ src = esp_read(unit, offset, 1);
  2598 ++ src = esp_read(unit, 3, offset, 512);
2349 2599 + src = (void *)((unsigned int) src + 0x20);
2350 2600 + memcpy(dst, src, 512 - 0x20);
2351 2601 + dst = (void *)0x4000 + 512 - 0x20;
2352 2602 + for (i = 1; i < 7680/512; i++) {
2353   -+ src = esp_read(unit, offset + i, 1);
  2603 ++ src = esp_read(unit, 3, offset + i, 512);
2354 2604 + memcpy(dst, src, 512);
2355 2605 + dst += 512;
2356 2606 + }
2357 2607 + esp_close(&esp);
2358 2608 + return 0;
2359 2609 +}
2360   -diff -ruN proll_18.orig/src/hconsole.c proll-patch10/src/hconsole.c
  2610 +diff -ruN proll_18.orig/src/hconsole.c proll-patch-15/src/hconsole.c
2361 2611 --- proll_18.orig/src/hconsole.c 2002-07-23 05:52:48.000000000 +0000
2362   -+++ proll-patch10/src/hconsole.c 2005-03-02 17:03:09.000000000 +0000
  2612 ++++ proll-patch-15/src/hconsole.c 2005-11-09 18:46:34.000000000 +0000
2363 2613 @@ -29,6 +29,10 @@
2364 2614 struct raster r_master; /* For a case of resize, whole fb */
2365 2615 struct raster r_0; /* malloc() erzatz */
... ... @@ -2383,9 +2633,84 @@ diff -ruN proll_18.orig/src/hconsole.c proll-patch10/src/hconsole.c
2383 2633 t->r_ = r;
2384 2634 t->r0_ = q;
2385 2635 t->f_ = &f_master;
2386   -diff -ruN proll_18.orig/src/hme.c proll-patch10/src/hme.c
  2636 +@@ -67,7 +75,7 @@
  2637 + return 0;
  2638 + }
  2639 +
  2640 +-void hcon_fini (struct hconsole *t)
  2641 ++void hcon_fini (__attribute((unused)) struct hconsole *t)
  2642 + {
  2643 + return;
  2644 + }
  2645 +@@ -77,12 +85,12 @@
  2646 + {
  2647 + struct rfont *f = t->f_;
  2648 +
  2649 +- if (sy < 0 || sy >= t->ydim_) return -1;
  2650 +- if (sx < 0 || sx >= t->xdim_) return -1;
  2651 ++ if (sy < 0 || (unsigned)sy >= t->ydim_) return -1;
  2652 ++ if (sx < 0 || (unsigned)sx >= t->xdim_) return -1;
  2653 + if (height < 0) return -1;
  2654 +- if (sy + height > t->ydim_) height = t->ydim_ - sy;
  2655 ++ if ((unsigned)sy + (unsigned)height > t->ydim_) height = t->ydim_ - sy;
  2656 + if (width < 0) return -1;
  2657 +- if (sx + width > t->xdim_) width = t->xdim_ - sx;
  2658 ++ if ((unsigned)sx + (unsigned)width > t->xdim_) width = t->xdim_ - sx;
  2659 +
  2660 + /* XXX Clear with correct background color */
  2661 + (*t->r_->clear_)(t->r_,
  2662 +@@ -107,10 +115,10 @@
  2663 + char c0 = c;
  2664 + RC_color rfg, rbg;
  2665 +
  2666 +- if (y < 0 || y >= t->ydim_) return -1;
  2667 +- if (x < 0 || x >= t->xdim_) return -1;
  2668 ++ if (y < 0 || (unsigned)y >= t->ydim_) return -1;
  2669 ++ if (x < 0 || (unsigned)x >= t->xdim_) return -1;
  2670 +
  2671 +- if (t->curson_ && t->ypos_ == y && t->xpos_ == x) {
  2672 ++ if (t->curson_ && t->ypos_ == (unsigned)y && t->xpos_ == (unsigned)x) {
  2673 + rfg = t->bg_; rbg = t->fg_;
  2674 + } else {
  2675 + rfg = t->fg_; rbg = t->bg_;
  2676 +@@ -126,9 +134,9 @@
  2677 + {
  2678 + struct rfont *f = t->f_;
  2679 +
  2680 +- if (y < 0 || y >= t->ydim_) return -1;
  2681 +- if (x < 0 || x >= t->xdim_) return -1;
  2682 +- if (x + count >= t->xdim_) count = t->xdim_ - x;
  2683 ++ if (y < 0 || (unsigned)y >= t->ydim_) return -1;
  2684 ++ if (x < 0 || (unsigned)x >= t->xdim_) return -1;
  2685 ++ if ((unsigned)x + (unsigned)count >= t->xdim_) count = t->xdim_ - x;
  2686 +
  2687 + (*t->r_->render_)(t->r_, y*f->height_, x*f->width_,
  2688 + s, count, t->bg_, t->fg_, f);
  2689 +@@ -200,8 +208,8 @@
  2690 +
  2691 + rc = 0;
  2692 + if (dir == SM_UP) {
  2693 +- if (d < 0 || d >= t->ydim_) return -1;
  2694 +- if (b <= d || b > t->ydim_) return -1;
  2695 ++ if (d < 0 || (unsigned)d >= t->ydim_) return -1;
  2696 ++ if (b <= d || (unsigned)b > t->ydim_) return -1;
  2697 + if (d + count >= b) count = b - d;
  2698 + if (d + count >= b) count = b - d;
  2699 + (*t->r_->yscroll_)(t->r_,
  2700 +@@ -213,8 +221,8 @@
  2701 + count*f->height_, raster_qwidth(t->r_),
  2702 + t->bg_);
  2703 + } else if (dir == SM_DOWN) {
  2704 +- if (d < 0 || d >= t->ydim_) return -1;
  2705 +- if (b <= d || b > t->ydim_) return -1;
  2706 ++ if (d < 0 || (unsigned)d >= t->ydim_) return -1;
  2707 ++ if (b <= d || (unsigned)b > t->ydim_) return -1;
  2708 + if (d + count >= b) count = b - d;
  2709 + (*t->r_->yscroll_)(t->r_,
  2710 + d*f->height_, 0,
  2711 +diff -ruN proll_18.orig/src/hme.c proll-patch-15/src/hme.c
2387 2712 --- 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
  2713 ++++ proll-patch-15/src/hme.c 2005-04-16 06:16:20.000000000 +0000
2389 2714 @@ -655,10 +655,10 @@
2390 2715 unsigned int flags,
2391 2716 unsigned int addr)
... ... @@ -2443,9 +2768,21 @@ diff -ruN proll_18.orig/src/hme.c proll-patch10/src/hme.c
2443 2768 : "=r" (flags)
2444 2769 : "r" (&this->rx_flags), "i" (ASI_PL));
2445 2770 #else
2446   -diff -ruN proll_18.orig/src/lat7_2.bm proll-patch10/src/lat7_2.bm
  2771 +diff -ruN proll_18.orig/src/iommu.c proll-patch-15/src/iommu.c
  2772 +--- proll_18.orig/src/iommu.c 2002-07-23 05:52:49.000000000 +0000
  2773 ++++ proll-patch-15/src/iommu.c 2005-08-14 10:08:17.000000000 +0000
  2774 +@@ -36,7 +36,7 @@
  2775 + unsigned int pa, ba;
  2776 + unsigned int npages;
  2777 + unsigned int mva, mpa;
  2778 +- int i;
  2779 ++ unsigned int i;
  2780 + unsigned int *iopte;
  2781 +
  2782 + npages = (size + (PAGE_SIZE-1)) / PAGE_SIZE;
  2783 +diff -ruN proll_18.orig/src/lat7_2.bm proll-patch-15/src/lat7_2.bm
2447 2784 --- proll_18.orig/src/lat7_2.bm 1999-02-27 05:48:54.000000000 +0000
2448   -+++ proll-patch10/src/lat7_2.bm 2004-11-13 15:50:49.000000000 +0000
  2785 ++++ proll-patch-15/src/lat7_2.bm 2004-11-13 15:50:49.000000000 +0000
2449 2786 @@ -1,6 +1,6 @@
2450 2787 #define lat7_2_width 128
2451 2788 #define lat7_2_height 88
... ... @@ -2454,9 +2791,9 @@ diff -ruN proll_18.orig/src/lat7_2.bm proll-patch10/src/lat7_2.bm
2454 2791 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2455 2792 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0x12, 0x1e, 0x0c, 0x02, 0x70, 0x18,
2456 2793 0x22, 0x22, 0x18, 0x00, 0x00, 0x18, 0x18, 0xff, 0x18, 0x00, 0x12, 0x02,
2457   -diff -ruN proll_18.orig/src/lat7_2_swapped.bm proll-patch10/src/lat7_2_swapped.bm
  2794 +diff -ruN proll_18.orig/src/lat7_2_swapped.bm proll-patch-15/src/lat7_2_swapped.bm
2458 2795 --- proll_18.orig/src/lat7_2_swapped.bm 1970-01-01 00:00:00.000000000 +0000
2459   -+++ proll-patch10/src/lat7_2_swapped.bm 2004-11-13 15:50:49.000000000 +0000
  2796 ++++ proll-patch-15/src/lat7_2_swapped.bm 2004-11-13 15:50:49.000000000 +0000
2460 2797 @@ -0,0 +1,121 @@
2461 2798 +#define lat7_2_width 128
2462 2799 +#define lat7_2_height 88
... ... @@ -2579,9 +2916,9 @@ diff -ruN proll_18.orig/src/lat7_2_swapped.bm proll-patch10/src/lat7_2_swapped.b
2579 2916 + 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x36, 0x6c, 0x00, 0x00, 0x00,
2580 2917 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x42, 0x00, 0x00, 0x00, 0x00,
2581 2918 + 0x00, 0x00, 0x00, 0x00};
2582   -diff -ruN proll_18.orig/src/le.c proll-patch10/src/le.c
  2919 +diff -ruN proll_18.orig/src/le.c proll-patch-15/src/le.c
2583 2920 --- proll_18.orig/src/le.c 2002-07-23 05:52:49.000000000 +0000
2584   -+++ proll-patch10/src/le.c 2005-04-16 06:16:20.000000000 +0000
  2921 ++++ proll-patch-15/src/le.c 2005-04-16 06:16:20.000000000 +0000
2585 2922 @@ -185,8 +185,6 @@
2586 2923 unsigned short rap; /* register address port */
2587 2924 };
... ... @@ -2600,9 +2937,21 @@ diff -ruN proll_18.orig/src/le.c proll-patch10/src/le.c
2600 2937  
2601 2938 /* Now, give the packet to the lance */
2602 2939 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
  2940 +diff -ruN proll_18.orig/src/net.h proll-patch-15/src/net.h
  2941 +--- proll_18.orig/src/net.h 1999-12-15 17:20:17.000000000 +0000
  2942 ++++ proll-patch-15/src/net.h 2005-08-14 10:17:02.000000000 +0000
  2943 +@@ -124,7 +124,7 @@
  2944 + extern int udp_open __P((t_ipaddr daddr, int source, int dest));
  2945 +
  2946 + /* Read from a UDP socket */
  2947 +-extern int udp_read __P((char *buf, int bufsize, int timeout, char abortch));
  2948 ++extern int udp_read(char *buf, unsigned int bufsize, int timeout);
  2949 +
  2950 + /* Write to a UDP socket */
  2951 + extern int udp_write __P((char *buf, int writelen));
  2952 +diff -ruN proll_18.orig/src/netinit.c proll-patch-15/src/netinit.c
2604 2953 --- proll_18.orig/src/netinit.c 2002-09-13 21:53:33.000000000 +0000
2605   -+++ proll-patch10/src/netinit.c 2004-11-13 15:50:49.000000000 +0000
  2954 ++++ proll-patch-15/src/netinit.c 2004-11-13 15:50:49.000000000 +0000
2606 2955 @@ -49,13 +49,20 @@
2607 2956 unsigned char myhwaddr[ETH_ALEN]; /* my own hardware addr */
2608 2957 t_ipaddr myipaddr; /* my own IP address */
... ... @@ -2646,9 +2995,18 @@ diff -ruN proll_18.orig/src/netinit.c proll-patch10/src/netinit.c
2646 2995 fatal();
2647 2996 }
2648 2997 }
2649   -diff -ruN proll_18.orig/src/netpriv.h proll-patch10/src/netpriv.h
  2998 +diff -ruN proll_18.orig/src/netpriv.h proll-patch-15/src/netpriv.h
2650 2999 --- proll_18.orig/src/netpriv.h 1999-04-27 05:39:37.000000000 +0000
2651   -+++ proll-patch10/src/netpriv.h 2004-11-13 15:50:49.000000000 +0000
  3000 ++++ proll-patch-15/src/netpriv.h 2005-08-14 10:12:20.000000000 +0000
  3001 +@@ -83,7 +83,7 @@
  3002 + */
  3003 + struct device *dev;
  3004 + char *data;
  3005 +- int len;
  3006 ++ unsigned int len;
  3007 + int protocol;
  3008 + unsigned char ip_summed;
  3009 + };
2652 3010 @@ -130,10 +130,9 @@
2653 3011 *
2654 3012 */
... ... @@ -2670,10 +3028,10 @@ diff -ruN proll_18.orig/src/netpriv.h proll-patch10/src/netpriv.h
2670 3028  
2671 3029 /* Empty read buffer */
2672 3030 extern void empty_buf __P((void));
2673   -diff -ruN proll_18.orig/src/openprom.h proll-patch10/src/openprom.h
  3031 +diff -ruN proll_18.orig/src/openprom.h proll-patch-15/src/openprom.h
2674 3032 --- proll_18.orig/src/openprom.h 2002-07-14 02:26:30.000000000 +0000
2675   -+++ proll-patch10/src/openprom.h 2004-11-13 15:50:49.000000000 +0000
2676   -@@ -54,20 +54,20 @@
  3033 ++++ proll-patch-15/src/openprom.h 2005-05-13 16:23:14.000000000 +0000
  3034 +@@ -54,29 +54,29 @@
2677 3035 };
2678 3036  
2679 3037 struct linux_mem_v0 {
... ... @@ -2699,6 +3057,19 @@ diff -ruN proll_18.orig/src/openprom.h proll-patch10/src/openprom.h
2699 3057 void *aieee1; /* XXX */
2700 3058 };
2701 3059  
  3060 + /* V2 and up boot things. */
  3061 + struct linux_bootargs_v2 {
  3062 +- char **bootpath;
  3063 +- char **bootargs;
  3064 +- int *fd_stdin;
  3065 +- int *fd_stdout;
  3066 ++ const char **bootpath;
  3067 ++ const char **bootargs;
  3068 ++ const int *fd_stdin;
  3069 ++ const int *fd_stdout;
  3070 + };
  3071 +
  3072 + /* The top level PROM vector. */
2702 3073 @@ -91,13 +91,13 @@
2703 3074 struct linux_mem_v0 pv_v0mem;
2704 3075  
... ... @@ -2734,9 +3105,9 @@ diff -ruN proll_18.orig/src/openprom.h proll-patch10/src/openprom.h
2734 3105 };
2735 3106  
2736 3107 /* More fun PROM structures for device probing. */
2737   -diff -ruN proll_18.orig/src/packet.c proll-patch10/src/packet.c
  3108 +diff -ruN proll_18.orig/src/packet.c proll-patch-15/src/packet.c
2738 3109 --- proll_18.orig/src/packet.c 2000-02-11 04:56:45.000000000 +0000
2739   -+++ proll-patch10/src/packet.c 2004-11-13 15:50:49.000000000 +0000
  3110 ++++ proll-patch-15/src/packet.c 2005-08-14 10:12:49.000000000 +0000
2740 3111 @@ -41,7 +41,7 @@
2741 3112 int aligner;
2742 3113 } wbuf;
... ... @@ -2764,9 +3135,24 @@ diff -ruN proll_18.orig/src/packet.c proll-patch10/src/packet.c
2764 3135 {
2765 3136 struct sk_buff *skb;
2766 3137 unsigned char *s;
2767   -diff -ruN proll_18.orig/src/printf.c proll-patch10/src/printf.c
  3138 +@@ -209,12 +211,12 @@
  3139 + /*
  3140 + */
  3141 + void
  3142 +-eth_copy_and_sum(struct sk_buff *dest, unsigned char *src, int len, int base)
  3143 ++eth_copy_and_sum(struct sk_buff *dest, unsigned char *src, int len, __attribute__((unused)) int base)
  3144 + {
  3145 + bcopy(src, dest->data, len);
  3146 + }
  3147 +
  3148 +-unsigned short eth_type_trans(struct sk_buff *skb, struct device *dev)
  3149 ++unsigned short eth_type_trans(struct sk_buff *skb, __attribute__((unused)) struct device *dev)
  3150 + {
  3151 + unsigned char *s = skb->data + 12;
  3152 + return s[0] << 8 | s[1]; /* Network order word */
  3153 +diff -ruN proll_18.orig/src/printf.c proll-patch-15/src/printf.c
2768 3154 --- proll_18.orig/src/printf.c 1999-03-19 07:03:59.000000000 +0000
2769   -+++ proll-patch10/src/printf.c 2004-11-13 15:50:49.000000000 +0000
  3155 ++++ proll-patch-15/src/printf.c 2005-08-14 10:07:26.000000000 +0000
2770 3156 @@ -19,7 +19,7 @@
2771 3157 static void printn(struct prf_fp *, unsigned long, unsigned int);
2772 3158 static void putchar(char, struct prf_fp *);
... ... @@ -2794,9 +3180,20 @@ diff -ruN proll_18.orig/src/printf.c proll-patch10/src/printf.c
2794 3180 putchar(c,filog);
2795 3181 } else if (c == 'l' || c == 'O') {
2796 3182 printn(filog, (long)va_arg(adx,long), c=='l'?10:8);
2797   -diff -ruN proll_18.orig/src/rconsole.c proll-patch10/src/rconsole.c
  3183 +@@ -77,10 +77,6 @@
  3184 + char prbuf[24];
  3185 + register char *cp;
  3186 +
  3187 +- if (b == 10 && n < 0) {
  3188 +- putchar('-',filog);
  3189 +- n = (~n) + 1; /* n = -n */
  3190 +- }
  3191 + cp = prbuf;
  3192 + do
  3193 + *cp++ = hextab[(unsigned int)(n%b)];
  3194 +diff -ruN proll_18.orig/src/rconsole.c proll-patch-15/src/rconsole.c
2798 3195 --- proll_18.orig/src/rconsole.c 1999-01-16 07:16:55.000000000 +0000
2799   -+++ proll-patch10/src/rconsole.c 2005-04-16 06:16:20.000000000 +0000
  3196 ++++ proll-patch-15/src/rconsole.c 2005-08-14 10:25:53.000000000 +0000
2800 3197 @@ -28,12 +28,18 @@
2801 3198 * move to California. Only plain lat7 survived.
2802 3199 * I recreated lat7-1 changes in lat7-2. --zaitcev
... ... @@ -2882,9 +3279,18 @@ diff -ruN proll_18.orig/src/rconsole.c proll-patch10/src/rconsole.c
2882 3279 p->nchars_ = LAT7_NCHARS;
2883 3280 p->width_ = LAT7_WIDTH;
2884 3281 p->height_ = LAT7_HEIGHT;
2885   -diff -ruN proll_18.orig/src/rconsole.h proll-patch10/src/rconsole.h
  3282 +@@ -175,7 +188,7 @@
  3283 + r->render_ = p->render_;
  3284 + }
  3285 +
  3286 +-void raster_dest(struct raster *r)
  3287 ++void raster_dest(__attribute((unused)) struct raster *r)
  3288 + {
  3289 + }
  3290 +
  3291 +diff -ruN proll_18.orig/src/rconsole.h proll-patch-15/src/rconsole.h
2886 3292 --- proll_18.orig/src/rconsole.h 1999-01-16 05:00:59.000000000 +0000
2887   -+++ proll-patch10/src/rconsole.h 2004-11-13 15:50:49.000000000 +0000
  3293 ++++ proll-patch-15/src/rconsole.h 2004-11-13 15:50:49.000000000 +0000
2888 3294 @@ -13,10 +13,10 @@
2889 3295 */
2890 3296  
... ... @@ -2898,9 +3304,9 @@ diff -ruN proll_18.orig/src/rconsole.h proll-patch10/src/rconsole.h
2898 3304 int nchars_; /* 128 for ASCII ... 65536 for Unicode */
2899 3305 int width_; /* [Pixels]. Maximum size is 16. */
2900 3306 int height_; /* [Pixels == scan lines]. */
2901   -diff -ruN proll_18.orig/src/romlib.h proll-patch10/src/romlib.h
  3307 +diff -ruN proll_18.orig/src/romlib.h proll-patch-15/src/romlib.h
2902 3308 --- proll_18.orig/src/romlib.h 1999-04-20 04:26:45.000000000 +0000
2903   -+++ proll-patch10/src/romlib.h 2005-04-16 20:32:49.000000000 +0000
  3309 ++++ proll-patch-15/src/romlib.h 2005-04-16 20:32:49.000000000 +0000
2904 3310 @@ -72,13 +72,13 @@
2905 3311 */
2906 3312 #define memcpy(dst, src, len) bcopy(src, dst, len)
... ... @@ -2920,9 +3326,9 @@ diff -ruN proll_18.orig/src/romlib.h proll-patch10/src/romlib.h
2920 3326  
2921 3327  
2922 3328 /*
2923   -diff -ruN proll_18.orig/src/sched_4m.c proll-patch10/src/sched_4m.c
  3329 +diff -ruN proll_18.orig/src/sched_4m.c proll-patch-15/src/sched_4m.c
2924 3330 --- proll_18.orig/src/sched_4m.c 1999-04-27 05:48:51.000000000 +0000
2925   -+++ proll-patch10/src/sched_4m.c 2004-11-13 15:50:49.000000000 +0000
  3331 ++++ proll-patch-15/src/sched_4m.c 2005-08-14 10:18:14.000000000 +0000
2926 3332 @@ -108,7 +108,7 @@
2927 3333 static int set_bolt; /* Tick counter limit */
2928 3334 static struct handsc hndv[16];
... ... @@ -2932,9 +3338,36 @@ diff -ruN proll_18.orig/src/sched_4m.c proll-patch10/src/sched_4m.c
2932 3338 0, 0, 0, 0, 0, 0, SUN4M_INT_ETHERNET, 0,
2933 3339 0, 0, 0, 0, 0, 0, 0, 0,
2934 3340 };
2935   -diff -ruN proll_18.orig/src/swap.c proll-patch10/src/swap.c
  3341 +@@ -130,7 +130,7 @@
  3342 + int /* 0 - not expired yet; <>0 - timer expired */
  3343 + chk_timeout()
  3344 + {
  3345 +- int lim = (((1000000/HZ) + 1) << 10);
  3346 ++ unsigned int lim = (((1000000/HZ) + 1) << 10);
  3347 + unsigned int clear;
  3348 + unsigned int intc;
  3349 + int n;
  3350 +@@ -182,7 +182,7 @@
  3351 + struct handsc *hndp;
  3352 + unsigned int mask;
  3353 +
  3354 +- if (irq < 0 || irq >= 16) {
  3355 ++ if (irq == 0 || irq >= 16) {
  3356 + printk("request_irq: bad irq %d\n", irq);
  3357 + return -1;
  3358 + }
  3359 +@@ -207,7 +207,7 @@
  3360 + {
  3361 + struct handsc *hndp;
  3362 +
  3363 +- if (irq < 0 || irq >= 16) {
  3364 ++ if (irq == 0 || irq >= 16) {
  3365 + printk("free_irq: bad irq %d\n", irq);
  3366 + return;
  3367 + }
  3368 +diff -ruN proll_18.orig/src/swap.c proll-patch-15/src/swap.c
2936 3369 --- proll_18.orig/src/swap.c 1970-01-01 00:00:00.000000000 +0000
2937   -+++ proll-patch10/src/swap.c 2004-11-13 15:50:49.000000000 +0000
  3370 ++++ proll-patch-15/src/swap.c 2004-11-13 15:50:49.000000000 +0000
2938 3371 @@ -0,0 +1,21 @@
2939 3372 +// Convert the lat7 font so that no conversion is needed at runtime.
2940 3373 +#define ORIG
... ... @@ -2957,9 +3390,9 @@ diff -ruN proll_18.orig/src/swap.c proll-patch10/src/swap.c
2957 3390 + }
2958 3391 + printf("\n");
2959 3392 +}
2960   -diff -ruN proll_18.orig/src/system.c proll-patch10/src/system.c
  3393 +diff -ruN proll_18.orig/src/system.c proll-patch-15/src/system.c
2961 3394 --- proll_18.orig/src/system.c 2002-07-23 05:52:49.000000000 +0000
2962   -+++ proll-patch10/src/system.c 2005-04-16 06:16:20.000000000 +0000
  3395 ++++ proll-patch-15/src/system.c 2005-04-16 06:16:20.000000000 +0000
2963 3396 @@ -298,8 +298,8 @@
2964 3397 }
2965 3398  
... ... @@ -3050,9 +3483,9 @@ diff -ruN proll_18.orig/src/system.c proll-patch10/src/system.c
3050 3483 void fatal()
3051 3484 {
3052 3485 printk("fatal.");
3053   -diff -ruN proll_18.orig/src/system.h proll-patch10/src/system.h
  3486 +diff -ruN proll_18.orig/src/system.h proll-patch-15/src/system.h
3054 3487 --- proll_18.orig/src/system.h 2002-09-13 21:53:32.000000000 +0000
3055   -+++ proll-patch10/src/system.h 2005-04-16 06:16:20.000000000 +0000
  3488 ++++ proll-patch-15/src/system.h 2005-04-16 06:16:20.000000000 +0000
3056 3489 @@ -16,7 +16,7 @@
3057 3490 #define IOMAPSIZE (1*1024*1024) /* 1 Meg maximum: we do not map framebuffer. */
3058 3491 #define NCTX_SWIFT 0x100
... ... @@ -3171,19 +3604,72 @@ diff -ruN proll_18.orig/src/system.h proll-patch10/src/system.h
3171 3604 : "i" (PSR_PIL)
3172 3605 : "g1", "memory");
3173 3606  
3174   -diff -ruN proll_18.orig/src/udp.c proll-patch10/src/udp.c
  3607 +diff -ruN proll_18.orig/src/tftp.c proll-patch-15/src/tftp.c
  3608 +--- proll_18.orig/src/tftp.c 2002-09-13 21:53:34.000000000 +0000
  3609 ++++ proll-patch-15/src/tftp.c 2005-08-14 10:16:15.000000000 +0000
  3610 +@@ -127,7 +127,7 @@
  3611 + int len;
  3612 +
  3613 + /* Read packet with timeout */
  3614 +- len = udp_read((char *)(&inpbuf), sizeof(inpbuf), TFTP_TIMEOUT, CHR_ESC);
  3615 ++ len = udp_read((char *)(&inpbuf), sizeof(inpbuf), TFTP_TIMEOUT);
  3616 + if (len == 0) {
  3617 + printf("TFTP: Timeout\n");
  3618 + return(ERR_TIMEOUT);
  3619 +diff -ruN proll_18.orig/src/udp.c proll-patch-15/src/udp.c
3175 3620 --- proll_18.orig/src/udp.c 2001-12-24 05:12:53.000000000 +0000
3176   -+++ proll-patch10/src/udp.c 2004-11-13 15:50:49.000000000 +0000
3177   -@@ -81,7 +81,7 @@
3178   - int source;
3179   - int dest;
  3621 ++++ proll-patch-15/src/udp.c 2005-08-14 10:17:19.000000000 +0000
  3622 +@@ -76,12 +76,9 @@
  3623 + *
  3624 + * Open a new UDP socket.
  3625 + */
  3626 +-int udp_open(daddr, source, dest)
  3627 +-t_ipaddr daddr;
  3628 +-int source;
  3629 +-int dest;
  3630 ++int udp_open(t_ipaddr daddr, int source, int dest)
3180 3631 {
3181 3632 - register unsigned char *addr;
3182   -+ const register unsigned char *addr;
  3633 ++ const unsigned char *addr;
3183 3634  
3184 3635 /* Set global variables */
3185 3636 usource = source;
3186   -@@ -299,9 +299,6 @@
  3637 +@@ -101,16 +98,13 @@
  3638 + *
  3639 + * IP receiver routine
  3640 + */
  3641 +-static int ip_recv(buf, bufsize, addr)
  3642 +-unsigned char *buf;
  3643 +-int bufsize;
  3644 +-unsigned char *addr;
  3645 ++static int ip_recv(unsigned char *buf, unsigned int bufsize, unsigned char *addr)
  3646 + {
  3647 + struct iphdr *ipp = ((struct iphdr *)buf);
  3648 + struct udphdr *udpp = ((struct udphdr *)(buf + IP_MIN_HSIZE));
  3649 + struct udp_pseudo psehdr;
  3650 +
  3651 +- int size;
  3652 ++ unsigned int size;
  3653 + t_ipaddr dadr;
  3654 +
  3655 + #ifdef DEBUG
  3656 +@@ -194,13 +188,9 @@
  3657 + *
  3658 + * Read one packet from a UDP socket
  3659 + */
  3660 +-int udp_read(buf, bufsize, timeout, abortch)
  3661 +-char *buf;
  3662 +-int bufsize;
  3663 +-int timeout;
  3664 +-char abortch;
  3665 ++int udp_read(char *buf, unsigned int bufsize, int timeout)
  3666 + {
  3667 +- int len;
  3668 ++ unsigned int len;
  3669 +
  3670 + /* Wait until we get something */
  3671 + set_timeout(timeout);
  3672 +@@ -299,9 +289,6 @@
3187 3673 */
3188 3674 int init_udp()
3189 3675 {
... ... @@ -3193,9 +3679,21 @@ diff -ruN proll_18.orig/src/udp.c proll-patch10/src/udp.c
3193 3679 /* Register IP packet type and set write buffer pointer */
3194 3680 if ((writebuf = reg_type(htons(ETH_P_IP), ip_recv)) == NULL)
3195 3681 return(FALSE);
3196   -diff -ruN proll_18.orig/src/vcons_zs.c proll-patch10/src/vcons_zs.c
  3682 +diff -ruN proll_18.orig/src/udp.h proll-patch-15/src/udp.h
  3683 +--- proll_18.orig/src/udp.h 2001-12-24 05:12:34.000000000 +0000
  3684 ++++ proll-patch-15/src/udp.h 2005-08-14 10:16:40.000000000 +0000
  3685 +@@ -53,7 +53,7 @@
  3686 + extern int udp_open __P((t_ipaddr daddr, int source, int dest));
  3687 +
  3688 + /* Read from a UDP socket */
  3689 +-extern int udp_read __P((char *buf, int bufsize, int timeout, char abortch));
  3690 ++extern int udp_read(char *buf, unsigned int bufsize, int timeout);
  3691 +
  3692 + /* Write to a UDP socket */
  3693 + extern int udp_write __P((char *buf, int writelen));
  3694 +diff -ruN proll_18.orig/src/vcons_zs.c proll-patch-15/src/vcons_zs.c
3197 3695 --- proll_18.orig/src/vcons_zs.c 1970-01-01 00:00:00.000000000 +0000
3198   -+++ proll-patch10/src/vcons_zs.c 2005-04-10 07:01:03.000000000 +0000
  3696 ++++ proll-patch-15/src/vcons_zs.c 2005-08-14 10:25:51.000000000 +0000
3199 3697 @@ -0,0 +1,68 @@
3200 3698 +/**
3201 3699 + ** Console over 'zs' (Zilog serial port)
... ... @@ -3243,7 +3741,7 @@ diff -ruN proll_18.orig/src/vcons_zs.c proll-patch10/src/vcons_zs.c
3243 3741 + return leng;
3244 3742 +}
3245 3743 +
3246   -+int vcon_zs_read(struct vconterm *t, char *data, int leng)
  3744 ++int vcon_zs_read(struct vconterm *t, char *data, __attribute((unused)) int leng)
3247 3745 +{
3248 3746 + unsigned zs_ptr = (unsigned) t->impl;
3249 3747 +
... ... @@ -3260,14 +3758,14 @@ diff -ruN proll_18.orig/src/vcons_zs.c proll-patch10/src/vcons_zs.c
3260 3758 + return ldb_bypass(zs_ptr + ZS_DATA) & 0xff;
3261 3759 +}
3262 3760 +
3263   -+void vcon_zs_fini(struct vconterm *t)
  3761 ++void vcon_zs_fini(__attribute((unused)) struct vconterm *t)
3264 3762 +{
3265 3763 + /* violent crash in the end */
3266 3764 + ;
3267 3765 +}
3268   -diff -ruN proll_18.orig/src/vconsole.c proll-patch10/src/vconsole.c
  3766 +diff -ruN proll_18.orig/src/vconsole.c proll-patch-15/src/vconsole.c
3269 3767 --- proll_18.orig/src/vconsole.c 1999-11-08 03:10:28.000000000 +0000
3270   -+++ proll-patch10/src/vconsole.c 2005-04-17 19:23:21.000000000 +0000
  3768 ++++ proll-patch-15/src/vconsole.c 2005-08-14 10:24:49.000000000 +0000
3271 3769 @@ -7,12 +7,17 @@
3272 3770 #include "vconsole.h"
3273 3771  
... ... @@ -3336,7 +3834,7 @@ diff -ruN proll_18.orig/src/vconsole.c proll-patch10/src/vconsole.c
3336 3834 int vcon_write(struct vconterm *t, char *data, int leng)
3337 3835 {
3338 3836 int l = leng;
3339   -@@ -40,29 +83,99 @@
  3837 +@@ -40,29 +83,101 @@
3340 3838 if (l <= 0) break;
3341 3839 c = *data++; --l;
3342 3840  
... ... @@ -3358,7 +3856,7 @@ diff -ruN proll_18.orig/src/vconsole.c proll-patch10/src/vconsole.c
3358 3856 + hcon_scroll(hconp, 0, hcon_qydim(hconp), SM_UP, 1);
3359 3857 + break;
3360 3858 + default:
3361   -+ printk("Unhandled escape code '%c'\n", c);
  3859 ++ //printk("Unhandled escape code '%c'\n", c);
3362 3860 + break;
3363 3861 + }
3364 3862 break;
... ... @@ -3399,8 +3897,10 @@ diff -ruN proll_18.orig/src/vconsole.c proll-patch10/src/vconsole.c
3399 3897 + case 'm':
3400 3898 + break;
3401 3899 + default:
3402   -+ printk("Unhandled escape code '%c', par[%d, %d, %d, %d, %d]\n",
  3900 ++#if 0
  3901 ++ printk("Unhandled escape code '%c', par[%d, %d, %d, %d, %d]\n",
3403 3902 + c, t->vc_par[0], t->vc_par[1], t->vc_par[2], t->vc_par[3], t->vc_par[4]);
  3903 ++#endif
3404 3904 + break;
3405 3905 + }
3406 3906 break;
... ... @@ -3446,7 +3946,7 @@ diff -ruN proll_18.orig/src/vconsole.c proll-patch10/src/vconsole.c
3446 3946 + } else {
3447 3947 + t->backc++;
3448 3948 + }
3449   -+ if (t->vc_x + t->backc >= hcon_qxdim(hconp)) {
  3949 ++ if ((unsigned int)t->vc_x + t->backc >= hcon_qxdim(hconp)) {
3450 3950 + vcon_i_backflush(t);
3451 3951 + t->vc_x = 0;
3452 3952 + vcon_i_cursfeed(t);
... ... @@ -3454,10 +3954,32 @@ diff -ruN proll_18.orig/src/vconsole.c proll-patch10/src/vconsole.c
3454 3954 }
3455 3955 }
3456 3956 }
3457   -@@ -100,9 +213,62 @@
  3957 +@@ -73,7 +188,7 @@
  3958 + static void vcon_i_cursfeed(struct vconterm *t) {
  3959 + struct hconsole *hconp = t->impl;
  3960 +
  3961 +- if (++t->vc_y >= hcon_qydim(hconp)) {
  3962 ++ if ((unsigned int)++t->vc_y >= hcon_qydim(hconp)) {
  3963 + t->vc_y = hcon_qydim(hconp)-1;
  3964 + hcon_scroll(hconp, 0, hcon_qydim(hconp), SM_UP, 1);
  3965 + }
  3966 +@@ -90,22 +205,75 @@
  3967 + t->backp = 0; t->backc = 0;
  3968 + }
  3969 +
  3970 +-int vcon_putch(struct vconterm *t, char c)
  3971 ++int vcon_putch(__attribute__((unused)) struct vconterm *t, __attribute__((unused)) char c)
  3972 + {
  3973 + return -1;
  3974 + }
  3975 +
  3976 +-int vcon_read(struct vconterm *t, char *data, int leng)
  3977 ++int vcon_read(__attribute__((unused)) struct vconterm *t, __attribute__((unused)) char *data, __attribute__((unused)) int leng)
  3978 + {
3458 3979 return 0;
3459 3980 }
3460 3981  
  3982 +-int vcon_getch(struct vconterm *t)
3461 3983 +static const unsigned char sunkbd_keycode[128] = {
3462 3984 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3463 3985 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
... ... @@ -3488,7 +4010,7 @@ diff -ruN proll_18.orig/src/vconsole.c proll-patch10/src/vconsole.c
3488 4010 +
3489 4011 +static int shiftstate;
3490 4012 +
3491   - int vcon_getch(struct vconterm *t)
  4013 ++int vcon_getch(__attribute__((unused)) struct vconterm *t)
3492 4014 {
3493 4015 - return -1;
3494 4016 + int ch;
... ... @@ -3517,10 +4039,14 @@ diff -ruN proll_18.orig/src/vconsole.c proll-patch10/src/vconsole.c
3517 4039 + return ch;
3518 4040 }
3519 4041  
3520   - void vcon_fini(struct vconterm *t)
3521   -diff -ruN proll_18.orig/src/vconsole.h proll-patch10/src/vconsole.h
  4042 +-void vcon_fini(struct vconterm *t)
  4043 ++void vcon_fini(__attribute__((unused)) struct vconterm *t)
  4044 + {
  4045 + /* violent crash in the end */
  4046 + ;
  4047 +diff -ruN proll_18.orig/src/vconsole.h proll-patch-15/src/vconsole.h
3522 4048 --- proll_18.orig/src/vconsole.h 1999-11-08 00:58:13.000000000 +0000
3523   -+++ proll-patch10/src/vconsole.h 2005-03-02 12:40:12.000000000 +0000
  4049 ++++ proll-patch-15/src/vconsole.h 2005-03-02 12:40:12.000000000 +0000
3524 4050 @@ -6,6 +6,8 @@
3525 4051 #ifndef VCONSOLE_H
3526 4052 #define VCONSOLE_H
... ...
target-sparc/helper.c
... ... @@ -195,15 +195,17 @@ int get_physical_address (CPUState *env, target_phys_addr_t *physical, int *prot
195 195 int cpu_sparc_handle_mmu_fault (CPUState *env, target_ulong address, int rw,
196 196 int is_user, int is_softmmu)
197 197 {
198   - target_ulong virt_addr;
199 198 target_phys_addr_t paddr;
200 199 unsigned long vaddr;
201 200 int error_code = 0, prot, ret = 0, access_index;
202 201  
203 202 error_code = get_physical_address(env, &paddr, &prot, &access_index, address, rw, is_user);
204 203 if (error_code == 0) {
205   - virt_addr = address & TARGET_PAGE_MASK;
206   - vaddr = virt_addr + ((address & TARGET_PAGE_MASK) & (TARGET_PAGE_SIZE - 1));
  204 + vaddr = address & TARGET_PAGE_MASK;
  205 + paddr &= TARGET_PAGE_MASK;
  206 +#ifdef DEBUG_MMU
  207 + printf("Translate at 0x%lx -> 0x%lx, vaddr 0x%lx\n", (long)address, (long)paddr, (long)vaddr);
  208 +#endif
207 209 ret = tlb_set_page(env, vaddr, paddr, prot, is_user, is_softmmu);
208 210 return ret;
209 211 }
... ...
target-sparc/op_helper.c
... ... @@ -276,6 +276,10 @@ void helper_ld_asi(int asi, int size, int sign)
276 276 case 4:
277 277 ret = ldl_phys(T0 & ~3);
278 278 break;
  279 + case 8:
  280 + ret = ldl_phys(T0 & ~3);
  281 + T0 = ldl_phys((T0 + 4) & ~3);
  282 + break;
279 283 }
280 284 break;
281 285 default:
... ... @@ -396,6 +400,10 @@ void helper_st_asi(int asi, int size, int sign)
396 400 default:
397 401 stl_phys(T0 & ~3, T1);
398 402 break;
  403 + case 8:
  404 + stl_phys(T0 & ~3, T1);
  405 + stl_phys((T0 + 4) & ~3, T2);
  406 + break;
399 407 }
400 408 }
401 409 return;
... ...
target-sparc/translate.c
... ... @@ -1897,6 +1897,11 @@ static void disas_sparc_insn(DisasContext * dc)
1897 1897 #else
1898 1898 gen_op_xor_T1_T0();
1899 1899 gen_op_wrpsr();
  1900 + save_state(dc);
  1901 + gen_op_next_insn();
  1902 + gen_op_movl_T0_0();
  1903 + gen_op_exit_tb();
  1904 + dc->is_br = 1;
1900 1905 #endif
1901 1906 }
1902 1907 break;
... ... @@ -2343,8 +2348,8 @@ static void disas_sparc_insn(DisasContext * dc)
2343 2348 gen_op_store_FT0_fpr(rd);
2344 2349 break;
2345 2350 case 0x21: /* load fsr */
  2351 + gen_op_ldst(ldf);
2346 2352 gen_op_ldfsr();
2347   - gen_op_store_FT0_fpr(rd);
2348 2353 break;
2349 2354 case 0x22: /* load quad fpreg */
2350 2355 goto nfpu_insn;
... ... @@ -2426,9 +2431,8 @@ static void disas_sparc_insn(DisasContext * dc)
2426 2431 gen_op_ldst(stf);
2427 2432 break;
2428 2433 case 0x25: /* stfsr, V9 stxfsr */
2429   - gen_op_load_fpr_FT0(rd);
2430   - // XXX
2431 2434 gen_op_stfsr();
  2435 + gen_op_ldst(stf);
2432 2436 break;
2433 2437 case 0x26: /* stdfq */
2434 2438 goto nfpu_insn;
... ...