summaryrefslogtreecommitdiff
path: root/sys/arch/powerpc/patches
blob: 80430475bb8f9943cecf911585a7434a1662a568 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
#
#	These are diffs on my machine currently,
#	Not all of the patches are necessary,
#	some need to be determined if they are to be commited
#	or not.
#
Index: src/bin/sh/Makefile
===================================================================
RCS file: /cvs/src/bin/sh/Makefile,v
retrieving revision 1.7
diff -r1.7 Makefile
40c40
< 	${CC} ${CFLAGS} ${.CURDIR}/mknodes.c -o $@
---
> 	${HOSTCC} ${CFLAGS} ${.CURDIR}/mknodes.c -o $@
46c46
< 	${CC} ${CFLAGS} ${.CURDIR}/mksyntax.c -o $@
---
> 	${HOSTCC} ${CFLAGS} ${.CURDIR}/mksyntax.c -o $@
Index: src/lib/libc/stdlib/strtod.c
#	what define should be used here,
#	port currently defines both.
===================================================================
RCS file: /cvs/src/lib/libc/stdlib/strtod.c,v
retrieving revision 1.7
diff -r1.7 strtod.c
98c98
<     defined(__ppc__)
---
>     defined(__powerpc__)
Index: src/lib/libkvm/kvm.c
#	Hackery to avoid problems with no MID_MACHINE for MID_POWERPC
===================================================================
RCS file: /cvs/src/lib/libkvm/kvm.c,v
retrieving revision 1.4
diff -r1.4 kvm.c
1c1
< /*	$OpenBSD: patches,v 1.2 1997/01/02 19:45:34 rahnds Exp $ */
---
> /*	$OpenBSD: patches,v 1.2 1997/01/02 19:45:34 rahnds Exp $ */
45c45
< static char *rcsid = "$OpenBSD: patches,v 1.2 1997/01/02 19:45:34 rahnds Exp $";
---
> static char *rcsid = "$OpenBSD: patches,v 1.2 1997/01/02 19:45:34 rahnds Exp $";
361a362
> #if #defined(__powerpc__)
368a370
> #endif
475a478
> #if !defined (__powerpc__)
477a481
> #endif
510a515
> #if !defined(__powerpc__)
511a517
> #endif
Index: src/lib/libtermlib/Makefile
#	Cross compilation issue.
===================================================================
RCS file: /cvs/src/lib/libtermlib/Makefile,v
retrieving revision 1.5
diff -r1.5 Makefile
67a68,70
> mkinfo: mkinfo.c
> 	${HOSTCC} -O -I${.CURDIR} -o mkinfo ${>}
> 
Index: src/sbin/Makefile
# powerpc and arc use fdisk.
===================================================================
RCS file: /cvs/src/sbin/Makefile,v
retrieving revision 1.21
diff -r1.21 Makefile
35c35
< .elif ${MACHINE} == "arc"
---
> .elif (${MACHINE} == "arc") || (${MACHINE} == "powerpc")
Index: src/sbin/fdisk/fdisk.c
# powerpc uses fdisk.
# these changes make bigendian system able to use fdisk.
# the 0xA6 Needs to be resolved before checking this in.
===================================================================
RCS file: /cvs/src/sbin/fdisk/fdisk.c,v
retrieving revision 1.9
diff -r1.9 fdisk.c
124c124
< 	{ 0xA6, "OpenBSD"},
---
> 	{ 0xA6, "OpenBSD or BSD Big Endian"},
267a268,310
> static inline unsigned short
> getshort(p)
> 	void *p;
> {
> 	unsigned char *cp = p;
> 
> 	return cp[0] | (cp[1] << 8);
> }
> 
> static inline void
> putshort(p, l)
> 	void *p;
> 	unsigned short l;
> {
> 	unsigned char *cp = p;
> 
> 	*cp++ = l;
> 	*cp++ = l >> 8;
> }
> 
> static inline unsigned long
> getlong(p)
> 	void *p;
> {
> 	unsigned char *cp = p;
> 
> 	return cp[0] | (cp[1] << 8) | (cp[2] << 16) | (cp[3] << 24);
> }
> 
> static inline void
> putlong(p, l)
> 	void *p;
> 	unsigned long l;
> {
> 	unsigned char *cp = p;
> 
> 	*cp++ = l;
> 	*cp++ = l >> 8;
> 	*cp++ = l >> 16;
> 	*cp++ = l >> 24;
> }
> 
> 
283,284c326,327
< 	    partp->dp_start, partp->dp_size,
< 	    partp->dp_size * 512 / (1024 * 1024), partp->dp_flag);
---
> 	    getlong(&partp->dp_start), getlong(&partp->dp_size),
> 	    getlong(&partp->dp_size) * 512 / (1024 * 1024), partp->dp_flag);
308c351
< 	mboot.signature = BOOT_MAGIC;
---
> 	putshort(&mboot.signature, BOOT_MAGIC);
313,314c356,357
< 	partp->dp_start = start;
< 	partp->dp_size = disksectors - start;
---
> 	putlong(&partp->dp_start, start);
> 	putlong(&partp->dp_size,disksectors - start);
316c359
< 	dos(partp->dp_start,
---
> 	dos(getlong(&partp->dp_start),
318c361
< 	dos(partp->dp_start + partp->dp_size - 1,
---
> 	dos(getlong(&partp->dp_start) + getlong(&partp->dp_size) - 1,
424c467
< 		*absolute = part->dp_start;
---
> 		*absolute = getlong(&part->dp_start);
429c472,473
< 		*absolute = part->dp_start + part->dp_size - 1;
---
> 		*absolute = getlong(&part->dp_start)
> 			+ getlong(&part->dp_size) - 1;
456,457c500,501
< 		start = partp->dp_start,
< 		size = partp->dp_size;
---
> 		start = getlong(&partp->dp_start),
> 		size = getlong(&partp->dp_size);
462,463c506,507
< 		partp->dp_start = start;
< 		partp->dp_size = size;
---
> 		putlong(&partp->dp_start, start);
> 		putlong(&partp->dp_size, size);
488c532
< 			dos(partp->dp_start,
---
> 			dos(getlong(&partp->dp_start),
490c534,535
< 			dos(partp->dp_start + partp->dp_size - 1,
---
> 			dos(getlong(&partp->dp_start)
> 			    + getlong(&partp->dp_size) - 1,
650,652c695,696
< 	if (mboot.signature != BOOT_MAGIC) {
< 		fprintf(stderr,
< 		    "warning: invalid fdisk partition table found!\n");
---
> 	if (getshort(&mboot.signature) != BOOT_MAGIC) {
> 		warnx("invalid fdisk partition table found!\n");
Index: src/share/mk/bsd.prog.mk
#	Support DESTDIR compilation under elf.
#	Probably needed for mips and alpha
===================================================================
RCS file: /cvs/src/share/mk/bsd.prog.mk,v
retrieving revision 1.7
diff -r1.7 bsd.prog.mk
14a15,19
> .if (${MACHINE_ARCH} == "powerpc")
> CRTBEGIN?=       ${DESTDIR}/usr/lib/crtbegin.o
> CRTEND?=         ${DESTDIR}/usr/lib/crtend.o
> .endif
> 
73c78
< 	${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} -nostdlib -L${DESTDIR}/usr/lib ${LIBCRT0} ${OBJS} ${LDADD} -lgcc -lc -lgcc
---
> 	${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} -nostdlib -L${DESTDIR}/usr/lib ${LIBCRT0} ${CRTBEGIN} ${OBJS} ${LDADD} -lgcc -lc -lgcc ${CRTEND}
Index: src/sys/conf/param.c
# this should not be necessary now. Need to check on this.
===================================================================
RCS file: /cvs/src/sys/conf/param.c,v
retrieving revision 1.2
diff -r1.2 param.c
1c1
< /*	$OpenBSD: patches,v 1.2 1997/01/02 19:45:34 rahnds Exp $	*/
---
> /*	$OpenBSD: patches,v 1.2 1997/01/02 19:45:34 rahnds Exp $	*/
103c103
< int	fscale = FSCALE;	/* kernel uses `FSCALE', user uses `fscale' */
---
> int	fscale __asm__ ("_fscale") = FSCALE;	/* kernel uses `FSCALE', user uses `fscale' */
Index: src/sys/kern/kern_synch.c
# this should not be necessary now. Need to check on this.
===================================================================
RCS file: /cvs/src/sys/kern/kern_synch.c,v
retrieving revision 1.5
diff -r1.5 kern_synch.c
148c148
< fixpt_t	ccpu = 0.95122942450071400909 * FSCALE;		/* exp(-1/20) */
---
> fixpt_t	ccpu __asm__ ("_ccpu") = 0.95122942450071400909 * FSCALE;		/* exp(-1/20) */
Index: src/sys/kern/vfs_cache.c
# Probably a bug in the port, but this makes the system MANY TIMES
# more stable.
===================================================================
RCS file: /cvs/src/sys/kern/vfs_cache.c,v
retrieving revision 1.2
diff -r1.2 vfs_cache.c
75c75
< int doingcache = 1;			/* 1 => enable the cache */
---
> int doingcache = 0;			/* 1 => enable the cache */
Index: src/sys/lib/libsa/Makefile
#	Powerpc port uses memset by default instead of bzero.
#	Compiler configuration.
===================================================================
RCS file: /cvs/src/sys/lib/libsa/Makefile,v
retrieving revision 1.9
diff -r1.9 Makefile
26c26
< 	printf.c strerror.c strcmp.c memset.c memcmp.c strncpy.c
---
> 	printf.c strerror.c memset.c memcmp.c strncpy.c
Index: src/sys/lib/libsa/Makefile.inc
#	Is this patch necessary, Correct???
===================================================================
RCS file: /cvs/src/sys/lib/libsa/Makefile.inc,v
retrieving revision 1.4
diff -r1.4 Makefile.inc
7c7
< SADST=	lib/sa
---
> SADST=	${.OBJDIR}/lib/sa
Index: src/sys/lib/libsa/memcpy.c
#	Ok, why did we need both...
===================================================================
RCS file: /cvs/src/sys/lib/libsa/memcpy.c,v
retrieving revision 1.3
diff -r1.3 memcpy.c
41a42,47
> #undef bcopy
> void *
> bcopy(s2, s1, n)
> {
> 	return 	memcpy(s1,s2,n);
> }
Index: src/usr.bin/lorder/lorder.sh
#	If no object in a library used a symbol from
#	another object, that second object would not
#	be included in the tsort output, This fixes
#	it with a self dependancy, why does this only
#	happen on elf or powerpc...
===================================================================
RCS file: /cvs/src/usr.bin/lorder/lorder.sh,v
retrieving revision 1.5
diff -r1.5 lorder.sh
67a68,76
> # make certian that each file is included at least once.
> # at a minimum put out a line containing "file file"
> # for each file.
> 
> for file in $*
> do
> 	echo ${file} ${file}
> done
> 
Index: src/usr.bin/xlint/lint1/param.h
#	Which is the correct define to use for the port.
===================================================================
RCS file: /cvs/src/usr.bin/xlint/lint1/param.h,v
retrieving revision 1.5
diff -r1.5 param.h
88c88
< #elif __ppc__
---
> #elif __powerpc__