1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 # T2 SDE: package/.../quik/lib_update.patch
5 # Copyright (C) 2004 - 2005 The T2 SDE Project
6 # Copyright (C) 1998 - 2003 ROCK Linux Project
8 # More information can be found in the files COPYING and README.
10 # This patch file is dual-licensed. It is available under the license the
11 # patched project is licensed under, as long as it is an OpenSource license
12 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
13 # of the GNU General Public License as published by the Free Software
14 # Foundation; either version 2 of the License, or (at your option) any later
16 # --- T2-COPYRIGHT-NOTE-END ---
18 --- ./quik/quik.c 2002-06-05 08:04:29.000000000 -0400
19 +++ ./quik/quik.c 2002-12-14 19:04:12.000000000 -0500
21 strcat(buffer, path + 1);
24 - return strdup(path);
25 + return (char *) strdup(path);
28 void write_block_table(char *device, char *config_file, int partno)
29 --- ./second/cfg.c 2002-06-05 08:04:29.000000000 -0400
30 +++ ./second/cfg.c 2002-12-14 18:53:49.000000000 -0500
35 - printf ("Config file error: ");
37 + q_printf ("Config file error: ");
38 + q_vprintf (msg, ap);
40 - printf (" near line %d in file %s\n", line_num, file_name);
41 + q_printf (" near line %d in file %s\n", line_num, file_name);
49 - printf ("Config file warning: ");
51 + q_printf ("Config file warning: ");
52 + q_vprintf (msg, ap);
54 - printf (" near line %d in file %s\n", line_num, file_name);
55 + q_printf (" near line %d in file %s\n", line_num, file_name);
60 int len = strlen (label);
64 - printf ("%s", label);
66 + q_printf ("%s", label);
74 - printf ("\nYou can also type in custom image locations, in the form\n"
75 + q_printf ("\nYou can also type in custom image locations, in the form\n"
76 "{prom_path;}partno/path_to_image or {prom_path;}{partno}[start-end]\n");
79 --- ./second/disk.c 2000-03-10 15:59:28.000000000 -0500
80 +++ ./second/disk.c 2002-12-14 18:54:37.000000000 -0500
83 current_dev = call_prom("open", 1, 1, device);
84 if (current_dev == (ihandle) 0 || current_dev == (ihandle) -1) {
85 - printf("\nCouldn't open %s\n", device);
86 + q_printf("\nCouldn't open %s\n", device);
89 strcpy(current_devname, device);
91 * just a few partitions. -- Cort
94 - sprintf(bootdevice, "disk:0");
95 + q_sprintf(bootdevice, "disk:0");
96 if( open(bootdevice) )
100 * try this if disk:0 fails
103 - sprintf(bootdevice, "/pci@fee00000/scsi@c/sd@8:0");
104 + q_sprintf(bootdevice, "/pci@fee00000/scsi@c/sd@8:0");
105 return open(bootdevice);
108 --- ./second/file.c 2002-06-05 08:04:29.000000000 -0400
109 +++ ./second/file.c 2002-12-14 18:59:19.000000000 -0500
111 #include <sys/types.h>
116 #include <linux/ext2_fs.h>
117 #include <ext2fs/ext2fs.h>
120 /* check the MSDOS partition magic */
121 if ( (blk[0x1fe] != 0x55) || (blk[0x1ff] != 0xaa) )
123 - printf("No MSDOS partition magic number on disk!\n");
124 + q_printf("No MSDOS partition magic number on disk!\n");
128 @@ -167,14 +167,14 @@
132 -int sprintf (char *buf, char *fmt,...)
133 +int q_sprintf (char *buf, char *fmt,...)
138 void com_err (const char *a, long i, const char *fmt,...)
140 - printf ((char *) fmt);
141 + q_printf ((char *) fmt);
144 static errcode_t linux_open (const char *name, int flags, io_channel * channel)
146 tempb = (((long long) block) * ((long long)bs)) + doff;
147 size = (count < 0) ? -count : count * bs;
148 if (read (data, size, tempb) != size) {
149 - printf ("\nRead error on block %d", block);
150 + q_printf ("\nRead error on block %d", block);
151 return EXT2_ET_SHORT_READ;
155 static char rot[] = "\\|/-";
158 - printf ("%c\b", rot[(i / freq) % 4]);
159 + q_printf ("%c\b", rot[(i / freq) % 4]);
165 retval = ext2fs_block_iterate(fs, inode, 0, 0, dump_block, 0);
167 - printf ("Error %d reading %s", retval, filename);
168 + q_printf ("Error %d reading %s", retval, filename);
171 return dump_finish();
178 "Ranges of physical blocks are specified as {prom_path:}{partno}[xx-yy]\n"
179 "where {} means optional part, partno defaults to 0 (i.e. whole disk)\n"
180 "and xx is the starting block (chunk of 512 bytes) and yy end (not\n"
185 - printf ("\nInternal error while loading blocks from device\n");
186 + q_printf ("\nInternal error while loading blocks from device\n");
193 if (retval = ext2fs_namei(fs, root, cwd, filename, &inode)) {
194 - printf("\nInode error #%d while loading file %s.", retval, filename);
195 + q_printf("\nInode error #%d while loading file %s.", retval, filename);
199 --- ./second/main.c 2002-06-05 08:04:29.000000000 -0400
200 +++ ./second/main.c 2002-12-14 18:57:18.000000000 -0500
203 void fatal(const char *msg)
205 - printf("\nFatal error: %s\n", msg);
206 + q_printf("\nFatal error: %s\n", msg);
209 void maintabfunc (void)
213 - printf("boot: %s", cbuff);
214 + q_printf("boot: %s", cbuff);
219 if (useconf && (q = cfg_get_strg(0, "timeout")) != 0 && *q != 0)
220 timeout = strtol(q, NULL, 0);
223 + q_printf("boot: ");
227 @@ -232,14 +232,14 @@
231 - printf("%s", imagename);
232 + q_printf("%s", imagename);
234 - printf(" %s", *params);
236 + q_printf(" %s", *params);
240 cmdedit(maintabfunc, c);
243 strcpy(given_bootargs, cbuff);
244 given_bootargs_by_user = 1;
252 "Enter the kernel image name as [device:][partno]/path, where partno is a\n"
253 "number from 0 to 16. Instead of /path you can type [mm-nn] to specify a\n"
254 "range of disk blocks (512B)\n");
256 device = cfg_get_strg(0, "device");
257 if (load_file(device, part, kname, TMP_BUF, TMP_END, &len, 1, 0)) {
259 - printf("\n%s", (char *)TMP_BUF);
260 + q_printf("\n%s", (char *)TMP_BUF);
266 if ( (unsigned long)prom_entry == 0x426f6f58 )
268 - printf("BootX launched us\n");
269 + q_printf("BootX launched us\n");
270 prom_entry = (void *)id;
272 * These should come from the bootx info.
275 memset(&__bss_start, 0, &_end - &__bss_start);
276 prom_init(prom_entry);
277 - printf("Second-stage QUIK loader\n");
278 + q_printf("Second-stage QUIK loader\n");
280 if (diskinit() == -1)
282 @@ -403,24 +403,24 @@
283 fileok = load_file(0, quik_conf_part, quik_conf,
284 TMP_BUF, TMP_END, &len, 1, 0);
285 if (!fileok || (unsigned) len >= 65535)
286 - printf("\nCouldn't load %s\n", quik_conf);
287 + q_printf("\nCouldn't load %s\n", quik_conf);
290 if (cfg_parse(quik_conf, TMP_BUF, len) < 0)
291 - printf ("Syntax error or read error in %s.\n", quik_conf);
292 + q_printf ("Syntax error or read error in %s.\n", quik_conf);
294 p = cfg_get_strg(0, "init-code");
296 call_prom("interpret", 1, 1, p);
297 p = cfg_get_strg(0, "init-message");
301 p = cfg_get_strg(0, "message");
303 print_message_file(p);
310 get_params(&device, &part, &kname, ¶ms);
311 @@ -431,11 +431,11 @@
312 TMP_BUF, TMP_END, &image_len, 1, 0);
315 - printf ("\nImage not found.... try again\n");
316 + q_printf ("\nImage not found.... try again\n");
319 if (image_len > TMP_END - TMP_BUF) {
320 - printf("\nImage is too large (%u > %u)\n", image_len,
321 + q_printf("\nImage is too large (%u > %u)\n", image_len,
325 @@ -448,13 +448,13 @@
326 e->e_ident[EI_MAG1] == ELFMAG1 &&
327 e->e_ident[EI_MAG2] == ELFMAG2 &&
328 e->e_ident[EI_MAG3] == ELFMAG3)) {
329 - printf ("\n%s: unknown image format\n", kname);
330 + q_printf ("\n%s: unknown image format\n", kname);
334 if (e->e_ident[EI_CLASS] != ELFCLASS32
335 || e->e_ident[EI_DATA] != ELFDATA2MSB) {
336 - printf("Image is not a 32bit MSB ELF image\n");
337 + q_printf("Image is not a 32bit MSB ELF image\n");
342 len = p->p_offset + p->p_filesz - off;
345 - printf("Cannot find a loadable segment in ELF image\n");
346 + q_printf("Cannot find a loadable segment in ELF image\n");
349 entry = e->e_entry & ADDRMASK;
354 - printf("%s", pause_message);
355 + q_printf("%s", pause_message);
362 @@ -509,12 +509,12 @@
363 /* doesn't look like a procedure descriptor */
366 - printf("Starting at %x\n", start);
367 + q_printf("Starting at %x\n", start);
369 /* setup the bootinfo */
370 binf.magic_start = bin.magic_end = BOOT_INFO_MAGIC;
371 - sprintf( binf.cmd_line, "%s", params );
372 - sprintf( binf.boot_loader, "Quik" );
373 + q_sprintf( binf.cmd_line, "%s", params );
374 + q_sprintf( binf.boot_loader, "Quik" );
376 binf._machine = _MACH_chrp;
378 --- ./second/printf.c 2000-03-10 15:59:28.000000000 -0500
379 +++ ./second/printf.c 2002-12-14 18:58:02.000000000 -0500
383 static void printn(long, int);
384 -extern void vprintf(char *, va_list);
385 +extern void q_vprintf(char *, va_list);
388 * Scaled down version of C Library printf.
389 * Only %c %s %u %d (==%u) %o %x %D %O are recognized.
392 -void printf (char *fmt,...)
393 +void q_printf (char *fmt,...)
399 + q_vprintf (fmt, x1);
403 -void vprintf (char *fmt, va_list adx)
404 +void q_vprintf (char *fmt, va_list adx)