[OpenBIOS] r284 - in openbios-devel: arch/amd64 arch/ppc arch/ppc/briq arch/ppc/mol arch/ppc/pearpc arch/sparc32 arch/sparc64 arch/unix arch/unix/gui_qt arch/unix/plugins/plugin_pci arch/unix/plugins/plugin_qt arch/x86 arch/x86/xbox drivers fs fs/grubfs fs/hfs fs/hfsplus fs/hfsplus/include include include/amd64 include/ia64 include/libc include/openbios include/ppc include/unix include/x86 kernel kernel/include libc modules
svn at openbios.org
svn at openbios.org
Thu Dec 11 21:30:53 CET 2008
Author: blueswirl
Date: 2008-12-11 21:30:53 +0100 (Thu, 11 Dec 2008)
New Revision: 284
Modified:
openbios-devel/arch/amd64/boot.c
openbios-devel/arch/amd64/console.c
openbios-devel/arch/amd64/context.c
openbios-devel/arch/amd64/elfload.c
openbios-devel/arch/amd64/lib.c
openbios-devel/arch/amd64/linux_load.c
openbios-devel/arch/amd64/loadfs.c
openbios-devel/arch/amd64/multiboot.c
openbios-devel/arch/amd64/multiboot.h
openbios-devel/arch/amd64/openbios.c
openbios-devel/arch/amd64/openbios.h
openbios-devel/arch/amd64/segment.c
openbios-devel/arch/amd64/switch.S
openbios-devel/arch/amd64/sys_info.c
openbios-devel/arch/ppc/briq/briq.c
openbios-devel/arch/ppc/briq/briq.h
openbios-devel/arch/ppc/briq/init.c
openbios-devel/arch/ppc/briq/kernel.c
openbios-devel/arch/ppc/briq/main.c
openbios-devel/arch/ppc/briq/methods.c
openbios-devel/arch/ppc/briq/tree.c
openbios-devel/arch/ppc/briq/vfd.c
openbios-devel/arch/ppc/kernel.c
openbios-devel/arch/ppc/kernel.h
openbios-devel/arch/ppc/misc.S
openbios-devel/arch/ppc/mmutypes.h
openbios-devel/arch/ppc/mol/console.c
openbios-devel/arch/ppc/mol/init.c
openbios-devel/arch/ppc/mol/kernel.c
openbios-devel/arch/ppc/mol/main.c
openbios-devel/arch/ppc/mol/methods.c
openbios-devel/arch/ppc/mol/mol.c
openbios-devel/arch/ppc/mol/mol.h
openbios-devel/arch/ppc/mol/osi-blk.c
openbios-devel/arch/ppc/mol/osi-scsi.c
openbios-devel/arch/ppc/mol/prom.c
openbios-devel/arch/ppc/mol/prom.h
openbios-devel/arch/ppc/mol/pseudodisk.c
openbios-devel/arch/ppc/mol/tree.c
openbios-devel/arch/ppc/ofmem.c
openbios-devel/arch/ppc/osi.h
openbios-devel/arch/ppc/osi_calls.h
openbios-devel/arch/ppc/pearpc/init.c
openbios-devel/arch/ppc/pearpc/kernel.c
openbios-devel/arch/ppc/pearpc/main.c
openbios-devel/arch/ppc/pearpc/methods.c
openbios-devel/arch/ppc/pearpc/pearpc.c
openbios-devel/arch/ppc/pearpc/pearpc.h
openbios-devel/arch/ppc/pearpc/tree.c
openbios-devel/arch/ppc/pearpc/vfd.c
openbios-devel/arch/ppc/start.S
openbios-devel/arch/sparc32/linux_load.c
openbios-devel/arch/sparc32/loadfs.c
openbios-devel/arch/sparc32/openbios.c
openbios-devel/arch/sparc32/switch.S
openbios-devel/arch/sparc64/boot.c
openbios-devel/arch/sparc64/console.c
openbios-devel/arch/sparc64/entry.S
openbios-devel/arch/sparc64/linux_load.c
openbios-devel/arch/sparc64/loadfs.c
openbios-devel/arch/sparc64/openbios.c
openbios-devel/arch/sparc64/openbios.h
openbios-devel/arch/unix/blk.c
openbios-devel/arch/unix/boot.c
openbios-devel/arch/unix/gui_qt/gui-qt.cpp
openbios-devel/arch/unix/gui_qt/gui-qt.h
openbios-devel/arch/unix/gui_qt/qt-main.cpp
openbios-devel/arch/unix/plugins/plugin_pci/plugin_pci.c
openbios-devel/arch/unix/plugins/plugin_qt/pciconfig.h
openbios-devel/arch/unix/plugins/plugin_qt/plugin_qt.cpp
openbios-devel/arch/unix/plugins/plugin_qt/plugin_qt.h
openbios-devel/arch/unix/plugins/plugin_qt/qt_main.cpp
openbios-devel/arch/unix/unix.c
openbios-devel/arch/x86/boot.c
openbios-devel/arch/x86/console.c
openbios-devel/arch/x86/context.c
openbios-devel/arch/x86/elfload.c
openbios-devel/arch/x86/entry.S
openbios-devel/arch/x86/exception.c
openbios-devel/arch/x86/forthload.c
openbios-devel/arch/x86/lib.c
openbios-devel/arch/x86/linux_load.c
openbios-devel/arch/x86/loadfs.c
openbios-devel/arch/x86/multiboot.c
openbios-devel/arch/x86/multiboot.h
openbios-devel/arch/x86/openbios.c
openbios-devel/arch/x86/openbios.h
openbios-devel/arch/x86/segment.c
openbios-devel/arch/x86/sys_info.c
openbios-devel/arch/x86/xbox/console.c
openbios-devel/arch/x86/xbox/methods.c
openbios-devel/drivers/adb.c
openbios-devel/drivers/adb.h
openbios-devel/drivers/floppy.c
openbios-devel/drivers/ide.c
openbios-devel/drivers/ide.h
openbios-devel/drivers/kbd.c
openbios-devel/drivers/kbd.h
openbios-devel/drivers/pci.c
openbios-devel/drivers/scsi.h
openbios-devel/drivers/timer.c
openbios-devel/drivers/vga.h
openbios-devel/drivers/vga_load_regs.c
openbios-devel/fs/grubfs/defs.h
openbios-devel/fs/grubfs/dir.h
openbios-devel/fs/grubfs/disk_inode_ffs.h
openbios-devel/fs/grubfs/filesys.h
openbios-devel/fs/grubfs/fs.h
openbios-devel/fs/grubfs/fsys_affs.c
openbios-devel/fs/grubfs/fsys_ext2fs.c
openbios-devel/fs/grubfs/fsys_fat.c
openbios-devel/fs/grubfs/fsys_ffs.c
openbios-devel/fs/grubfs/fsys_iso9660.c
openbios-devel/fs/grubfs/fsys_jfs.c
openbios-devel/fs/grubfs/fsys_minix.c
openbios-devel/fs/grubfs/fsys_ntfs.c
openbios-devel/fs/grubfs/fsys_reiserfs.c
openbios-devel/fs/grubfs/fsys_vstafs.c
openbios-devel/fs/grubfs/fsys_xfs.c
openbios-devel/fs/grubfs/glue.h
openbios-devel/fs/grubfs/grubfs_fs.c
openbios-devel/fs/grubfs/jfs.h
openbios-devel/fs/grubfs/ufs_fs.h
openbios-devel/fs/grubfs/xfs.h
openbios-devel/fs/hfs/block.c
openbios-devel/fs/hfs/hfs.c
openbios-devel/fs/hfs/hfs_fs.c
openbios-devel/fs/hfs_mdb.h
openbios-devel/fs/hfsplus/blockiter.c
openbios-devel/fs/hfsplus/btree.c
openbios-devel/fs/hfsplus/hfsp_fs.c
openbios-devel/fs/hfsplus/include/apple.h
openbios-devel/fs/hfsplus/include/blockiter.h
openbios-devel/fs/hfsplus/include/btree.h
openbios-devel/fs/hfsplus/include/hfs.h
openbios-devel/fs/hfsplus/include/hfsp.h
openbios-devel/fs/hfsplus/include/hfstime.h
openbios-devel/fs/hfsplus/include/libhfsp.h
openbios-devel/fs/hfsplus/include/record.h
openbios-devel/fs/hfsplus/include/unicode.h
openbios-devel/fs/hfsplus/include/volume.h
openbios-devel/fs/hfsplus/libhfsp.c
openbios-devel/fs/hfsplus/record.c
openbios-devel/fs/hfsplus/unicode.c
openbios-devel/fs/hfsplus/volume.c
openbios-devel/fs/ioglue.c
openbios-devel/include/a.out.h
openbios-devel/include/amd64/io.h
openbios-devel/include/elf_boot.h
openbios-devel/include/ia64/io.h
openbios-devel/include/libc/diskio.h
openbios-devel/include/libc/stdlib.h
openbios-devel/include/libc/string.h
openbios-devel/include/libc/vsprintf.h
openbios-devel/include/mconfig.h
openbios-devel/include/ofmem.h
openbios-devel/include/openbios/bindings.h
openbios-devel/include/openbios/config.h
openbios-devel/include/openbios/drivers.h
openbios-devel/include/openbios/elfload.h
openbios-devel/include/openbios/fs.h
openbios-devel/include/openbios/kernel.h
openbios-devel/include/openbios/nvram.h
openbios-devel/include/openbios/of.h
openbios-devel/include/ppc/asmdefs.h
openbios-devel/include/ppc/processor.h
openbios-devel/include/sys_info.h
openbios-devel/include/unix/plugin_pci.h
openbios-devel/include/unix/plugins.h
openbios-devel/include/x86/io.h
openbios-devel/kernel/bootstrap.c
openbios-devel/kernel/cross.h
openbios-devel/kernel/dict.c
openbios-devel/kernel/forth.c
openbios-devel/kernel/include/dict.h
openbios-devel/kernel/internal.c
openbios-devel/kernel/primitives.c
openbios-devel/libc/diskio.c
openbios-devel/libc/extra.c
openbios-devel/libc/misc.c
openbios-devel/libc/vsprintf.c
openbios-devel/modules/bindings.c
openbios-devel/modules/client.c
openbios-devel/modules/cmdline.c
openbios-devel/modules/console.c
openbios-devel/modules/deblocker.c
openbios-devel/modules/disk-label.c
openbios-devel/modules/elfload.c
openbios-devel/modules/filesystems.c
openbios-devel/modules/init.c
openbios-devel/modules/ipchecksum.c
openbios-devel/modules/linuxbios.c
openbios-devel/modules/linuxbios.h
openbios-devel/modules/mac-parts.c
openbios-devel/modules/mac-parts.h
openbios-devel/modules/modules.h
openbios-devel/modules/nvram.c
openbios-devel/modules/pc-parts.c
openbios-devel/modules/sun-parts.c
openbios-devel/modules/video.c
Log:
Delete extra whitespace at the end of line, which annoys quilt
Modified: openbios-devel/arch/amd64/boot.c
===================================================================
--- openbios-devel/arch/amd64/boot.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/amd64/boot.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -14,14 +14,14 @@
void boot(void);
-struct sys_info sys_info;
+struct sys_info sys_info;
void boot(void)
{
char *path=pop_fstr_copy(), *param;
-
+
// char *param="root=/dev/hda2 console=ttyS0,115200n8 console=tty0";
-
+
if(!path) {
printk("[x86] Booting default not supported.\n");
return;
@@ -32,7 +32,7 @@
*param = '\0';
param++;
}
-
+
printk("[x86] Booting file '%s' with parameters '%s'\n",path, param);
if (elf_load(&sys_info, path, param) == LOADER_NOT_SUPPORT)
Modified: openbios-devel/arch/amd64/console.c
===================================================================
--- openbios-devel/arch/amd64/console.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/amd64/console.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -200,7 +200,7 @@
static void video_putchar(int c)
{
int p=1;
-
+
if (c == '\n' || c == '\r') {
video_newline();
return;
@@ -228,7 +228,7 @@
static void video_cls(void)
{
int i;
-
+
for (i = 0; i < 2 * COLUMNS * LINES;) {
video[i++] = 0;
video[i++] = ATTRIBUTE;
Modified: openbios-devel/arch/amd64/context.c
===================================================================
--- openbios-devel/arch/amd64/context.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/amd64/context.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -17,7 +17,7 @@
void __exit_context(void); /* assembly routine */
/*
- * Main context structure
+ * Main context structure
* It is placed at the bottom of our stack, and loaded by assembly routine
* to start us up.
*/
Modified: openbios-devel/arch/amd64/elfload.c
===================================================================
--- openbios-devel/arch/amd64/elfload.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/amd64/elfload.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -153,7 +153,7 @@
}
bytes += phdr[i].p_filesz;
debug("clearing... ");
- memset(phys_to_virt(phdr[i].p_paddr + phdr[i].p_filesz), 0,
+ memset(phys_to_virt(phdr[i].p_paddr + phdr[i].p_filesz), 0,
phdr[i].p_memsz - phdr[i].p_filesz);
if (phdr[i].p_offset <= checksum_offset
&& phdr[i].p_offset + phdr[i].p_filesz >= checksum_offset+2) {
@@ -356,7 +356,7 @@
if (!load_segments(phdr, ehdr.e_phnum, checksum_offset))
goto out;
-
+
if (checksum_offset) {
if (!verify_image(&ehdr, phdr, ehdr.e_phnum, checksum))
goto out;
Modified: openbios-devel/arch/amd64/lib.c
===================================================================
--- openbios-devel/arch/amd64/lib.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/amd64/lib.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -15,7 +15,7 @@
#include "openbios/kernel.h"
/* Format a string and print it on the screen, just like the libc
- * function printf.
+ * function printf.
*/
int printk( const char *fmt, ... )
{
Modified: openbios-devel/arch/amd64/linux_load.c
===================================================================
--- openbios-devel/arch/amd64/linux_load.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/amd64/linux_load.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -123,7 +123,7 @@
uint16_t ramdisk_flags; /* 0x1f8 */
#define RAMDISK_IMAGE_START_MASK 0x07FF
#define RAMDISK_PROMPT_FLAG 0x8000
-#define RAMDISK_LOAD_FLAG 0x4000
+#define RAMDISK_LOAD_FLAG 0x4000
uint8_t reserved8[2]; /* 0x1fa */
uint16_t orig_root_dev; /* 0x1fc */
uint8_t reserved9[1]; /* 0x1fe */
@@ -464,7 +464,7 @@
max = hdr->initrd_addr_max;
else
max = 0x38000000; /* Hardcoded value for older kernels */
-
+
/* FILO itself is at the top of RAM. (relocated)
* So, try putting initrd just below us. */
end = virt_to_phys(_start);
@@ -520,9 +520,9 @@
outb(0, 0xf0);
outb(0, 0xf1);
- /* we're getting screwed again and again by this problem of the 8259.
- * so we're going to leave this lying around for inclusion into
- * crt0.S on an as-needed basis.
+ /* we're getting screwed again and again by this problem of the 8259.
+ * so we're going to leave this lying around for inclusion into
+ * crt0.S on an as-needed basis.
*
* well, that went ok, I hope. Now we have to reprogram the interrupts :-(
* we put them right after the intel-reserved hardware interrupts, at
@@ -565,8 +565,8 @@
linux_gdt[2] = gdt[FLAT_CODE];
linux_gdt[3] = gdt[FLAT_DATA];
/* 2.6 kernel uses 12 and 13, but head.S uses backward-compatible
- * segments (2 and 3), so it SHOULD not be a problem.
- * However, some distro kernels (eg. RH9) with backported threading
+ * segments (2 and 3), so it SHOULD not be a problem.
+ * However, some distro kernels (eg. RH9) with backported threading
* patch use 12 and 13 also when booting... */
linux_gdt[12] = gdt[FLAT_CODE];
linux_gdt[13] = gdt[FLAT_DATA];
@@ -594,7 +594,7 @@
params->orig_x = cursor_x;
params->orig_y = cursor_y;
#endif
-
+
/* Go... */
ctx = switch_to(ctx);
Modified: openbios-devel/arch/amd64/loadfs.c
===================================================================
--- openbios-devel/arch/amd64/loadfs.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/amd64/loadfs.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -27,18 +27,18 @@
unsigned long file_size(void)
{
llong fpos, fsize;
-
+
/* save current position */
fpos=tell(load_fd);
/* go to end of file and get position */
seek_io(load_fd, -1);
fsize=tell(load_fd);
-
+
/* go back to old position */
seek_io(load_fd, 0);
seek_io(load_fd, fpos);
-
+
return fsize;
}
Modified: openbios-devel/arch/amd64/multiboot.c
===================================================================
--- openbios-devel/arch/amd64/multiboot.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/amd64/multiboot.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,6 +1,6 @@
/* Support for Multiboot */
-#include "openbios/config.h"
+#include "openbios/config.h"
#include "asm/io.h"
#include "sys_info.h"
#include "multiboot.h"
@@ -9,7 +9,7 @@
#ifdef CONFIG_DEBUG_BOOT
#define debug printk
#else
-#define debug(x...)
+#define debug(x...)
#endif
struct mbheader {
@@ -62,11 +62,11 @@
printf("Multiboot: no dictionary\n");
return;
}
-
+
mod = (module_t *) mbinfo->mods_addr;
info->dict_start=(unsigned long *)mod->mod_start;
info->dict_end=(unsigned long *)mod->mod_end;
-
+
if (mbinfo->flags & MULTIBOOT_MMAP_VALID) {
/* convert mmap records */
mbmem = phys_to_virt(mbinfo->mmap_addr);
Modified: openbios-devel/arch/amd64/multiboot.h
===================================================================
--- openbios-devel/arch/amd64/multiboot.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/amd64/multiboot.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,5 +1,5 @@
-/* multiboot.h
- * tag: header for multiboot
+/* multiboot.h
+ * tag: header for multiboot
*
* Copyright (C) 2003-2004 Stefan Reinauer
*
Modified: openbios-devel/arch/amd64/openbios.c
===================================================================
--- openbios-devel/arch/amd64/openbios.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/amd64/openbios.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -24,7 +24,7 @@
static void init_memory(void)
{
/* push start and end of available memory to the stack
- * so that the forth word QUIT can initialize memory
+ * so that the forth word QUIT can initialize memory
* management. For now we use hardcoded memory between
* 0x10000 and 0x9ffff (576k). If we need more memory
* than that we have serious bloat.
@@ -60,11 +60,11 @@
#endif
collect_sys_info(&sys_info);
-
+
dict=intdict;
load_dictionary((char *)sys_info.dict_start,
sys_info.dict_end-sys_info.dict_start);
-
+
relocate(&sys_info);
#ifdef CONFIG_DEBUG_CONSOLE
@@ -83,7 +83,7 @@
PUSH_xt( bind_noname_func(arch_init) );
fword("PREPOST-initializer");
-
+
PC = (ucell)findword("initialize-of");
if (!PC) {
Modified: openbios-devel/arch/amd64/openbios.h
===================================================================
--- openbios-devel/arch/amd64/openbios.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/amd64/openbios.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2004/01/15 16:14:05 samuel>
* Time-stamp: <2004/01/15 16:14:05 samuel>
- *
+ *
* <openbios.h>
- *
- *
- *
+ *
+ *
+ *
* Copyright (C) 2004 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#ifndef _H_OPENBIOS
Modified: openbios-devel/arch/amd64/segment.c
===================================================================
--- openbios-devel/arch/amd64/segment.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/amd64/segment.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -22,7 +22,7 @@
unsigned int base;
} __attribute__((packed));
-/* How far the virtual address (used in C) is different from physical
+/* How far the virtual address (used in C) is different from physical
* address. Since we start in flat mode, the initial value is zero. */
unsigned long virt_offset = 0;
@@ -108,7 +108,7 @@
"movw %5, %%gs\n\t"
"movw %5, %%ss\n"
: "=&S" (d0), "=&D" (d1), "=&c" (d2)
- : "m" (gdtarg), "n" (RELOC_CS), "q" ((unsigned short) RELOC_DS),
+ : "m" (gdtarg), "n" (RELOC_CS), "q" ((unsigned short) RELOC_DS),
"0" (&_start), "1" (new_base), "2" (prog_size));
virt_offset = new_offset;
Modified: openbios-devel/arch/amd64/switch.S
===================================================================
--- openbios-devel/arch/amd64/switch.S 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/amd64/switch.S 2008-12-11 20:30:53 UTC (rev 284)
@@ -6,7 +6,7 @@
/*
* Entry point
* We start execution from here.
- * It is assumed that CPU is in 32-bit protected mode and
+ * It is assumed that CPU is in 32-bit protected mode and
* all segments are 4GB and base zero (flat model).
*/
entry:
@@ -28,7 +28,7 @@
* switches the stack, and restores everything from the new stack.
* This function takes no argument. New stack pointer is
* taken from global variable __context, and old stack pointer
- * is also saved to __context. This way we can just jump to
+ * is also saved to __context. This way we can just jump to
* this routine to get back to the original context.
*
* Call this routine with lcall or pushl %cs; call.
@@ -51,7 +51,7 @@
xchgl %eax, 64(%esp)
movl %eax, 60(%esp)
#endif
-
+
/* At this point we don't know if we are on flat segment
* or relocated. So compute the address offset from %eip.
* Assuming CS.base==DS.base==SS.base.
@@ -62,7 +62,7 @@
/* Interrupts are not allowed... */
cli
-
+
/* Current context pointer is our stack pointer */
movl %esp, %esi
Modified: openbios-devel/arch/amd64/sys_info.c
===================================================================
--- openbios-devel/arch/amd64/sys_info.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/amd64/sys_info.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -7,7 +7,7 @@
#ifdef CONFIG_DEBUG_BOOT
#define debug printk
#else
-#define debug(x...)
+#define debug(x...)
#endif
void collect_multiboot_info(struct sys_info *);
Modified: openbios-devel/arch/ppc/briq/briq.c
===================================================================
--- openbios-devel/arch/ppc/briq/briq.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/ppc/briq/briq.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,19 +1,19 @@
-/*
+/*
* Creation Date: <2004/08/28 18:38:22 greg>
* Time-stamp: <2004/08/28 18:38:22 greg>
- *
+ *
* <briq.c>
- *
+ *
* Copyright (C) 2004, Greg Watson
- *
+ *
* derived from mol.c
*
* Copyright (C) 2003, 2004 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#include "openbios/config.h"
@@ -114,7 +114,7 @@
{
if( !tty_avail() )
return 0;
-
+
if( ttychar < 0 )
ttychar = inb(UART_BASE);
return (ttychar >= 0);
@@ -167,7 +167,7 @@
{
printk (" ");
}
- }
+ }
}
Modified: openbios-devel/arch/ppc/briq/briq.h
===================================================================
--- openbios-devel/arch/ppc/briq/briq.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/ppc/briq/briq.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,15 +1,15 @@
-/*
+/*
* Creation Date: <2004/08/28 17:50:12 stepan>
* Time-stamp: <2004/08/28 17:50:12 stepan>
- *
+ *
* <briq.h>
- *
+ *
* Copyright (C) 2004 Stefan Reinauer
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#ifndef _H_BRIQ
Modified: openbios-devel/arch/ppc/briq/init.c
===================================================================
--- openbios-devel/arch/ppc/briq/init.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/ppc/briq/init.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,22 +1,22 @@
-/*
+/*
* Creation Date: <2004/08/28 18:38:22 greg>
* Time-stamp: <2004/08/28 18:38:22 greg>
- *
+ *
* <init.c>
- *
+ *
* Initialization for briq
*
* Copyright (C) 2004 Greg Watson
*
* based on mol/init.c:
- *
- * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Samuel & David Rydh
+ *
+ * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Samuel & David Rydh
* (samuel at ibrium.se, dary at lindesign.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation
- *
+ *
*/
#include "openbios/config.h"
@@ -63,7 +63,7 @@
printk("\n");
printk("=============================================================\n");
printk("OpenBIOS %s [%s]\n", OPENBIOS_RELEASE, OPENBIOS_BUILD_DATE );
-
+
ofmem_init();
initialize_forth();
/* won't return */
@@ -88,7 +88,7 @@
phandle_t ph;
#endif
int autoboot;
-
+
devtree_init();
node_methods_init();
nvram_init("/pci/mac-io/nvram");
Modified: openbios-devel/arch/ppc/briq/kernel.c
===================================================================
--- openbios-devel/arch/ppc/briq/kernel.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/ppc/briq/kernel.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,15 +1,15 @@
-/*
+/*
* Creation Date: <2004/08/28 18:03:25 stepan>
* Time-stamp: <2004/08/28 18:03:25 stepan>
- *
+ *
* <briq/kernel.c>
- *
+ *
* Copyright (C) 2004 Stefan Reinauer
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#include "briq-dict.h"
Modified: openbios-devel/arch/ppc/briq/main.c
===================================================================
--- openbios-devel/arch/ppc/briq/main.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/ppc/briq/main.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,18 +1,18 @@
-/*
+/*
* Creation Date: <2004/08/28 18:38:22 greg>
* Time-stamp: <2004/08/28 18:38:22 greg>
- *
+ *
* <main.c>
- *
+ *
* Copyright (C) 2004 Greg Watson
- *
- * Based on MOL specific code which is
+ *
+ * Based on MOL specific code which is
* Copyright (C) 2002, 2003, 2004 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation
- *
+ *
*/
@@ -65,7 +65,7 @@
s = MIN( phdr[i].p_filesz, phdr[i].p_memsz );
seek_io( fd, elf_offs + phdr[i].p_offset );
- /* printk("filesz: %08lX memsz: %08lX p_offset: %08lX p_vaddr %08lX\n",
+ /* printk("filesz: %08lX memsz: %08lX p_offset: %08lX p_vaddr %08lX\n",
phdr[i].p_filesz, phdr[i].p_memsz, phdr[i].p_offset,
phdr[i].p_vaddr ); */
@@ -90,7 +90,7 @@
#endif
flush_icache_range( addr, addr+s );
- /*printk("ELF ROM-section loaded at %08lX (size %08lX)\n",
+ /*printk("ELF ROM-section loaded at %08lX (size %08lX)\n",
(ulong)phdr[i].p_vaddr, (ulong)phdr[i].p_memsz );*/
}
free( phdr );
@@ -102,8 +102,8 @@
encode_bootpath( const char *spec, const char *args )
{
phandle_t chosen_ph = find_dev("/chosen");
- set_property( chosen_ph, "bootpath", spec, strlen(spec)+1 );
- set_property( chosen_ph, "bootargs", args, strlen(args)+1 );
+ set_property( chosen_ph, "bootpath", spec, strlen(spec)+1 );
+ set_property( chosen_ph, "bootargs", args, strlen(args)+1 );
}
/************************************************************************/
Modified: openbios-devel/arch/ppc/briq/methods.c
===================================================================
--- openbios-devel/arch/ppc/briq/methods.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/ppc/briq/methods.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,21 +1,21 @@
-/*
+/*
* Creation Date: <2004/08/28 18:38:22 greg>
* Time-stamp: <2004/08/28 18:38:22 greg>
- *
+ *
* <methods.c>
- *
+ *
* Misc device node methods
*
* Copyright (C) 2004 Greg Watson
- *
+ *
* Based on MOL specific code which is
- *
+ *
* Copyright (C) 2003, 2004 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#include "openbios/config.h"
@@ -38,7 +38,7 @@
int physbase = POP();
int s=0x1000, size = (int)of_rtas_end - (int)of_rtas_start;
ulong virt;
-
+
while( s < size )
s += 0x1000;
virt = ofmem_claim_virt( 0, s, 0x1000 );
@@ -74,7 +74,7 @@
strncpy_nopad( s, addr, len );
s[len]=0;
-
+
printk( "%s", s );
//vfd_draw_str( s );
free( s );
@@ -137,7 +137,7 @@
/* ( -- ) */
static void
-ciface_quiesce( ulong args[], ulong ret[] )
+ciface_quiesce( ulong args[], ulong ret[] )
{
#if 0
ulong msr;
@@ -151,12 +151,12 @@
/* ( -- ms ) */
static void
-ciface_milliseconds( ulong args[], ulong ret[] )
+ciface_milliseconds( ulong args[], ulong ret[] )
{
extern unsigned long get_timer_freq();
static ulong mticks=0, usecs=0;
ulong t;
-
+
asm volatile("mftb %0" : "=r" (t) : );
if( mticks )
usecs += get_timer_freq() / 1000000 * ( t-mticks );
@@ -189,7 +189,7 @@
int size = POP();
int phys = POP();
int ret = ofmem_claim_phys( phys, size, align );
-
+
if( ret == -1 ) {
printk("MEM: claim failure\n");
throw( -13 );
@@ -230,7 +230,7 @@
}
/* ( phys virt size mode -- [ret???] ) */
-static void
+static void
mmu_map( void )
{
int mode = POP();
@@ -238,7 +238,7 @@
int virt = POP();
int phys = POP();
int ret;
-
+
/* printk("mmu_map: %x %x %x %x\n", phys, virt, size, mode ); */
ret = ofmem_map( phys, virt, size, mode );
Modified: openbios-devel/arch/ppc/briq/tree.c
===================================================================
--- openbios-devel/arch/ppc/briq/tree.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/ppc/briq/tree.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2004/08/28 18:38:22 greg>
* Time-stamp: <2004/08/28 18:38:22 greg>
- *
+ *
* <tree.c>
- *
+ *
* device tree setup
- *
+ *
* Copyright (C) 2004 Greg Watson
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#include "openbios/config.h"
Modified: openbios-devel/arch/ppc/briq/vfd.c
===================================================================
--- openbios-devel/arch/ppc/briq/vfd.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/ppc/briq/vfd.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2004/08/28 17:29:43 greg>
* Time-stamp: <2004/08/28 17:29:43 greg>
- *
+ *
* <vfd.c>
- *
+ *
* Simple text console
- *
+ *
* Copyright (C) 2004 Greg Watson
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation
- *
+ *
*/
#include "openbios/config.h"
@@ -21,14 +21,14 @@
static int vfd_is_open;
static int
-vfd_init( void )
+vfd_init( void )
{
vfd_is_open = 1;
return 0;
}
void
-vfd_close( void )
+vfd_close( void )
{
}
Modified: openbios-devel/arch/ppc/kernel.c
===================================================================
--- openbios-devel/arch/ppc/kernel.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/ppc/kernel.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,20 +1,20 @@
-/*
+/*
* Creation Date: <2003/10/25 14:07:17 samuel>
* Time-stamp: <2004/08/28 17:48:19 stepan>
- *
+ *
* <kernel.c>
- *
+ *
* Copyright (C) 2003, 2004 Samuel Rydh (samuel at ibrium.se)
* Copyright (C) 2003, 2004 Stefan Reinauer
- *
+ *
* Based upon unix.c (from OpenBIOS):
*
* Copyright (C) 2003 Patrick Mauritz, Stefan Reinauer
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#include "openbios/config.h"
@@ -46,7 +46,7 @@
printk("panic: segmentation violation at %x\n", (int)segv_addr);
printk("dict=0x%x here=0x%x(dict+0x%x) pc=0x%x(dict+0x%x)\n",
- (int)dict, (int)(dict + dicthead), dicthead,
+ (int)dict, (int)(dict + dicthead), dicthead,
PC, PC - (ucell) dict);
printk("dstackcnt=%d rstackcnt=%d instruction=%x\n",
dstackcnt, rstackcnt, addr);
@@ -60,7 +60,7 @@
return -1;
}
-/*
+/*
* allocate memory and prepare engine for memory management.
*/
Modified: openbios-devel/arch/ppc/kernel.h
===================================================================
--- openbios-devel/arch/ppc/kernel.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/ppc/kernel.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,15 +1,15 @@
-/*
+/*
* Creation Date: <2004/08/28 17:50:12 stepan>
* Time-stamp: <2004/08/28 17:50:12 stepan>
- *
+ *
* <kernel.h>
- *
+ *
* Copyright (C) 2004 Stefan Reinauer
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#ifndef __KERNEL_H__
Modified: openbios-devel/arch/ppc/misc.S
===================================================================
--- openbios-devel/arch/ppc/misc.S 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/ppc/misc.S 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,11 +1,11 @@
-/*
+/*
* Creation Date: <2002/10/20 15:54:50 samuel>
* Time-stamp: <2002/10/20 15:57:21 samuel>
- *
+ *
* <misc.S>
- *
+ *
* Low-level stuff
- *
+ *
* Copyright (C) 2002, 2003 Samuel Rydh (samuel at ibrium.se)
*
* Based upon misc.S from the the linux kernel with the following
@@ -13,11 +13,11 @@
*
* Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org),
* Cort Dougan (cort at cs.nmt.edu), Paul Mackerras
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation
- *
+ *
*/
#include "asm/asmdefs.h"
@@ -26,7 +26,7 @@
/*
* Extended precision shifts.
- *
+ *
* Updated to be valid for shift counts from 0 to 63 inclusive.
* -- Gabriel
*
@@ -34,12 +34,12 @@
* R5 has shift count
* result in R3/R4
*
- * ashrdi3: arithmetic right shift (sign propagation)
- * lshrdi3: logical right shift
+ * ashrdi3: arithmetic right shift (sign propagation)
+ * lshrdi3: logical right shift
* ashldi3: left shift
*/
-GLOBL(__ashrdi3):
- subfic r6,r5,32
+GLOBL(__ashrdi3):
+ subfic r6,r5,32
srw r4,r4,r5 # LSW = count > 31 ? 0 : LSW >> count
addi r7,r5,32 # could be xori, or addi with -32
slw r6,r3,r6 # t1 = count > 31 ? 0 : MSW << (32-count)
@@ -51,8 +51,8 @@
or r4,r4,r7 # LSW |= t2
blr
-GLOBL(__ashldi3):
- subfic r6,r5,32
+GLOBL(__ashldi3):
+ subfic r6,r5,32
slw r3,r3,r5 # MSW = count > 31 ? 0 : MSW << count
addi r7,r5,32 # could be xori, or addi with -32
srw r6,r4,r6 # t1 = count > 31 ? 0 : LSW >> (32-count)
@@ -62,14 +62,14 @@
or r3,r3,r7 # MSW |= t2
blr
-GLOBL(__lshrdi3):
- subfic r6,r5,32
+GLOBL(__lshrdi3):
+ subfic r6,r5,32
srw r4,r4,r5 # LSW = count > 31 ? 0 : LSW >> count
addi r7,r5,32 # could be xori, or addi with -32
slw r6,r3,r6 # t1 = count > 31 ? 0 : MSW << (32-count)
srw r7,r3,r7 # t2 = count < 32 ? 0 : MSW >> (count-32)
or r4,r4,r6 # LSW |= t1
srw r3,r3,r5 # MSW = MSW >> count
- or r4,r4,r7 # LSW |= t2
+ or r4,r4,r7 # LSW |= t2
blr
-
+
Modified: openbios-devel/arch/ppc/mmutypes.h
===================================================================
--- openbios-devel/arch/ppc/mmutypes.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/ppc/mmutypes.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,19 +1,19 @@
-/*
+/*
* Creation Date: <2002/01/13 13:53:14 samuel>
* Time-stamp: <2002/01/27 19:56:11 samuel>
- *
+ *
* <mmutypes.h>
- *
+ *
* MMU definitions
- *
+ *
* Most of these declarations originate from the Linux Kernel
*
* Copyright (C) 2002 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation
- *
+ *
*/
#ifndef _H_MMUTYPES
Modified: openbios-devel/arch/ppc/mol/console.c
===================================================================
--- openbios-devel/arch/ppc/mol/console.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/ppc/mol/console.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,18 +1,18 @@
-/*
+/*
* Creation Date: <2002/10/29 18:59:05 samuel>
* Time-stamp: <2003/12/28 22:51:11 samuel>
- *
+ *
* <console.c>
- *
+ *
* Simple text console
- *
+ *
* Copyright (C) 2002, 2003, 2004 Samuel Rydh (samuel at ibrium.se)
* Copyright (C) 2005 Stefan Reinauer <stepan at openbios.org>
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation
- *
+ *
*/
#include "openbios/config.h"
Modified: openbios-devel/arch/ppc/mol/init.c
===================================================================
--- openbios-devel/arch/ppc/mol/init.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/ppc/mol/init.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,18 +1,18 @@
-/*
+/*
* Creation Date: <1999/11/16 00:49:26 samuel>
* Time-stamp: <2004/04/12 16:26:50 samuel>
- *
+ *
* <init.c>
- *
+ *
* Initialization
- *
- * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Samuel & David Rydh
+ *
+ * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Samuel & David Rydh
# (samuel at ibrium.se, dary at lindesign.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation
- *
+ *
*/
#include "openbios/config.h"
@@ -58,7 +58,7 @@
printk("\n");
printk("=============================================================\n");
printk("OpenBIOS %s [%s]\n", OPENBIOS_RELEASE, OPENBIOS_BUILD_DATE );
-
+
ofmem_init();
initialize_forth();
/* won't return */
@@ -81,7 +81,7 @@
{
mol_phandle_t ph;
int autoboot;
-
+
devtree_init();
node_methods_init();
nvram_init("/pci/mac-io/nvram");
Modified: openbios-devel/arch/ppc/mol/kernel.c
===================================================================
--- openbios-devel/arch/ppc/mol/kernel.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/ppc/mol/kernel.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,15 +1,15 @@
-/*
+/*
* Creation Date: <2004/08/28 18:03:25 stepan>
* Time-stamp: <2004/08/28 18:03:25 stepan>
- *
+ *
* <mol/kernel.c>
- *
+ *
* Copyright (C) 2004 Stefan Reinauer
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#include "mol-dict.h"
Modified: openbios-devel/arch/ppc/mol/main.c
===================================================================
--- openbios-devel/arch/ppc/mol/main.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/ppc/mol/main.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2002/10/02 22:24:24 samuel>
* Time-stamp: <2004/03/27 01:57:55 samuel>
- *
+ *
* <main.c>
- *
- *
- *
+ *
+ *
+ *
* Copyright (C) 2002, 2003, 2004 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation
- *
+ *
*/
@@ -71,7 +71,7 @@
s = MIN( phdr[i].p_filesz, phdr[i].p_memsz );
seek_io( fd, elf_offs + phdr[i].p_offset );
- /* printk("filesz: %08lX memsz: %08lX p_offset: %08lX p_vaddr %08lX\n",
+ /* printk("filesz: %08lX memsz: %08lX p_offset: %08lX p_vaddr %08lX\n",
phdr[i].p_filesz, phdr[i].p_memsz, phdr[i].p_offset,
phdr[i].p_vaddr ); */
@@ -94,7 +94,7 @@
}
flush_icache_range( addr, addr+s );
- /* printk("ELF ROM-section loaded at %08lX (size %08lX)\n",
+ /* printk("ELF ROM-section loaded at %08lX (size %08lX)\n",
(ulong)phdr[i].p_vaddr, (ulong)phdr[i].p_memsz );*/
}
free( phdr );
@@ -157,7 +157,7 @@
nw_dec_calibration = OSI_MticksToUsecs(0xfffff*47)/60;
memcpy( start + s, timer_calib_start, timer_calib_end - timer_calib_start );
- printk("Timer calibration fix: %d.%02d MHz [%ld]\n",
+ printk("Timer calibration fix: %d.%02d MHz [%ld]\n",
hz/1000, (hz/10)%100, nw_dec_calibration );
break;
}
@@ -170,20 +170,20 @@
int lszz_offs, lszz_size;
ulong entry, data[2];
phandle_t ph;
-
+
lszz_offs = load_elf_rom( &entry, fd );
seek_io( fd, -1 );
lszz_size = tell(fd) - lszz_offs;
seek_io( fd, lszz_offs );
- /* printk("Compressed ROM image: offset %08X, size %08X loaded at %08x\n",
+ /* printk("Compressed ROM image: offset %08X, size %08X loaded at %08x\n",
lszz_offs, lszz_size, ROM_BASE ); */
if( ofmem_claim(ROM_BASE, lszz_size, 0) == -1 )
fatal_error("Claim failure (lszz)!\n");
-
+
read_io( fd, (char*)ROM_BASE, lszz_size );
-
+
/* Fix the /rom/macos/AAPL,toolbox-image,lzss property (phys, size) */
#if 0
if( (ph=prom_create_node("/rom/macos/")) == -1 )
@@ -195,7 +195,7 @@
data[1] = lszz_size;
set_property( ph, "AAPL,toolbox-image,lzss", (char*)data, sizeof(data) );
- /* The 7.8 rom (MacOS 9.2) uses AAPL,toolbox-parcels instead of
+ /* The 7.8 rom (MacOS 9.2) uses AAPL,toolbox-parcels instead of
* AAPL,toolbox-image,lzss. It probably doesn't hurt to have it
* always present (we don't have an easy way to determine ROM version...)
*/
@@ -208,7 +208,7 @@
{
char *s, buf[128];
int found = 0;
-
+
if( fast ) {
int ind;
found = !reopen( fd, "\\\\:tbxi" );
@@ -233,8 +233,8 @@
encode_bootpath( const char *spec, const char *args )
{
phandle_t chosen_ph = find_dev("/chosen");
- set_property( chosen_ph, "bootpath", spec, strlen(spec)+1 );
- set_property( chosen_ph, "bootargs", args, strlen(args)+1 );
+ set_property( chosen_ph, "bootpath", spec, strlen(spec)+1 );
+ set_property( chosen_ph, "bootargs", args, strlen(args)+1 );
}
static char *
Modified: openbios-devel/arch/ppc/mol/methods.c
===================================================================
--- openbios-devel/arch/ppc/mol/methods.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/ppc/mol/methods.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2003/10/18 13:24:29 samuel>
* Time-stamp: <2004/03/27 02:00:30 samuel>
- *
+ *
* <methods.c>
- *
+ *
* Misc device node methods
- *
+ *
* Copyright (C) 2003, 2004 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#include "openbios/config.h"
@@ -30,7 +30,7 @@
DECLARE_NODE( powermgt, INSTALL_OPEN, 0, "/pci/pci-bridge/mac-io/power-mgt" );
/* ( -- ) */
-static void
+static void
set_hybernot_flag( void )
{
}
@@ -53,7 +53,7 @@
int physbase = POP();
int s=0x1000, size = (int)of_rtas_end - (int)of_rtas_start;
ulong virt;
-
+
while( s < size )
s += 0x1000;
virt = ofmem_claim_virt( 0, s, 0x1000 );
@@ -89,7 +89,7 @@
strncpy_nopad( s, addr, len );
s[len]=0;
-
+
/* printk( "%s", s ); */
console_draw_str( s );
free( s );
@@ -159,7 +159,7 @@
char keytable[32];
} kbd_state_t;
-static const uchar adb_ascii_table[128] =
+static const uchar adb_ascii_table[128] =
/* 0x00 */ "asdfhgzxcv`bqwer"
/* 0x10 */ "yt123465=97-80]o"
/* 0x20 */ "u[ip\nlj'k;\\,/nm."
@@ -169,7 +169,7 @@
/* 0x60 */ " "
/* 0x70 */ " ";
-static const uchar adb_shift_table[128] =
+static const uchar adb_shift_table[128] =
/* 0x00 */ "ASDFHGZXCV~BQWER"
/* 0x10 */ "YT!@#$^%+(&_*)}O"
/* 0x20 */ "U{IP\nLJ\"K:|<?NM>"
@@ -179,7 +179,7 @@
/* 0x60 */ " "
/* 0x70 */ " ";
-DECLARE_NODE( kbd, INSTALL_OPEN, sizeof(kbd_state_t),
+DECLARE_NODE( kbd, INSTALL_OPEN, sizeof(kbd_state_t),
"/psuedo-hid/keyboard",
"/mol/mol-keyboard",
"/mol/keyboard"
@@ -203,7 +203,7 @@
int ret=0, len = POP();
char *p = (char*)POP();
int key;
-
+
if( !p || !len ) {
PUSH( -1 );
return;
@@ -214,12 +214,12 @@
ks->save_key = 0;
RET( 1 );
}
- OSI_USleep(1); /* be nice */
+ OSI_USleep(1); /* be nice */
for( ; (key=OSI_GetAdbKey()) >= 0 ; ) {
int code = (key & 0x7f);
int down = !(key & 0x80);
-
+
if( code == 0x36 /* ctrl */ ) {
ks->cntrl = down;
continue;
@@ -273,7 +273,7 @@
/* ( -- ) */
static void
-ciface_quiesce( ulong args[], ulong ret[] )
+ciface_quiesce( ulong args[], ulong ret[] )
{
#if 0
ulong msr;
@@ -290,11 +290,11 @@
/* ( -- ms ) */
static void
-ciface_milliseconds( ulong args[], ulong ret[] )
+ciface_milliseconds( ulong args[], ulong ret[] )
{
static ulong mticks=0, usecs=0;
ulong t;
-
+
asm volatile("mftb %0" : "=r" (t) : );
if( mticks )
usecs += OSI_MticksToUsecs( t-mticks );
@@ -327,7 +327,7 @@
int size = POP();
int phys = POP();
int ret = ofmem_claim_phys( phys, size, align );
-
+
if( ret == -1 ) {
printk("MEM: claim failure\n");
throw( -13 );
@@ -368,7 +368,7 @@
}
/* ( phys virt size mode -- [ret???] ) */
-static void
+static void
mmu_map( void )
{
int mode = POP();
@@ -376,7 +376,7 @@
int virt = POP();
int phys = POP();
int ret;
-
+
/* printk("mmu_map: %x %x %x %x\n", phys, virt, size, mode ); */
ret = ofmem_map( phys, virt, size, mode );
Modified: openbios-devel/arch/ppc/mol/mol.c
===================================================================
--- openbios-devel/arch/ppc/mol/mol.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/ppc/mol/mol.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2003/12/19 18:46:21 samuel>
* Time-stamp: <2004/04/12 16:27:12 samuel>
- *
+ *
* <mol.c>
- *
- *
- *
+ *
+ *
+ *
* Copyright (C) 2003, 2004 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#include "openbios/config.h"
@@ -96,7 +96,7 @@
{
if( !tty_avail() )
return 0;
-
+
if( ttychar < 0 )
ttychar = OSI_TTYGetc();
if( ttychar < 0 )
Modified: openbios-devel/arch/ppc/mol/mol.h
===================================================================
--- openbios-devel/arch/ppc/mol/mol.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/ppc/mol/mol.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2003/12/20 00:20:12 samuel>
* Time-stamp: <2004/03/27 01:52:50 samuel>
- *
+ *
* <mol.h>
- *
- *
- *
+ *
+ *
+ *
* Copyright (C) 2003, 2004 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#ifndef _H_MOL
Modified: openbios-devel/arch/ppc/mol/osi-blk.c
===================================================================
--- openbios-devel/arch/ppc/mol/osi-blk.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/ppc/mol/osi-blk.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2003/12/07 19:08:33 samuel>
* Time-stamp: <2004/01/07 19:38:36 samuel>
- *
+ *
* <osi-blk.c>
- *
+ *
* OSI-block interface
- *
+ *
* Copyright (C) 2003, 2004 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#include "openbios/config.h"
@@ -64,7 +64,7 @@
int i, n = POP();
int blk = POP();
char *dest = (char*)POP();
-
+
/* printk("osiblk_read_blocks %x block=%d n=%d\n", (int)dest, blk, n ); */
for( i=0; i<n; ) {
Modified: openbios-devel/arch/ppc/mol/osi-scsi.c
===================================================================
--- openbios-devel/arch/ppc/mol/osi-scsi.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/ppc/mol/osi-scsi.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2003/12/11 21:23:54 samuel>
* Time-stamp: <2004/01/07 19:38:45 samuel>
- *
+ *
* <osi-scsi.c>
- *
+ *
* SCSI device node
- *
+ *
* Copyright (C) 2003, 2004 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#include "openbios/config.h"
@@ -105,7 +105,7 @@
char *dest = (char*)POP();
unsigned char cmd[10];
int len = nblks * sd->info->blocksize;
-
+
memset( dest, 0, len );
/* printk("READ: blk: %d length %d\n", blk, len ); */
@@ -190,7 +190,7 @@
continue;
}
break;
- }
+ }
info->valid = 1;
return 0;
Modified: openbios-devel/arch/ppc/mol/prom.c
===================================================================
--- openbios-devel/arch/ppc/mol/prom.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/ppc/mol/prom.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2002/10/03 20:55:02 samuel>
* Time-stamp: <2002/10/29 13:00:23 samuel>
- *
+ *
* <prom.c>
- *
+ *
* oftree interface
- *
+ *
* Copyright (C) 2002, 2003 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation
- *
+ *
*/
#include "openbios/config.h"
@@ -69,7 +69,7 @@
/* ret: prop len or -1 if error */
int
-prom_get_prop_by_path( const char *path, const char *name, char *buf, long buflen )
+prom_get_prop_by_path( const char *path, const char *name, char *buf, long buflen )
{
mol_phandle_t ph = prom_find_device(path);
return (ph != -1)? prom_get_prop( ph, name, buf, buflen) : -1;
@@ -105,12 +105,12 @@
if( !path )
return -1;
-
+
if( (ph=OSI_PromPathIface( kPromFindDevice, path )) != -1 )
return ph;
else if( path[0] == '/' )
return -1;
-
+
/* might be an alias */
if( !(p=strpbrk(path, "@:/")) )
p = (char*)path + strlen(path);
@@ -126,7 +126,7 @@
printk("Error: aliases must be absolute!\n");
return -1;
}
- ph = OSI_PromPathIface( kPromFindDevice, buf2 );
+ ph = OSI_PromPathIface( kPromFindDevice, buf2 );
return ph;
}
Modified: openbios-devel/arch/ppc/mol/prom.h
===================================================================
--- openbios-devel/arch/ppc/mol/prom.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/ppc/mol/prom.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2002/10/03 21:07:27 samuel>
* Time-stamp: <2003/10/22 22:45:26 samuel>
- *
+ *
* <prom.h>
- *
+ *
* device tree interface
- *
+ *
* Copyright (C) 2002, 2003 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation
- *
+ *
*/
#ifndef _H_PROM
Modified: openbios-devel/arch/ppc/mol/pseudodisk.c
===================================================================
--- openbios-devel/arch/ppc/mol/pseudodisk.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/ppc/mol/pseudodisk.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2003/11/26 16:55:47 samuel>
* Time-stamp: <2004/01/07 19:41:54 samuel>
- *
+ *
* <pseudodisk.c>
- *
+ *
* pseudodisk (contains files exported from linux)
- *
+ *
* Copyright (C) 2003, 2004 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#include "openbios/config.h"
@@ -77,7 +77,7 @@
int len = POP();
char *dest = (char*)POP();
int cnt;
-
+
if( pb->fd < 0 ) {
memset( dest, 0, len );
PUSH(len);
@@ -119,9 +119,9 @@
if( pos_lo == -1 )
pos_lo = pb->size;
}
-
+
pb->seekpos = pos_lo;
-
+
PUSH(0); /* ??? */
}
Modified: openbios-devel/arch/ppc/mol/tree.c
===================================================================
--- openbios-devel/arch/ppc/mol/tree.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/ppc/mol/tree.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2003/11/18 14:55:05 samuel>
* Time-stamp: <2004/03/27 02:03:55 samuel>
- *
+ *
* <tree.c>
- *
+ *
* device tree setup
- *
+ *
* Copyright (C) 2003, 2004 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#include "openbios/config.h"
@@ -30,7 +30,7 @@
char name[40], path[80];
int exists;
phandle_t ph;
-
+
if( !molph )
return;
@@ -73,7 +73,7 @@
set_int_property( ph, "MOL,phandle", molph );
copy_node( prom_child(molph) );
-
+
if( !exists )
fword("finish-device");
else
@@ -128,7 +128,7 @@
if( (map=(int*)get_property(ph, "interrupt-map", &len)) ) {
int i, acells = get_int_property(ph, "#address-cells", NULL);
int icells = get_int_property(ph, "#interrupt-cells", NULL);
-
+
len /= sizeof(int);
for( i=0; i<len; i++ ) {
phandle_t ch_ph;
@@ -147,7 +147,7 @@
}
}
/* delete MOL,phandle properties */
- for( ph=0; (ph=dt_iterate(ph)) ; ) {
+ for( ph=0; (ph=dt_iterate(ph)) ; ) {
push_str("MOL,phandle");
PUSH_ph(ph);
fword("(delete-property)");
Modified: openbios-devel/arch/ppc/ofmem.c
===================================================================
--- openbios-devel/arch/ppc/ofmem.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/ppc/ofmem.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,18 +1,18 @@
-/*
+/*
* Creation Date: <1999/11/07 19:02:11 samuel>
* Time-stamp: <2004/01/07 19:42:36 samuel>
- *
+ *
* <ofmem.c>
- *
+ *
* OF Memory manager
- *
+ *
* Copyright (C) 1999-2004 Samuel Rydh (samuel at ibrium.se)
* Copyright (C) 2004 Stefan Reinauer
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation
- *
+ *
*/
/* TODO: Clean up MOLisms in a decent way */
@@ -44,14 +44,14 @@
*
* Physical
*
- * 0x00000000 Exception vectors
+ * 0x00000000 Exception vectors
* 0x00004000 Free space
* 0x01e00000 Open Firmware (us)
* 0x01f00000 OF allocations
* 0x01ff0000 PTE Hash
* 0x02000000- Free space
*
- * Allocations grow downwards from 0x01e00000
+ * Allocations grow downwards from 0x01e00000
*
****************************************************************/
@@ -104,7 +104,7 @@
/************************************************************************/
void *
-malloc( int size )
+malloc( int size )
{
alloc_desc_t *d, **pp;
char *ret;
@@ -114,11 +114,11 @@
if( !ofmem.next_malloc )
ofmem.next_malloc = (char*)OF_MALLOC_BASE;
-
+
if( size & 3 )
size += 4 - (size & 3);
size += sizeof(alloc_desc_t);
-
+
/* look in the freelist */
for( pp=&ofmem.mfree; *pp && (**pp).size < size; pp = &(**pp).next )
;
@@ -154,7 +154,7 @@
/* it is legal to free NULL pointers (size zero allocations) */
if( !ptr )
return;
-
+
d = (alloc_desc_t*)(ptr - sizeof(alloc_desc_t));
d->next = ofmem.mfree;
@@ -166,11 +166,11 @@
}
void *
-realloc( void *ptr, size_t size )
+realloc( void *ptr, size_t size )
{
alloc_desc_t *d = (alloc_desc_t*)(ptr - sizeof(alloc_desc_t));
char *p;
-
+
if( !ptr )
return malloc( size );
if( !size ) {
@@ -199,13 +199,13 @@
}
static void
-print_phys_range()
+print_phys_range()
{
print_range( ofmem.phys_range, "phys" );
}
static void
-print_virt_range()
+print_virt_range()
{
print_range( ofmem.virt_range, "virt" );
}
@@ -259,7 +259,7 @@
add_entry_( ulong ea, ulong size, range_t **r )
{
range_t *nr;
-
+
for( ; *r && (**r).start < ea; r=&(**r).next )
;
nr = (range_t*)malloc( sizeof(range_t) );
@@ -312,17 +312,17 @@
{
ulong base = min;
range_t *r2;
-
+
if( (align & (align-1)) ) {
printk("bad alignment %ld\n", align);
align = 0x1000;
}
if( !align )
align = 0x1000;
-
+
base = reverse ? max - size : min;
r2 = reverse ? NULL : r;
-
+
for( ;; ) {
if( !reverse ) {
base = (base + align - 1) & ~(align-1);
@@ -395,7 +395,7 @@
add_entry( virt, size, &ofmem.virt_range );
return virt;
}
-
+
virt = find_area( align, size, ofmem.virt_range, min, max, reverse );
if( virt == (ulong)-1 ) {
printk("ofmem_claim_virt - out of space\n");
@@ -451,7 +451,7 @@
}
if( size & 0xfff )
size = (size + 0xfff) & ~0xfff;
-
+
/* printk("...free memory found... phys: %08lX, virt: %08lX, size %lX\n", phys, virt, size ); */
ofmem_map( phys, virt, size, def_memmode(phys) );
return virt + offs;
@@ -466,7 +466,7 @@
split_trans( ulong virt )
{
translation_t *t, *t2;
-
+
for( t=ofmem.trans; t; t=t->next ) {
if( virt > t->virt && virt < t->virt + t->size-1 ) {
t2 = (translation_t*)malloc( sizeof(translation_t) );
@@ -485,7 +485,7 @@
map_page_range( ulong virt, ulong phys, ulong size, int mode )
{
translation_t *t, **tt;
-
+
split_trans( virt );
split_trans( virt + size );
@@ -523,9 +523,9 @@
int
ofmem_map( ulong phys, ulong virt, ulong size, int mode )
{
- /* printk("+ofmem_map: %08lX --> %08lX (size %08lX, mode 0x%02X)\n",
+ /* printk("+ofmem_map: %08lX --> %08lX (size %08lX, mode 0x%02X)\n",
virt, phys, size, mode ); */
-
+
if( (phys & 0xfff) || (virt & 0xfff) || (size & 0xfff) ) {
printk("ofmem_map: Bad parameters (%08lX %08lX %08lX)\n", phys, virt, size );
phys &= ~0xfff;
@@ -548,7 +548,7 @@
ofmem_translate( ulong virt, ulong *mode )
{
translation_t *t;
-
+
for( t=ofmem.trans; t && t->virt <= virt ; t=t->next ) {
ulong offs;
if( t->virt + t->size - 1 < virt )
@@ -611,7 +611,7 @@
ulong *upte, cmp, hash1;
int i, vsid, found;
mPTE_t *pp;
-
+
vsid = (ea>>28) + SEGR_BASE;
cmp = BIT(0) | (vsid << 7) | ((ea & 0x0fffffff) >> 22);
@@ -621,7 +621,7 @@
pp = (mPTE_t*)(HASH_BASE + (hash1 << 6));
upte = (ulong*)pp;
-
+
/* replace old translation */
for( found=0, i=0; !found && i<8; i++ )
if( cmp == upte[i*2] )
@@ -651,7 +651,7 @@
int mode;
asm volatile("mfdar %0" : "=r" (dar) : );
- asm volatile("mfdsisr %0" : "=r" (dsisr) : );
+ asm volatile("mfdsisr %0" : "=r" (dsisr) : );
//printk("dsi-exception @ %08lx <%08lx>\n", dar, dsisr );
hash_page( dar, ea_to_phys(dar, &mode), mode );
}
@@ -663,7 +663,7 @@
int mode;
asm volatile("mfsrr0 %0" : "=r" (nip) : );
- asm volatile("mfsrr1 %0" : "=r" (srr1) : );
+ asm volatile("mfsrr1 %0" : "=r" (srr1) : );
//printk("isi-exception @ %08lx <%08lx>\n", nip, srr1 );
hash_page( nip, ea_to_phys(nip, &mode), mode );
Modified: openbios-devel/arch/ppc/osi.h
===================================================================
--- openbios-devel/arch/ppc/osi.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/ppc/osi.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,19 +1,19 @@
-/*
+/*
* Creation Date: <1999/03/18 03:19:43 samuel>
* Time-stamp: <2003/12/26 16:58:19 samuel>
- *
+ *
* <os_interface.h>
- *
+ *
* This file includes definitions for drivers
* running in the "emulated" OS. (Mainly the 'sc'
* mechanism of communicating)
- *
+ *
* Copyright (C) 1999, 2000, 2001, 2002, 2003 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation
- *
+ *
*/
#ifndef _H_OSI
Modified: openbios-devel/arch/ppc/osi_calls.h
===================================================================
--- openbios-devel/arch/ppc/osi_calls.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/ppc/osi_calls.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2002/06/16 01:40:57 samuel>
* Time-stamp: <2003/12/26 17:02:09 samuel>
- *
+ *
* <osi_calls.h>
- *
+ *
* OSI call inlines
- *
+ *
* Copyright (C) 2002, 2003 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation
- *
+ *
*/
#ifndef _H_OSI_CALLS
@@ -43,7 +43,7 @@
register unsigned long dreg(r3); \
register unsigned long dreg(r4); \
register unsigned long dreg(r5) \
- ,##input_regs ;
+ ,##input_regs ;
#define _oc_syscall( number, extra_ret_regs... ) \
__oc_r3 = OSI_SC_MAGIC_R3; \
@@ -90,7 +90,7 @@
,## inputregs \
: "memory", \
"r4", "r5", "r6", "r7", "r8", "r9" );
-#endif
+#endif
/************************************************************************/
@@ -339,14 +339,14 @@
/* NVRAM */
static inline _osi_call0( int, OSI_NVRamSize, OSI_NVRAM_SIZE );
static inline _osi_call1( int, OSI_ReadNVRamByte, OSI_READ_NVRAM_BYTE, int, offs );
-static inline _osi_call2( int, OSI_WriteNVRamByte, OSI_WRITE_NVRAM_BYTE, int, offs,
+static inline _osi_call2( int, OSI_WriteNVRamByte, OSI_WRITE_NVRAM_BYTE, int, offs,
unsigned char, ch );
/* keyboard stuff */
static inline _osi_call0_w1( int, OSI_GetAdbKey2, OSI_GET_ADB_KEY, int *, raw_key );
static inline _osi_call1( int, OSI_KbdCntrl, OSI_KBD_CNTRL, int, cmd );
-static inline int OSI_GetAdbKey( void )
+static inline int OSI_GetAdbKey( void )
{ int dummy_raw_key; return OSI_GetAdbKey2( &dummy_raw_key ); }
static inline _osi_call2( int, OSI_MapAdbKey, OSI_MAP_ADB_KEY, int, keycode, int, adbkey )
static inline _osi_call1( int, OSI_KeycodeToAdb, OSI_KEYCODE_TO_ADB, int, keycode );
@@ -387,12 +387,12 @@
static inline _osi_call2_w4( int, OSI_ABlkDiskInfo, OSI_ABLK_DISK_INFO, int, channel, int, unit,
struct ablk_disk_info *, retinfo );
static inline _osi_call1( int, OSI_ABlkKick, OSI_ABLK_KICK, int, channel );
-static inline _osi_call1_w1w1w1( int, OSI_ABlkIRQAck, OSI_ABLK_IRQ_ACK, int, channel, int *, req_count,
+static inline _osi_call1_w1w1w1( int, OSI_ABlkIRQAck, OSI_ABLK_IRQ_ACK, int, channel, int *, req_count,
int *, active, int *, events );
static inline _osi_call3( int, OSI_ABlkRingSetup, OSI_ABLK_RING_SETUP, int, channel, int, mphys, int, n_el );
static inline _osi_call2( int, OSI_ABlkCntrl, OSI_ABLK_CNTRL, int, channel, int, cmd );
static inline _osi_call3( int, OSI_ABlkCntrl1, OSI_ABLK_CNTRL, int, channel, int, cmd, int, param );
-static inline _osi_call5( int, OSI_ABlkSyncRead, OSI_ABLK_SYNC_READ, int, channel, int, unit,
+static inline _osi_call5( int, OSI_ABlkSyncRead, OSI_ABLK_SYNC_READ, int, channel, int, unit,
int, blk, ulong, mphys, int, size );
static inline _osi_call5( int, OSI_ABlkSyncWrite, OSI_ABLK_SYNC_WRITE, int, channel, int, unit,
int, blk, ulong, mphys, int, size );
@@ -403,7 +403,7 @@
/* enet2 */
static inline _osi_call0( int, OSI_Enet2Open, OSI_ENET2_OPEN );
static inline _osi_call0( int, OSI_Enet2Close, OSI_ENET2_CLOSE );
-static inline _osi_call3( int, OSI_Enet2RingSetup, OSI_ENET2_RING_SETUP, int, which_ring,
+static inline _osi_call3( int, OSI_Enet2RingSetup, OSI_ENET2_RING_SETUP, int, which_ring,
int, ring_mphys, int, n_el );
static inline _osi_call2( int, OSI_Enet2Cntrl1, OSI_ENET2_CNTRL, int, cmd, int, param );
static inline _osi_call1( int, OSI_Enet2Cntrl, OSI_ENET2_CNTRL, int, cmd );
@@ -411,7 +411,7 @@
static inline _osi_call0_w2( int, OSI_Enet2GetHWAddr__, OSI_ENET2_GET_HWADDR, ulong *, retbuf );
static inline int OSI_Enet2GetHWAddr( unsigned char *addr ) {
- int ret;
+ int ret;
ulong buf[2];
ret = OSI_Enet2GetHWAddr__( buf );
Modified: openbios-devel/arch/ppc/pearpc/init.c
===================================================================
--- openbios-devel/arch/ppc/pearpc/init.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/ppc/pearpc/init.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,23 +1,23 @@
-/*
+/*
* Creation Date: <2004/08/28 18:38:22 greg>
* Time-stamp: <2004/08/28 18:38:22 greg>
- *
+ *
* <init.c>
- *
+ *
* Initialization for pearpc
*
* Copyright (C) 2004 Greg Watson
* Copyright (C) 2005 Stefan Reinauer
*
* based on mol/init.c:
- *
- * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Samuel & David Rydh
+ *
+ * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Samuel & David Rydh
* (samuel at ibrium.se, dary at lindesign.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation
- *
+ *
*/
#include "openbios/config.h"
@@ -66,7 +66,7 @@
printk("\n");
printk("=============================================================\n");
printk("OpenBIOS %s [%s]\n", OPENBIOS_RELEASE, OPENBIOS_BUILD_DATE );
-
+
ofmem_init();
initialize_forth();
/* won't return */
@@ -91,7 +91,7 @@
phandle_t ph;
#endif
int autoboot;
-
+
devtree_init();
nvram_init("/pci/mac-io/nvram");
modules_init();
@@ -108,7 +108,7 @@
node_methods_init();
init_video();
-
+
#if USE_RTAS
if( !(ph=find_dev("/rtas")) )
printk("Warning: No /rtas node\n");
Modified: openbios-devel/arch/ppc/pearpc/kernel.c
===================================================================
--- openbios-devel/arch/ppc/pearpc/kernel.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/ppc/pearpc/kernel.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,15 +1,15 @@
-/*
+/*
* Creation Date: <2004/08/28 18:03:25 stepan>
* Time-stamp: <2004/08/28 18:03:25 stepan>
- *
+ *
* <pearpc/kernel.c>
- *
+ *
* Copyright (C) 2005 Stefan Reinauer
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#include "pearpc-dict.h"
Modified: openbios-devel/arch/ppc/pearpc/main.c
===================================================================
--- openbios-devel/arch/ppc/pearpc/main.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/ppc/pearpc/main.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,18 +1,18 @@
-/*
+/*
* Creation Date: <2004/08/28 18:38:22 greg>
* Time-stamp: <2004/08/28 18:38:22 greg>
- *
+ *
* <main.c>
- *
+ *
* Copyright (C) 2004 Greg Watson
- *
- * Based on MOL specific code which is
+ *
+ * Based on MOL specific code which is
* Copyright (C) 2002, 2003, 2004 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation
- *
+ *
*/
@@ -65,7 +65,7 @@
s = MIN( phdr[i].p_filesz, phdr[i].p_memsz );
seek_io( fd, elf_offs + phdr[i].p_offset );
- /* printk("filesz: %08lX memsz: %08lX p_offset: %08lX p_vaddr %08lX\n",
+ /* printk("filesz: %08lX memsz: %08lX p_offset: %08lX p_vaddr %08lX\n",
phdr[i].p_filesz, phdr[i].p_memsz, phdr[i].p_offset,
phdr[i].p_vaddr ); */
@@ -90,7 +90,7 @@
#endif
flush_icache_range( addr, addr+s );
- /*printk("ELF ROM-section loaded at %08lX (size %08lX)\n",
+ /*printk("ELF ROM-section loaded at %08lX (size %08lX)\n",
(ulong)phdr[i].p_vaddr, (ulong)phdr[i].p_memsz );*/
}
free( phdr );
@@ -102,8 +102,8 @@
encode_bootpath( const char *spec, const char *args )
{
phandle_t chosen_ph = find_dev("/chosen");
- set_property( chosen_ph, "bootpath", spec, strlen(spec)+1 );
- set_property( chosen_ph, "bootargs", args, strlen(args)+1 );
+ set_property( chosen_ph, "bootpath", spec, strlen(spec)+1 );
+ set_property( chosen_ph, "bootargs", args, strlen(args)+1 );
}
/************************************************************************/
Modified: openbios-devel/arch/ppc/pearpc/methods.c
===================================================================
--- openbios-devel/arch/ppc/pearpc/methods.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/ppc/pearpc/methods.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,21 +1,21 @@
-/*
+/*
* Creation Date: <2004/08/28 18:38:22 greg>
* Time-stamp: <2004/08/28 18:38:22 greg>
- *
+ *
* <methods.c>
- *
+ *
* Misc device node methods
*
* Copyright (C) 2004 Greg Watson
- *
+ *
* Based on MOL specific code which is
- *
+ *
* Copyright (C) 2003, 2004 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#include "openbios/config.h"
@@ -38,7 +38,7 @@
int physbase = POP();
int s=0x1000, size = (int)of_rtas_end - (int)of_rtas_start;
ulong virt;
-
+
while( s < size )
s += 0x1000;
virt = ofmem_claim_virt( 0, s, 0x1000 );
@@ -74,11 +74,11 @@
strncpy_nopad( s, addr, len );
s[len]=0;
-
+
printk( "%s", s );
//vfd_draw_str( s );
console_draw_str( s );
-
+
free( s );
PUSH( len );
@@ -139,7 +139,7 @@
/* ( -- ) */
static void
-ciface_quiesce( ulong args[], ulong ret[] )
+ciface_quiesce( ulong args[], ulong ret[] )
{
#if 0
ulong msr;
@@ -153,12 +153,12 @@
/* ( -- ms ) */
static void
-ciface_milliseconds( ulong args[], ulong ret[] )
+ciface_milliseconds( ulong args[], ulong ret[] )
{
extern unsigned long get_timer_freq();
static ulong mticks=0, usecs=0;
ulong t;
-
+
asm volatile("mftb %0" : "=r" (t) : );
if( mticks )
usecs += get_timer_freq() / 1000000 * ( t-mticks );
@@ -191,7 +191,7 @@
int size = POP();
int phys = POP();
int ret = ofmem_claim_phys( phys, size, align );
-
+
if( ret == -1 ) {
printk("MEM: claim failure\n");
throw( -13 );
@@ -232,7 +232,7 @@
}
/* ( phys virt size mode -- [ret???] ) */
-static void
+static void
mmu_map( void )
{
int mode = POP();
@@ -240,7 +240,7 @@
int virt = POP();
int phys = POP();
int ret;
-
+
/* printk("mmu_map: %x %x %x %x\n", phys, virt, size, mode ); */
ret = ofmem_map( phys, virt, size, mode );
Modified: openbios-devel/arch/ppc/pearpc/pearpc.c
===================================================================
--- openbios-devel/arch/ppc/pearpc/pearpc.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/ppc/pearpc/pearpc.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,19 +1,19 @@
-/*
+/*
* Creation Date: <2004/08/28 18:38:22 greg>
* Time-stamp: <2004/08/28 18:38:22 greg>
- *
+ *
* <pearpc.c>
- *
+ *
* Copyright (C) 2004, Greg Watson
- *
+ *
* derived from mol.c
*
* Copyright (C) 2003, 2004 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#include "openbios/config.h"
@@ -116,7 +116,7 @@
{
if( !tty_avail() )
return 0;
-
+
if( ttychar < 0 )
ttychar = inb(UART_BASE);
return (ttychar >= 0);
@@ -172,7 +172,7 @@
{
printk (" ");
}
- }
+ }
}
Modified: openbios-devel/arch/ppc/pearpc/pearpc.h
===================================================================
--- openbios-devel/arch/ppc/pearpc/pearpc.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/ppc/pearpc/pearpc.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,15 +1,15 @@
-/*
+/*
* Creation Date: <2004/08/28 17:50:12 stepan>
* Time-stamp: <2004/08/28 17:50:12 stepan>
- *
+ *
* <pearpc.h>
- *
+ *
* Copyright (C) 2005 Stefan Reinauer
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#ifndef _H_PEARPC
Modified: openbios-devel/arch/ppc/pearpc/tree.c
===================================================================
--- openbios-devel/arch/ppc/pearpc/tree.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/ppc/pearpc/tree.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2004/08/28 18:38:22 greg>
* Time-stamp: <2004/08/28 18:38:22 greg>
- *
+ *
* <tree.c>
- *
+ *
* device tree setup
- *
+ *
* Copyright (C) 2004 Greg Watson
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#include "openbios/config.h"
Modified: openbios-devel/arch/ppc/pearpc/vfd.c
===================================================================
--- openbios-devel/arch/ppc/pearpc/vfd.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/ppc/pearpc/vfd.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2004/08/28 17:29:43 greg>
* Time-stamp: <2004/08/28 17:29:43 greg>
- *
+ *
* <vfd.c>
- *
+ *
* Simple text console
- *
+ *
* Copyright (C) 2004 Greg Watson
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation
- *
+ *
*/
#include "openbios/config.h"
@@ -21,14 +21,14 @@
static int vfd_is_open;
static int
-vfd_init( void )
+vfd_init( void )
{
vfd_is_open = 1;
return 0;
}
void
-vfd_close( void )
+vfd_close( void )
{
}
Modified: openbios-devel/arch/ppc/start.S
===================================================================
--- openbios-devel/arch/ppc/start.S 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/ppc/start.S 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,23 +1,23 @@
-/*
+/*
* Creation Date: <2001/06/16 21:30:18 samuel>
* Time-stamp: <2003/04/04 16:32:06 samuel>
- *
+ *
* <init.S>
- *
+ *
* Asm glue for ELF images run inside MOL
- *
+ *
* Copyright (C) 2001, 2002, 2003 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation
- *
+ *
*/
#include "asm/asmdefs.h"
#include "asm/processor.h"
#include "osi.h"
-
+
/************************************************************************/
/* Macros */
/************************************************************************/
@@ -73,8 +73,8 @@
.space 32*1024 // 32 K exception stack
estack: .space 128
-
-
+
+
/************************************************************************/
/* entry */
/************************************************************************/
@@ -83,7 +83,7 @@
GLOBL(_start):
li r0,0
mtmsr r0
-
+
lis r1,HA(estack)
addi r1,r1,LO(estack)
mtsprg0 r1 // setup exception stack
@@ -122,7 +122,7 @@
/* According to IEEE 1275, PPC bindings:
- *
+ *
* MSR = FP, ME + (DR|IR)
* r1 = stack (32 K + 32 bytes link area above)
* r5 = clint interface handler
@@ -156,7 +156,7 @@
lwz r0,20(r1)
mtlr r0
addi r1,r1,16
- // XXX: should restore r12-r31 etc..
+ // XXX: should restore r12-r31 etc..
// we should not really come here though
blr
@@ -191,7 +191,7 @@
lwz r0,16(r1)
lwz r1,8(r1) // restore caller stack
blr
-
+
/* rtas glue (must be reloctable) */
GLOBL(of_rtas_start):
/* r3 = argument buffer, r4 = of_rtas_start */
@@ -276,12 +276,12 @@
mtctr r3
bctrl
b exception_return
-
+
ILLEGAL_VECTOR( 0x500 )
ILLEGAL_VECTOR( 0x600 )
ILLEGAL_VECTOR( 0x700 )
-VECTOR( 0x800, "FPU" ):
+VECTOR( 0x800, "FPU" ):
mtsprg1 r3
mfsrr1 r3
ori r3,r3,0x2000
Modified: openbios-devel/arch/sparc32/linux_load.c
===================================================================
--- openbios-devel/arch/sparc32/linux_load.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/sparc32/linux_load.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -123,7 +123,7 @@
uint16_t ramdisk_flags; /* 0x1f8 */
#define RAMDISK_IMAGE_START_MASK 0x07FF
#define RAMDISK_PROMPT_FLAG 0x8000
-#define RAMDISK_LOAD_FLAG 0x4000
+#define RAMDISK_LOAD_FLAG 0x4000
uint8_t reserved8[2]; /* 0x1fa */
uint16_t orig_root_dev; /* 0x1fc */
uint8_t reserved9[1]; /* 0x1fe */
Modified: openbios-devel/arch/sparc32/loadfs.c
===================================================================
--- openbios-devel/arch/sparc32/loadfs.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/sparc32/loadfs.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -17,7 +17,7 @@
{
if(load_fd==-1)
return;
-
+
close_io(load_fd);
load_fd=-1;
}
@@ -42,7 +42,7 @@
unsigned long file_size(void)
{
llong fpos, fsize;
-
+
if (load_fd < 0)
return 0;
@@ -52,11 +52,11 @@
/* go to end of file and get position */
seek_io(load_fd, -1);
fsize=tell(load_fd);
-
+
/* go back to old position */
seek_io(load_fd, 0);
seek_io(load_fd, fpos);
-
+
return fsize;
}
Modified: openbios-devel/arch/sparc32/openbios.c
===================================================================
--- openbios-devel/arch/sparc32/openbios.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/sparc32/openbios.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -168,7 +168,7 @@
load_dictionary((char *)sys_info.dict_start,
(unsigned long)sys_info.dict_end
- (unsigned long)sys_info.dict_start);
-
+
#ifdef CONFIG_DEBUG_BOOT
printk("forth started.\n");
printk("initializing memory...");
Modified: openbios-devel/arch/sparc32/switch.S
===================================================================
--- openbios-devel/arch/sparc32/switch.S 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/sparc32/switch.S 2008-12-11 20:30:53 UTC (rev 284)
@@ -66,7 +66,7 @@
set (PSR_PS | PSR_S | PSR_PIL | PSR_EF), %g2
wr %g2, 0x0, %psr
#endif
-
+
/* Load all registers
*/
set __context, %g1
Modified: openbios-devel/arch/sparc64/boot.c
===================================================================
--- openbios-devel/arch/sparc64/boot.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/sparc64/boot.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -22,7 +22,7 @@
{
char *path=pop_fstr_copy(), *param;
char altpath[256];
-
+
if (kernel_size) {
void (*entry)(unsigned long p1, unsigned long p2, unsigned long p3,
unsigned long p4, unsigned long p5);
@@ -75,7 +75,7 @@
POP();
param = pop_fstr_copy();
}
-
+
printk("[sparc64] Booting file '%s' ", path);
if (param)
printk("with parameters '%s'\n", param);
Modified: openbios-devel/arch/sparc64/console.c
===================================================================
--- openbios-devel/arch/sparc64/console.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/sparc64/console.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -201,7 +201,7 @@
static void video_putchar(int c)
{
int p=1;
-
+
if (c == '\n' || c == '\r') {
video_newline();
return;
@@ -229,7 +229,7 @@
static void video_cls(void)
{
int i;
-
+
for (i = 0; i < 2 * COLUMNS * LINES;) {
video[i++] = 0;
video[i++] = ATTRIBUTE;
Modified: openbios-devel/arch/sparc64/entry.S
===================================================================
--- openbios-devel/arch/sparc64/entry.S 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/sparc64/entry.S 2008-12-11 20:30:53 UTC (rev 284)
@@ -199,7 +199,7 @@
bne 1b
nop
#endif
-
+
membar #Sync
setx _start, %g7, %g4
Modified: openbios-devel/arch/sparc64/linux_load.c
===================================================================
--- openbios-devel/arch/sparc64/linux_load.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/sparc64/linux_load.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -123,7 +123,7 @@
uint16_t ramdisk_flags; /* 0x1f8 */
#define RAMDISK_IMAGE_START_MASK 0x07FF
#define RAMDISK_PROMPT_FLAG 0x8000
-#define RAMDISK_LOAD_FLAG 0x4000
+#define RAMDISK_LOAD_FLAG 0x4000
uint8_t reserved8[2]; /* 0x1fa */
uint16_t orig_root_dev; /* 0x1fc */
uint8_t reserved9[1]; /* 0x1fe */
Modified: openbios-devel/arch/sparc64/loadfs.c
===================================================================
--- openbios-devel/arch/sparc64/loadfs.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/sparc64/loadfs.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -17,7 +17,7 @@
{
if(load_fd==-1)
return;
-
+
close_io(load_fd);
load_fd=-1;
}
@@ -42,7 +42,7 @@
unsigned long file_size(void)
{
llong fpos, fsize;
-
+
if (load_fd < 0)
return 0;
@@ -52,11 +52,11 @@
/* go to end of file and get position */
seek_io(load_fd, -1);
fsize=tell(load_fd);
-
+
/* go back to old position */
seek_io(load_fd, 0);
seek_io(load_fd, fpos);
-
+
return fsize;
}
Modified: openbios-devel/arch/sparc64/openbios.c
===================================================================
--- openbios-devel/arch/sparc64/openbios.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/sparc64/openbios.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -898,12 +898,12 @@
#endif
collect_sys_info(&sys_info);
-
+
dict=intdict;
load_dictionary((char *)sys_info.dict_start,
(unsigned long)sys_info.dict_end
- (unsigned long)sys_info.dict_start);
-
+
#ifdef CONFIG_DEBUG_BOOT
printk("forth started.\n");
printk("initializing memory...");
@@ -917,7 +917,7 @@
PUSH_xt( bind_noname_func(arch_init) );
fword("PREPOST-initializer");
-
+
PC = (ucell)findword("initialize-of");
if (!PC) {
Modified: openbios-devel/arch/sparc64/openbios.h
===================================================================
--- openbios-devel/arch/sparc64/openbios.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/sparc64/openbios.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -3,9 +3,9 @@
* Time-stamp: <2004/01/15 16:14:05 samuel>
*
* <openbios.h>
- *
- *
*
+ *
+ *
* Copyright (C) 2004 Samuel Rydh (samuel at ibrium.se)
*
* This program is free software; you can redistribute it and/or
Modified: openbios-devel/arch/unix/blk.c
===================================================================
--- openbios-devel/arch/unix/blk.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/unix/blk.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,14 +1,14 @@
-/*
+/*
* <arch/unix/blk.c>
- *
- * block device emulation for unix hosts
- *
+ *
+ * block device emulation for unix hosts
+ *
* Copyright (C) 2004 Stefan Reinauer <stepan at openbios.org>
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#include "openbios/config.h"
@@ -60,9 +60,9 @@
cell i, n = POP();
cell blk = POP();
char *dest = (char*)POP();
-
+
// printk("blk_read_blocks %x block=%d n=%d\n", (ucell)dest, blk, n );
-
+
for( i=0; i<n; ) {
char buf[4096];
ucell m = MIN( n-i, sizeof(buf)/512 );
Modified: openbios-devel/arch/unix/boot.c
===================================================================
--- openbios-devel/arch/unix/boot.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/unix/boot.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -37,12 +37,12 @@
}
(ullong *)entry = ehdr.e_entry;
-
+
lszz_offs = elf_offs;
for( i=0; i<ehdr.e_phnum; i++ ) {
s = MIN( phdr[i].p_filesz, phdr[i].p_memsz );
seek_io( fd, elf_offs + phdr[i].p_offset );
- /* printk("filesz: %08lX memsz: %08lX p_offset: %08lX p_vaddr %08lX\n",
+ /* printk("filesz: %08lX memsz: %08lX p_offset: %08lX p_vaddr %08lX\n",
phdr[i].p_filesz, phdr[i].p_memsz, phdr[i].p_offset,
phdr[i].p_vaddr ); */
if( phdr[i].p_vaddr != phdr[i].p_paddr )
@@ -56,7 +56,7 @@
}
free( phdr );
return entry;
-#else
+#else
return NULL;
#endif
}
@@ -66,7 +66,7 @@
{
char *path=pop_fstr_copy();
void *entry;
-
+
if(!path) {
printk("[unix] Booting default not supported.\n");
return;
Modified: openbios-devel/arch/unix/gui_qt/gui-qt.cpp
===================================================================
--- openbios-devel/arch/unix/gui_qt/gui-qt.cpp 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/unix/gui_qt/gui-qt.cpp 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,5 +1,5 @@
/* tag: qt user interface fb class
- *
+ *
* Copyright (C) 2003-2004 Stefan Reinauer
*
* See the file "COPYING" for further information about
@@ -15,22 +15,22 @@
static const int sizey=480;
static const int depth=8;
-static unsigned char color[256][3]={
- { 0x00, 0x00, 0x00 },
- { 0x00, 0x00, 0xaa },
- { 0x00, 0xaa, 0x00 },
- { 0x00, 0xaa, 0xaa },
- { 0xaa, 0x00, 0x00 },
- { 0xaa, 0x00, 0xaa },
- { 0xaa, 0x55, 0x00 },
- { 0xaa, 0xaa, 0xaa },
- { 0x55, 0x55, 0x55 },
- { 0x55, 0x55, 0xff },
- { 0x55, 0xff, 0x55 },
- { 0x55, 0xff, 0xff },
- { 0xff, 0x55, 0x55 },
- { 0xff, 0x55, 0xff },
- { 0xff, 0xff, 0x55 },
+static unsigned char color[256][3]={
+ { 0x00, 0x00, 0x00 },
+ { 0x00, 0x00, 0xaa },
+ { 0x00, 0xaa, 0x00 },
+ { 0x00, 0xaa, 0xaa },
+ { 0xaa, 0x00, 0x00 },
+ { 0xaa, 0x00, 0xaa },
+ { 0xaa, 0x55, 0x00 },
+ { 0xaa, 0xaa, 0xaa },
+ { 0x55, 0x55, 0x55 },
+ { 0x55, 0x55, 0xff },
+ { 0x55, 0xff, 0x55 },
+ { 0x55, 0xff, 0xff },
+ { 0xff, 0x55, 0x55 },
+ { 0xff, 0x55, 0xff },
+ { 0xff, 0xff, 0x55 },
{ 0xff, 0xff, 0xff },
};
@@ -43,20 +43,20 @@
QPopupMenu *file = new QPopupMenu (this);
file->insertItem( "E&xit", this, SLOT(quit()), CTRL+Key_Q );
-
+
QPopupMenu *help = new QPopupMenu( this );
help->insertItem("&About OpenBIOS", this, SLOT(about()), CTRL+Key_H );
help->insertItem( "About &Qt", this, SLOT(aboutQt()) );
-
+
menu = new QMenuBar( this );
Q_CHECK_PTR( menu );
menu->insertItem( "&File", file );
menu->insertSeparator();
menu->insertItem( "&Help", help );
menu->setSeparator( QMenuBar::InWindowsStyle );
-
+
setFixedSize(sizex,sizey+menu->heightForWidth(sizex));
-
+
buffer.create(sizex, sizey, depth, 256);
for (int i=16; i < 256; i++) {
@@ -64,16 +64,16 @@
color[i][1]=i;
color[i][2]=i;
}
-
+
for (int i=0; i< 256; i++)
buffer.setColor(i, qRgb(color[i][0], color[i][1], color[i][2]));
-
+
buffer.fill( 0 );
-
+
updatetimer=new QTimer(this);
connect( updatetimer, SIGNAL(timeout()), this, SLOT(update()) );
updatetimer->start(200,FALSE);
-
+
setMouseTracking( TRUE );
}
@@ -98,10 +98,10 @@
}
void FrameBufferWidget::aboutQt()
-{
+{
QMessageBox::aboutQt( this, "OpenBIOS" );
-}
-
+}
+
void FrameBufferWidget::quit()
{
extern volatile int gui_running;
Modified: openbios-devel/arch/unix/gui_qt/gui-qt.h
===================================================================
--- openbios-devel/arch/unix/gui_qt/gui-qt.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/unix/gui_qt/gui-qt.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,5 +1,5 @@
/* tag: qt user interface fb class description
- *
+ *
* Copyright (C) 2003-2004 Stefan Reinauer <stepan at openbios.org>
*
* See the file "COPYING" for further information about
@@ -24,7 +24,7 @@
public:
FrameBufferWidget(QWidget *parent=0, const char *name=0);
unsigned char *getFrameBuffer(void);
-
+
public slots:
void quit();
void about();
Modified: openbios-devel/arch/unix/gui_qt/qt-main.cpp
===================================================================
--- openbios-devel/arch/unix/gui_qt/qt-main.cpp 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/unix/gui_qt/qt-main.cpp 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,5 +1,5 @@
/* tag: openbios qt user interface
- *
+ *
* Copyright (C) 2003-2004 Stefan Reinauer
*
* See the file "COPYING" for further information about
@@ -28,19 +28,19 @@
void *gui_thread(void *ptr)
{
threaddata *td=(threaddata *)ptr;
-
+
QApplication a(td->argc, td->argv);
FrameBufferWidget w;
a.setMainWidget(&w);
w.show();
-
+
fb=w.getFrameBuffer();
gui_running=-1;
a.exec();
gui_running=0;
-
+
return 0;
}
@@ -56,11 +56,11 @@
printf("Initializing \"framebuffer\" plugin...");
#endif
pthread_create(&mythread, NULL, gui_thread, &mytd);
- while (!fb)
+ while (!fb)
usleep(20);
#if 0
-
+
/* now we have the framebuffer start address.
* updating pci config space to reflect this
*/
@@ -80,14 +80,14 @@
*(u32 *)(pci_config_space+0x34)=0;
#endif
*(u32 *)(pci_config_space+0x30)=(u32)((unsigned long)qt_fcode&0xffffffff);
-
+
/* FIXME: we need to put the fcode image for this
* device to the rom resource, once it exists
*/
-
+
/* register pci device to be available to beginagain */
pci_register_device(0, 2, 0, pci_config_space);
-#endif
+#endif
#ifdef DEBUG
printf("done.\n");
#endif
Modified: openbios-devel/arch/unix/plugins/plugin_pci/plugin_pci.c
===================================================================
--- openbios-devel/arch/unix/plugins/plugin_pci/plugin_pci.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/unix/plugins/plugin_pci/plugin_pci.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,5 +1,5 @@
/* tag: openbios pci plugin
- *
+ *
* Copyright (C) 2003 Stefan Reinauer
*
* See the file "COPYING" for further information about
@@ -34,7 +34,7 @@
}
/*
- * IO functions. These manage all the magic of providing a PCI
+ * IO functions. These manage all the magic of providing a PCI
* compatible interface to OpenBIOS' unix version of the kernel.
*/
Modified: openbios-devel/arch/unix/plugins/plugin_qt/pciconfig.h
===================================================================
--- openbios-devel/arch/unix/plugins/plugin_qt/pciconfig.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/unix/plugins/plugin_qt/pciconfig.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,5 +1,5 @@
/* tag: pci config space dump for qt plugin's pci device.
- *
+ *
* Copyright (C) 2003 Stefan Reinauer
*
* See the file "COPYING" for further information about
Modified: openbios-devel/arch/unix/plugins/plugin_qt/plugin_qt.cpp
===================================================================
--- openbios-devel/arch/unix/plugins/plugin_qt/plugin_qt.cpp 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/unix/plugins/plugin_qt/plugin_qt.cpp 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,5 +1,5 @@
/* tag: qt plugin framebuffer class
- *
+ *
* Copyright (C) 2003 Stefan Reinauer
*
* See the file "COPYING" for further information about
@@ -15,22 +15,22 @@
static const int sizey=480;
static const int depth=8;
-static unsigned char color[256][3]={
- { 0x00, 0x00, 0x00 },
- { 0x00, 0x00, 0xaa },
- { 0x00, 0xaa, 0x00 },
- { 0x00, 0xaa, 0xaa },
- { 0xaa, 0x00, 0x00 },
- { 0xaa, 0x00, 0xaa },
- { 0xaa, 0x55, 0x00 },
- { 0xaa, 0xaa, 0xaa },
- { 0x55, 0x55, 0x55 },
- { 0x55, 0x55, 0xff },
- { 0x55, 0xff, 0x55 },
- { 0x55, 0xff, 0xff },
- { 0xff, 0x55, 0x55 },
- { 0xff, 0x55, 0xff },
- { 0xff, 0xff, 0x55 },
+static unsigned char color[256][3]={
+ { 0x00, 0x00, 0x00 },
+ { 0x00, 0x00, 0xaa },
+ { 0x00, 0xaa, 0x00 },
+ { 0x00, 0xaa, 0xaa },
+ { 0xaa, 0x00, 0x00 },
+ { 0xaa, 0x00, 0xaa },
+ { 0xaa, 0x55, 0x00 },
+ { 0xaa, 0xaa, 0xaa },
+ { 0x55, 0x55, 0x55 },
+ { 0x55, 0x55, 0xff },
+ { 0x55, 0xff, 0x55 },
+ { 0x55, 0xff, 0xff },
+ { 0xff, 0x55, 0x55 },
+ { 0xff, 0x55, 0xff },
+ { 0xff, 0xff, 0x55 },
{ 0xff, 0xff, 0xff },
};
@@ -43,20 +43,20 @@
QPopupMenu *file = new QPopupMenu (this);
file->insertItem( "E&xit", this, SLOT(quit()), CTRL+Key_Q );
-
+
QPopupMenu *help = new QPopupMenu( this );
help->insertItem("&About OpenBIOS", this, SLOT(about()), CTRL+Key_H );
help->insertItem( "About &Qt", this, SLOT(aboutQt()) );
-
+
menu = new QMenuBar( this );
Q_CHECK_PTR( menu );
menu->insertItem( "&File", file );
menu->insertSeparator();
menu->insertItem( "&Help", help );
menu->setSeparator( QMenuBar::InWindowsStyle );
-
+
setFixedSize(sizex,sizey+menu->heightForWidth(sizex));
-
+
buffer.create(sizex, sizey, depth, 256);
for (int i=16; i < 256; i++) {
@@ -64,16 +64,16 @@
color[i][1]=i;
color[i][2]=i;
}
-
+
for (int i=0; i< 256; i++)
buffer.setColor(i, qRgb(color[i][0], color[i][1], color[i][2]));
-
+
buffer.fill( 0 );
-
+
updatetimer=new QTimer(this);
connect( updatetimer, SIGNAL(timeout()), this, SLOT(update()) );
updatetimer->start(200,FALSE);
-
+
setMouseTracking( TRUE );
}
@@ -98,10 +98,10 @@
}
void FrameBufferWidget::aboutQt()
-{
+{
QMessageBox::aboutQt( this, "OpenBIOS" );
-}
-
+}
+
void FrameBufferWidget::quit()
{
extern volatile int gui_running;
Modified: openbios-devel/arch/unix/plugins/plugin_qt/plugin_qt.h
===================================================================
--- openbios-devel/arch/unix/plugins/plugin_qt/plugin_qt.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/unix/plugins/plugin_qt/plugin_qt.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,5 +1,5 @@
/* tag: qt plugin framebuffer class description
- *
+ *
* Copyright (C) 2003 Stefan Reinauer
*
* See the file "COPYING" for further information about
@@ -24,7 +24,7 @@
public:
FrameBufferWidget(QWidget *parent=0, const char *name=0);
unsigned char *getFrameBuffer(void);
-
+
public slots:
void quit();
void about();
Modified: openbios-devel/arch/unix/plugins/plugin_qt/qt_main.cpp
===================================================================
--- openbios-devel/arch/unix/plugins/plugin_qt/qt_main.cpp 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/unix/plugins/plugin_qt/qt_main.cpp 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,5 +1,5 @@
/* tag: openbios qt plugin skeleton
- *
+ *
* Copyright (C) 2003 Stefan Reinauer
*
* See the file "COPYING" for further information about
@@ -30,19 +30,19 @@
void *gui_thread(void *ptr)
{
threaddata *td=(threaddata *)ptr;
-
+
QApplication a(td->argc, td->argv);
FrameBufferWidget w;
a.setMainWidget(&w);
w.show();
-
+
fb=w.getFrameBuffer();
gui_running=-1;
a.exec();
gui_running=0;
-
+
return 0;
}
@@ -58,7 +58,7 @@
printf("Initializing \"framebuffer\" plugin...");
#endif
pthread_create(&mythread, NULL, gui_thread, &mytd);
- while (!fb)
+ while (!fb)
usleep(20);
/* now we have the framebuffer start address.
@@ -80,14 +80,14 @@
*(u32 *)(pci_config_space+0x34)=0;
#endif
*(u32 *)(pci_config_space+0x30)=(u32)((unsigned long)qt_fcode&0xffffffff);
-
+
/* FIXME: we need to put the fcode image for this
* device to the rom resource, once it exists
*/
-
+
/* register pci device to be available to beginagain */
pci_register_device(0, 2, 0, pci_config_space);
-
+
#ifdef DEBUG
printf("done.\n");
#endif
Modified: openbios-devel/arch/unix/unix.c
===================================================================
--- openbios-devel/arch/unix/unix.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/unix/unix.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -37,7 +37,7 @@
#define MEMORY_SIZE (4*1024*1024) /* 4M ram for hosted system */
#define DICTIONARY_SIZE (256*1024) /* 256k for the dictionary */
-
+
#if defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS==64)
#define lseek lseek64
#define __LFS O_LARGEFILE
@@ -155,7 +155,7 @@
if (ior)
return ior->inb(reg);
#endif
-
+
printk("TRAP: io byte read @0x%x", reg);
return 0xff;
}
@@ -302,7 +302,7 @@
exit(1);
}
-/*
+/*
* allocate memory and prepare engine for memory management.
*/
@@ -327,9 +327,9 @@
void exception(__attribute__((unused)) cell no)
{
- /*
- * this is a noop since the dictionary has to take care
- * itself of errors it generates outside of the bootstrap
+ /*
+ * this is a noop since the dictionary has to take care
+ * itself of errors it generates outside of the bootstrap
*/
}
@@ -339,17 +339,17 @@
modules_init();
if(diskemu!=-1)
blk_init();
-
+
device_end();
bind_func("platform-boot", boot);
}
-int
+int
read_from_disk( int channel, int unit, int blk, unsigned long mphys, int size )
{
// channels and units not supported yet.
unsigned char *buf=(unsigned char *)mphys;
-
+
if(diskemu==-1)
return -1;
@@ -461,7 +461,7 @@
}
memset(dict, 0, DICTIONARY_SIZE);
-
+
if (!segfault) {
if (verbose)
printk("Installing SIGSEGV handler...");
@@ -536,7 +536,7 @@
printk( const char *fmt, ... )
{
int i;
-
+
va_list args;
va_start( args, fmt );
i = vprintf(fmt, args );
Modified: openbios-devel/arch/x86/boot.c
===================================================================
--- openbios-devel/arch/x86/boot.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/x86/boot.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -20,12 +20,12 @@
void boot(void);
-struct sys_info sys_info;
+struct sys_info sys_info;
void boot(void)
{
char *path=pop_fstr_copy(), *param;
-
+
if(!path) {
printk("[x86] Booting default not supported.\n");
return;
@@ -36,7 +36,7 @@
*param = '\0';
param++;
}
-
+
printk("[x86] Booting file '%s' with parameters '%s'\n",path, param);
if (elf_load(&sys_info, path, param) != LOADER_NOT_SUPPORT)
@@ -45,7 +45,7 @@
goto loaded;
if (forth_load(&sys_info, path, param) != LOADER_NOT_SUPPORT)
goto loaded;
-
+
printk("Unsupported image format\n");
loaded:
Modified: openbios-devel/arch/x86/console.c
===================================================================
--- openbios-devel/arch/x86/console.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/x86/console.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -200,7 +200,7 @@
static void video_putchar(int c)
{
int p=1;
-
+
if (c == '\n' || c == '\r') {
video_newline();
return;
@@ -228,7 +228,7 @@
static void video_cls(void)
{
int i;
-
+
for (i = 0; i < 2 * COLUMNS * LINES;) {
video[i++] = 0;
video[i++] = ATTRIBUTE;
Modified: openbios-devel/arch/x86/context.c
===================================================================
--- openbios-devel/arch/x86/context.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/x86/context.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,5 +1,5 @@
/* tag: x86 context switching
- *
+ *
* 2003-10 by SONE Takeshi
*
* See the file "COPYING" for further information about
@@ -22,7 +22,7 @@
void __exit_context(void); /* assembly routine */
/*
- * Main context structure
+ * Main context structure
* It is placed at the bottom of our stack, and loaded by assembly routine
* to start us up.
*/
Modified: openbios-devel/arch/x86/elfload.c
===================================================================
--- openbios-devel/arch/x86/elfload.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/x86/elfload.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -159,7 +159,7 @@
}
bytes += phdr[i].p_filesz;
debug("clearing... ");
- memset(phys_to_virt(phdr[i].p_paddr + phdr[i].p_filesz), 0,
+ memset(phys_to_virt(phdr[i].p_paddr + phdr[i].p_filesz), 0,
phdr[i].p_memsz - phdr[i].p_filesz);
if (phdr[i].p_offset <= checksum_offset
&& phdr[i].p_offset + phdr[i].p_filesz >= checksum_offset+2) {
@@ -362,7 +362,7 @@
if (!load_segments(phdr, ehdr.e_phnum, checksum_offset))
goto out;
-
+
if (checksum_offset) {
if (!verify_image(&ehdr, phdr, ehdr.e_phnum, checksum))
goto out;
Modified: openbios-devel/arch/x86/entry.S
===================================================================
--- openbios-devel/arch/x86/entry.S 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/x86/entry.S 2008-12-11 20:30:53 UTC (rev 284)
@@ -6,7 +6,7 @@
/*
* Entry point
* We start execution from here.
- * It is assumed that CPU is in 32-bit protected mode and
+ * It is assumed that CPU is in 32-bit protected mode and
* all segments are 4GB and base zero (flat model).
*/
entry:
@@ -28,7 +28,7 @@
* switches the stack, and restores everything from the new stack.
* This function takes no argument. New stack pointer is
* taken from global variable __context, and old stack pointer
- * is also saved to __context. This way we can just jump to
+ * is also saved to __context. This way we can just jump to
* this routine to get back to the original context.
*
* Call this routine with lcall or pushl %cs; call.
@@ -51,7 +51,7 @@
xchgl %eax, 64(%esp)
movl %eax, 60(%esp)
#endif
-
+
/* At this point we don't know if we are on flat segment
* or relocated. So compute the address offset from %eip.
* Assuming CS.base==DS.base==SS.base.
@@ -62,7 +62,7 @@
/* Interrupts are not allowed... */
cli
-
+
/* Current context pointer is our stack pointer */
movl %esp, %esi
@@ -119,7 +119,7 @@
* initialize exception handler. All exceptions end up in the same
* C function.
*/
-
+
init_exceptions:
pushl %ebx
pushl %edi
@@ -141,7 +141,7 @@
/* Load the Interrupt descriptor table */
lidt idtarg
-
+
movl $0, %eax
popl %edi
popl %ebx
Modified: openbios-devel/arch/x86/exception.c
===================================================================
--- openbios-devel/arch/x86/exception.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/x86/exception.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -54,12 +54,12 @@
void x86_exception(struct eregs *info)
{
if(info->vector <= 18) {
- printk("\nUnexpected Exception: %s",
+ printk("\nUnexpected Exception: %s",
exception_names[info->vector]);
} else {
printk("\nUnexpected Exception: %d", info->vector);
}
-
+
printk(
" @ %02x:%08lx - Halting\n"
"Code: %d eflags: %08lx\n"
@@ -67,7 +67,7 @@
"edi: %08lx esi: %08lx ebp: %08lx esp: %08lx\n",
info->cs, (unsigned long)info->eip,
info->error_code, (unsigned long)info->eflags,
- (unsigned long)info->eax, (unsigned long)info->ebx,
+ (unsigned long)info->eax, (unsigned long)info->ebx,
(unsigned long)info->ecx, (unsigned long)info->edx,
(unsigned long)info->edi, (unsigned long)info->esi,
(unsigned long)info->ebp, (unsigned long)info->esp);
@@ -83,7 +83,7 @@
PC=findword("outer-interpreter");
info->eip=(uint32_t)&do_nothing;
-
+
/*
for (;;)
asm("hlt;");
Modified: openbios-devel/arch/x86/forthload.c
===================================================================
--- openbios-devel/arch/x86/forthload.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/x86/forthload.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -38,10 +38,10 @@
}
forthsize = file_size();
-
+
forthtext = malloc(forthsize+1);
file_seek(0);
-
+
printk("Loading forth source ...");
if (lfile_read(forthtext, forthsize) != forthsize) {
printk("Can't read forth text\n");
Modified: openbios-devel/arch/x86/lib.c
===================================================================
--- openbios-devel/arch/x86/lib.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/x86/lib.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -15,7 +15,7 @@
#include "openbios/kernel.h"
/* Format a string and print it on the screen, just like the libc
- * function printf.
+ * function printf.
*/
int printk( const char *fmt, ... )
{
Modified: openbios-devel/arch/x86/linux_load.c
===================================================================
--- openbios-devel/arch/x86/linux_load.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/x86/linux_load.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -124,7 +124,7 @@
uint16_t ramdisk_flags; /* 0x1f8 */
#define RAMDISK_IMAGE_START_MASK 0x07FF
#define RAMDISK_PROMPT_FLAG 0x8000
-#define RAMDISK_LOAD_FLAG 0x4000
+#define RAMDISK_LOAD_FLAG 0x4000
uint8_t reserved8[2]; /* 0x1fa */
uint16_t orig_root_dev; /* 0x1fc */
uint8_t reserved9[1]; /* 0x1fe */
@@ -465,7 +465,7 @@
max = hdr->initrd_addr_max;
else
max = 0x38000000; /* Hardcoded value for older kernels */
-
+
/* FILO itself is at the top of RAM. (relocated)
* So, try putting initrd just below us. */
end = virt_to_phys(_start);
@@ -521,9 +521,9 @@
outb(0, 0xf0);
outb(0, 0xf1);
- /* we're getting screwed again and again by this problem of the 8259.
- * so we're going to leave this lying around for inclusion into
- * crt0.S on an as-needed basis.
+ /* we're getting screwed again and again by this problem of the 8259.
+ * so we're going to leave this lying around for inclusion into
+ * crt0.S on an as-needed basis.
*
* well, that went ok, I hope. Now we have to reprogram the interrupts :-(
* we put them right after the intel-reserved hardware interrupts, at
@@ -566,8 +566,8 @@
linux_gdt[2] = gdt[FLAT_CODE];
linux_gdt[3] = gdt[FLAT_DATA];
/* 2.6 kernel uses 12 and 13, but head.S uses backward-compatible
- * segments (2 and 3), so it SHOULD not be a problem.
- * However, some distro kernels (eg. RH9) with backported threading
+ * segments (2 and 3), so it SHOULD not be a problem.
+ * However, some distro kernels (eg. RH9) with backported threading
* patch use 12 and 13 also when booting... */
linux_gdt[12] = gdt[FLAT_CODE];
linux_gdt[13] = gdt[FLAT_DATA];
@@ -595,7 +595,7 @@
params->orig_x = cursor_x;
params->orig_y = cursor_y;
#endif
-
+
/* Go... */
ctx = switch_to(ctx);
Modified: openbios-devel/arch/x86/loadfs.c
===================================================================
--- openbios-devel/arch/x86/loadfs.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/x86/loadfs.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -27,18 +27,18 @@
unsigned long file_size(void)
{
llong fpos, fsize;
-
+
/* save current position */
fpos=tell(load_fd);
/* go to end of file and get position */
seek_io(load_fd, -1);
fsize=tell(load_fd);
-
+
/* go back to old position */
seek_io(load_fd, 0);
seek_io(load_fd, fpos);
-
+
return fsize;
}
Modified: openbios-devel/arch/x86/multiboot.c
===================================================================
--- openbios-devel/arch/x86/multiboot.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/x86/multiboot.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,6 +1,6 @@
/* Support for Multiboot */
-#include "openbios/config.h"
+#include "openbios/config.h"
#include "asm/io.h"
#include "sys_info.h"
#include "multiboot.h"
@@ -8,7 +8,7 @@
#ifdef CONFIG_DEBUG_BOOT
#define debug printk
#else
-#define debug(x...)
+#define debug(x...)
#endif
struct mbheader {
@@ -61,13 +61,13 @@
printk("multiboot: no dictionary\n");
return;
}
-
+
mod = (module_t *) mbinfo->mods_addr;
info->dict_start=(unsigned long *)mod->mod_start;
info->dict_end=(unsigned long *)mod->mod_end;
- debug("multiboot: dictionary at %x-%x\n",
+ debug("multiboot: dictionary at %x-%x\n",
info->dict_start, info->dict_end);
-
+
if (mbinfo->flags & MULTIBOOT_MMAP_VALID) {
/* convert mmap records */
mbmem = phys_to_virt(mbinfo->mmap_addr);
Modified: openbios-devel/arch/x86/multiboot.h
===================================================================
--- openbios-devel/arch/x86/multiboot.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/x86/multiboot.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,5 +1,5 @@
-/* multiboot.h
- * tag: header for multiboot
+/* multiboot.h
+ * tag: header for multiboot
*
* Copyright (C) 2003 Stefan Reinauer
*
Modified: openbios-devel/arch/x86/openbios.c
===================================================================
--- openbios-devel/arch/x86/openbios.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/x86/openbios.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -24,7 +24,7 @@
static void init_memory(void)
{
/* push start and end of available memory to the stack
- * so that the forth word QUIT can initialize memory
+ * so that the forth word QUIT can initialize memory
* management. For now we use hardcoded memory between
* 0x10000 and 0x9ffff (576k). If we need more memory
* than that we have serious bloat.
@@ -70,12 +70,12 @@
#endif
collect_sys_info(&sys_info);
-
+
dict=intdict;
load_dictionary((char *)sys_info.dict_start,
(unsigned long)sys_info.dict_end -
(unsigned long)sys_info.dict_start);
-
+
relocate(&sys_info);
#ifdef CONFIG_DEBUG_CONSOLE_VGA
@@ -94,7 +94,7 @@
PUSH_xt( bind_noname_func(arch_init) );
fword("PREPOST-initializer");
-
+
PC = (ucell)findword("initialize-of");
if (!PC) {
Modified: openbios-devel/arch/x86/openbios.h
===================================================================
--- openbios-devel/arch/x86/openbios.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/x86/openbios.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2004/01/15 16:14:05 samuel>
* Time-stamp: <2004/01/15 16:14:05 samuel>
- *
+ *
* <openbios.h>
- *
- *
- *
+ *
+ *
+ *
* Copyright (C) 2004 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#ifndef _H_OPENBIOS
Modified: openbios-devel/arch/x86/segment.c
===================================================================
--- openbios-devel/arch/x86/segment.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/x86/segment.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -22,7 +22,7 @@
unsigned int base;
} __attribute__((packed));
-/* How far the virtual address (used in C) is different from physical
+/* How far the virtual address (used in C) is different from physical
* address. Since we start in flat mode, the initial value is zero. */
unsigned long virt_offset = 0;
@@ -108,7 +108,7 @@
"movw %5, %%gs\n\t"
"movw %5, %%ss\n"
: "=&S" (d0), "=&D" (d1), "=&c" (d2)
- : "m" (gdtarg), "n" (RELOC_CS), "q" ((unsigned short) RELOC_DS),
+ : "m" (gdtarg), "n" (RELOC_CS), "q" ((unsigned short) RELOC_DS),
"0" (&_start), "1" (new_base), "2" (prog_size));
virt_offset = new_offset;
Modified: openbios-devel/arch/x86/sys_info.c
===================================================================
--- openbios-devel/arch/x86/sys_info.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/x86/sys_info.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -6,7 +6,7 @@
#ifdef CONFIG_DEBUG_BOOT
#define debug printk
#else
-#define debug(x...)
+#define debug(x...)
#endif
void collect_multiboot_info(struct sys_info *);
Modified: openbios-devel/arch/x86/xbox/console.c
===================================================================
--- openbios-devel/arch/x86/xbox/console.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/x86/xbox/console.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,7 +1,7 @@
/*
* Xbox framebuffer - Video + Console
*
- * Copyright (C) 2005 Ed Schouten <ed at fxq.nl>,
+ * Copyright (C) 2005 Ed Schouten <ed at fxq.nl>,
* Stefan Reinauer <stepan at openbios.org>
*
* This program is free software; you can redistribute it and/or modify
Modified: openbios-devel/arch/x86/xbox/methods.c
===================================================================
--- openbios-devel/arch/x86/xbox/methods.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/arch/x86/xbox/methods.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,21 +1,21 @@
-/*
+/*
* Creation Date: <2004/08/28 18:38:22 greg>
* Time-stamp: <2004/08/28 18:38:22 greg>
- *
+ *
* <methods.c>
- *
+ *
* Misc device node methods
*
* Copyright (C) 2004 Greg Watson
- *
+ *
* Based on MOL specific code which is
- *
+ *
* Copyright (C) 2003, 2004 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#include "openbios/config.h"
@@ -39,11 +39,11 @@
strncpy_nopad( s, addr, len );
s[len]=0;
-
+
printk( "%s", s );
//vfd_draw_str( s );
console_draw_str( s );
-
+
free( s );
PUSH( len );
Modified: openbios-devel/drivers/adb.c
===================================================================
--- openbios-devel/drivers/adb.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/drivers/adb.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -2,7 +2,7 @@
* <adbkbd.c>
*
* Open Hack'Ware BIOS ADB keyboard support, ported to OpenBIOS
- *
+ *
* Copyright (c) 2005 Jocelyn Mayer
* Copyright (c) 2005 Stefan Reinauer
*
@@ -516,7 +516,7 @@
int len, key, i;
len=POP();
addr=(char *)POP();
-
+
for (i = 0; i < len; i++) {
key = adb_kbd_read(my_adb_dev);
if (key == -1 || key == -2)
Modified: openbios-devel/drivers/adb.h
===================================================================
--- openbios-devel/drivers/adb.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/drivers/adb.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -2,7 +2,7 @@
* ADB bus definitions for Open Hack'Ware
*
* Copyright (c) 2004-2005 Jocelyn Mayer
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License V2
* as published by the Free Software Foundation
@@ -76,7 +76,7 @@
static inline int adb_reset (adb_bus_t *bus)
{
adb_dev_t fake_device;
-
+
memset(&fake_device, 0, sizeof(adb_dev_t));
fake_device.bus = bus;
Modified: openbios-devel/drivers/floppy.c
===================================================================
--- openbios-devel/drivers/floppy.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/drivers/floppy.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -15,7 +15,7 @@
#define printk_debug printk
#define printk_err printk
-#ifndef FD_BASE
+#ifndef FD_BASE
#define FD_BASE 0x3f0
#endif
@@ -198,7 +198,7 @@
unsigned track;
} drive_state[1];
-struct floppy_fdc_state {
+struct floppy_fdc_state {
int in_sync;
int spec1; /* spec1 value last used */
int spec2; /* spec2 value last used */
@@ -241,7 +241,7 @@
{
int counter, status;
for (counter = 0; counter < 10000; counter++) {
- status = inb(FD_STATUS);
+ status = inb(FD_STATUS);
if (status & STATUS_READY) {
return status;
}
@@ -312,7 +312,7 @@
int i, status;
for(i = 0; i < count; i++) {
if ((status = output_byte(cmd[i])) < 0) {
- printk_err("full command not acceppted, status =%x\n",
+ printk_err("full command not acceppted, status =%x\n",
status);
return -1;
}
@@ -325,11 +325,11 @@
int i, status;
if ((status = output_byte(cmd[0])) < 0)
return -1;
- if (need_more_output() != MORE_OUTPUT)
+ if (need_more_output() != MORE_OUTPUT)
return -1;
for(i = 1; i < count; i++) {
if ((status = output_byte(cmd[i])) < 0) {
- printk_err("full new command not acceppted, status =%d\n",
+ printk_err("full new command not acceppted, status =%d\n",
status);
return -1;
}
@@ -351,12 +351,12 @@
else {
int max_sensei = 4;
do {
- if (output_byte(FD_SENSEI) < 0)
+ if (output_byte(FD_SENSEI) < 0)
break;
nr = result(reply_buffer, MAX_REPLIES);
if (nr == 2) {
pcn = reply_buffer[1];
- printk_debug("SENSEI %02x %02x\n",
+ printk_debug("SENSEI %02x %02x\n",
reply_buffer[0], reply_buffer[1]);
}
#if 0
@@ -367,7 +367,7 @@
status = inb(FD_STATUS);
printk_debug("status = %x, reply_buffer=", status);
for(i = 0; i < nr; i++) {
- printk_debug(" %x",
+ printk_debug(" %x",
reply_buffer[i]);
}
printk_debug("\n");
@@ -404,7 +404,7 @@
mdelay(DRIVE_H1440_SPINUP);
status = inb(FD_STATUS);
- printk_debug("set_drive status = %02x, new_dor = %02x\n",
+ printk_debug("set_drive status = %02x, new_dor = %02x\n",
status, new_dor);
if (status != STATUS_READY) {
printk_err("set_drive bad status\n");
@@ -449,7 +449,7 @@
mdelay(5);
} /* fdc_dtr */
-static int fdc_configure(int use_implied_seek, int use_fifo,
+static int fdc_configure(int use_implied_seek, int use_fifo,
unsigned fifo_threshold, unsigned precompensation)
{
unsigned config_bits;
@@ -473,7 +473,7 @@
if (output_new_command(cmd, 4) < 0)
return 0;
return 1;
-}
+}
#define NOMINAL_DTR 500
/* Issue a "SPECIFY" command to set the step rate time, head unload time,
@@ -542,7 +542,7 @@
}
if (srt > 0xf) {
srt = 0xf;
- }
+ }
hlt = (head_load_time*scale_dtr/2 + NOMINAL_DTR - 1)/NOMINAL_DTR;
if (hlt < 0x01)
@@ -604,7 +604,7 @@
printk_debug("fdc_bytes: %02x %02x xx %02x %02x %02x xx %02x\n",
inb(FD_BASE + 0), inb(FD_BASE + 1),
- inb(FD_BASE + 3), inb(FD_BASE + 4), inb(FD_BASE + 5),
+ inb(FD_BASE + 3), inb(FD_BASE + 4), inb(FD_BASE + 5),
inb(FD_BASE + 7));
printk_debug("status=%x\n", inb(FD_STATUS));
@@ -641,9 +641,9 @@
nr = result(reply, MAX_REPLIES);
/* Now see if we have succeeded in our seek */
- success =
+ success =
/* We have the right size result */
- (nr == 2) &&
+ (nr == 2) &&
/* The command didn't terminate in error */
((reply[0] & ST0_INTR) == ST0_INTR_OK) &&
/* We finished a seek */
@@ -670,14 +670,14 @@
if (old_track == track) {
return 1;
}
-
+
/* Compute the distance we are about to move,
- * We need to know this so we know how long to sleep...
+ * We need to know this so we know how long to sleep...
*/
distance = (old_track > track)?(old_track - track):(track - old_track);
distance += 1;
-
+
/* Send the seek command to the controller.
* We don't have interrupts or anything we can poll
* so we have to guess when it is done.
@@ -687,7 +687,7 @@
cmd[2] = track;
if (output_command(cmd, 3) < 0)
return 0;
-
+
/* Sleep for the time it takes to step throuhg distance tracks.
*/
mdelay(distance*DRIVE_H1440_SRT/1000);
@@ -701,9 +701,9 @@
nr = result(reply, MAX_REPLIES);
/* Now see if we have succeeded in our seek */
- success =
+ success =
/* We have the right size result */
- (nr == 2) &&
+ (nr == 2) &&
/* The command didn't terminate in error */
((reply[0] & ST0_INTR) == ST0_INTR_OK) &&
/* We finished a seek */
@@ -740,7 +740,7 @@
result_ok = 1;
}
/* Or did we get just an overflow error */
- else if (((results[0] & ST0_INTR) == ST0_INTR_ERROR) &&
+ else if (((results[0] & ST0_INTR) == ST0_INTR_ERROR) &&
(results[1]== ST1_OR) &&
(results[2] == 0)) {
result_ok = 1;
@@ -835,7 +835,7 @@
}
}
bytes_read = i;
-
+
/* The result stage begins when STATUS_NON_DMA is cleared */
while((status = inb(FD_STATUS)) & STATUS_NON_DMA) {
/* We get extra bytes in the fifo past
@@ -854,7 +854,7 @@
ret = length;
}
}
-
+
if (ret < 0) {
printk_debug("ret = %d\n", ret);
printk_debug("bytes_read = %d\n", bytes_read);
@@ -919,7 +919,7 @@
{
int bytes, ret;
unsigned char reply_buffer[MAX_REPLIES];
-
+
ret = output_byte(FD_DUMPREGS); /* 82072 and better know DUMPREGS */
if (ret < 0)
return FDC_NONE;
@@ -952,7 +952,7 @@
bytes = result(reply_buffer, MAX_REPLIES);
if ((bytes == 1) && (reply_buffer[0] == 0x80)){
printk_info("FDC is a pre-1991 82077\n");
- return FDC_82077_ORIG; /* Pre-1991 82077, doesn't know
+ return FDC_82077_ORIG; /* Pre-1991 82077, doesn't know
* LOCK/UNLOCK */
}
if ((bytes != 1) || (reply_buffer[0] != 0x00)) {
@@ -1021,7 +1021,7 @@
fdc_dtr(DISK_H1440_RATE);
/* program data rate via ccr */
collect_interrupt();
- fdc_configure(USE_IMPLIED_SEEK, USE_FIFO, FIFO_THRESHOLD,
+ fdc_configure(USE_IMPLIED_SEEK, USE_FIFO, FIFO_THRESHOLD,
TRACK_PRECOMPENSATION);
fdc_specify(DRIVE_H1440_HLT, DRIVE_H1440_HUT, DRIVE_H1440_SRT);
set_drive(FD_DRIVE);
Modified: openbios-devel/drivers/ide.c
===================================================================
--- openbios-devel/drivers/ide.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/drivers/ide.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,6 +1,6 @@
/*
* OpenBIOS polled ide driver
- *
+ *
* Copyright (C) 2004 Jens Axboe <axboe at suse.de>
* Copyright (C) 2005 Stefan Reinauer <stepan at openbios.org>
*
@@ -374,7 +374,7 @@
cmd->stat = stat;
return 1;
}
-
+
ob_ide_write_registers(drive, cmd);
/*
@@ -1123,7 +1123,7 @@
/*
* The following functions are interfacing with OpenBIOS. They
* are device node methods. Thus they have to do proper stack handling.
- *
+ *
*/
/*
@@ -1148,7 +1148,7 @@
#ifdef CONFIG_DEBUG_IDE
printk("ob_ide_read_blocks %x block=%d n=%d\n", (unsigned long)dest, blk, n );
#endif
-
+
while (n) {
int len = n;
if (len > drive->max_sectors)
@@ -1179,10 +1179,10 @@
{
int props[3];
phandle_t ph=get_cur_dev();
-
+
push_str("block");
fword("device-type");
-
+
// Set dummy reg properties
props[0] = __cpu_to_be32(0); props[1] = __cpu_to_be32(0); props[2] = __cpu_to_be32(0);
set_property(ph, "reg", (char *)&props, 3*sizeof(int));
@@ -1206,7 +1206,7 @@
ph=(phandle_t)POP();
idename=get_property(ph, "name", &len);
idx[1]=idename[3]-0x30;
-
+
#ifdef CONFIG_DEBUG_IDE
printk("opening channel %d unit %d\n", idx[1], idx[0]);
#endif
@@ -1223,7 +1223,7 @@
fword("my-args");
PUSH_ph( ph );
fword("interpose");
-
+
RET ( -ret );
}
@@ -1255,17 +1255,17 @@
/* set device type */
push_str("ide");
fword("device-type");
-
+
idename=get_property(ph, "name", &len);
devnum=idename[3]-0x30;
-
+
/* Create interrupt properties. */
props[0]=14; props[1]=0;
set_property(ph, "interrupts", (char *)&props, 2*sizeof(int));
-
- props[0] = __cpu_to_be32(io_ports[devnum]);
+
+ props[0] = __cpu_to_be32(io_ports[devnum]);
props[1] = __cpu_to_be32(1); props[2] = __cpu_to_be32(8);
- props[3] = __cpu_to_be32(ctl_ports[devnum]);
+ props[3] = __cpu_to_be32(ctl_ports[devnum]);
props[4] = __cpu_to_be32(1); props[5] = __cpu_to_be32(2);
set_property(ph, "reg", (char *)&props, 6*sizeof(int));
}
@@ -1335,7 +1335,7 @@
printk("ide%d: [io ports 0x%x-0x%x,0x%x]\n", i, chan->io_regs[0], chan->io_regs[0] + 7, chan->io_regs[8]);
for (j = 0; j < 2; j++) {
- struct ide_drive *drive = &chan->drives[j];
+ struct ide_drive *drive = &chan->drives[j];
char *media = "UNKNOWN";
if (!drive->present)
Modified: openbios-devel/drivers/ide.h
===================================================================
--- openbios-devel/drivers/ide.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/drivers/ide.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -189,7 +189,7 @@
*/
struct ata_command ata_cmd;
struct atapi_command atapi_cmd;
-
+
};
enum {
Modified: openbios-devel/drivers/kbd.c
===================================================================
--- openbios-devel/drivers/kbd.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/drivers/kbd.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -2,7 +2,7 @@
* <kbd.c>
*
* Open Hack'Ware BIOS generic keyboard input translation.
- *
+ *
* Copyright (c) 2005 Jocelyn Mayer
*
* This program is free software; you can redistribute it and/or
Modified: openbios-devel/drivers/kbd.h
===================================================================
--- openbios-devel/drivers/kbd.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/drivers/kbd.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -2,7 +2,7 @@
* <kbd.h>
*
* Open Hack'Ware BIOS generic keyboard management definitions.
- *
+ *
* Copyright (c) 2005 Jocelyn Mayer
*
* This program is free software; you can redistribute it and/or
@@ -25,7 +25,7 @@
typedef struct keymap_t keymap_t;
struct kbd_t {
uint32_t mod_state;
- /* Modifier state
+ /* Modifier state
* 0x00 kk ll rr
* | | | |
* Not used for now -+ | | |
Modified: openbios-devel/drivers/pci.c
===================================================================
--- openbios-devel/drivers/pci.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/drivers/pci.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,12 +1,12 @@
/*
* OpenBIOS pci driver
- *
- * This driver is compliant to the
+ *
+ * This driver is compliant to the
* PCI bus binding to IEEE 1275-1994 Rev 2.1
*
* (C) 2004 Stefan Reinauer <stepan at openbios.org>
* (C) 2005 Ed Schouten <ed at fxq.nl>
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
@@ -1274,23 +1274,23 @@
rev = pci_config_read8(addr, PCI_REVISION_ID);
/* create properties as described in 2.5 */
-
+
printk("%s\n", pci_dev->name);
set_int_property(dev, "vendor-id", vendor_id);
set_int_property(dev, "device-id", device_id);
set_int_property(dev, "revision-id", rev);
-
- set_int_property(dev, "interrupts",
+
+ set_int_property(dev, "interrupts",
pci_config_read8(addr, PCI_INTERRUPT_LINE));
-
+
set_int_property(dev, "min-grant", pci_config_read8(addr, PCI_MIN_GNT));
set_int_property(dev, "max-latency", pci_config_read8(addr, PCI_MAX_LAT));
status=pci_config_read16(addr, PCI_STATUS);
-
- set_int_property(dev, "devsel-speed",
+
+ set_int_property(dev, "devsel-speed",
(status&PCI_STATUS_DEVSEL_MASK)>>10);
-
+
if(status&PCI_STATUS_FAST_BACK)
set_bool_property(dev, "fast-back-to-back");
if(status&PCI_STATUS_66MHZ)
@@ -1299,15 +1299,15 @@
set_bool_property(dev, "udf-supported");
id=pci_config_read16(addr, PCI_SUBSYSTEM_VENDOR_ID);
- if(id)
+ if(id)
set_int_property(dev, "subsystem-vendor-id", id);
id=pci_config_read16(addr, PCI_SUBSYSTEM_ID);
- if(id)
+ if(id)
set_int_property(dev, "subsystem-id", id);
- set_int_property(dev, "cache-line-size",
+ set_int_property(dev, "cache-line-size",
pci_config_read16(addr, PCI_CACHE_LINE_SIZE));
-
+
if (pci_dev->type) {
push_str(pci_dev->type);
fword("encode-string");
@@ -1492,13 +1492,13 @@
pci_dev = pci_find_device(class, subclass, iface, vid, did);
#ifdef CONFIG_DEBUG_PCI
- printk("%x:%x.%x - %x:%x - ", bus, devnum, fn,
+ printk("%x:%x.%x - %x:%x - ", bus, devnum, fn,
vid, did);
#endif
htype = pci_config_read8(addr, PCI_HEADER_TYPE);
if (fn == 0)
is_multi = htype & 0x80;
-
+
activate_device(path);
dbus=get_cur_dev();
Modified: openbios-devel/drivers/scsi.h
===================================================================
--- openbios-devel/drivers/scsi.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/drivers/scsi.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -160,7 +160,7 @@
#define TYPE_WORM 0x04 /* Treated as ROM by our system */
#define TYPE_ROM 0x05
#define TYPE_SCANNER 0x06
-#define TYPE_MOD 0x07 /* Magneto-optical disk -
+#define TYPE_MOD 0x07 /* Magneto-optical disk -
* - treated as TYPE_DISK */
#define TYPE_MEDIUM_CHANGER 0x08
#define TYPE_COMM 0x09 /* Communications device */
@@ -247,7 +247,7 @@
* of the file.
* ---------------------------------------------------------------------------
* Local variables:
- * c-indent-level: 4
+ * c-indent-level: 4
* c-brace-imaginary-offset: 0
* c-brace-offset: -4
* c-argdecl-indent: 4
Modified: openbios-devel/drivers/timer.c
===================================================================
--- openbios-devel/drivers/timer.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/drivers/timer.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -42,9 +42,9 @@
unsigned long ticks = 0;
unsigned char portb = inb(PPC_PORTB);
- /*
- * Read the timer, and hope it hasn't wrapped around
- * (call this again within 54ms), then restart it
+ /*
+ * Read the timer, and hope it hasn't wrapped around
+ * (call this again within 54ms), then restart it
*/
outb(TIMER2_SEL | LATCH_COUNT, TIMER_MODE_PORT);
ticks = inb(TIMER2_PORT);
@@ -54,9 +54,9 @@
outb(0, TIMER2_PORT);
outb(0, TIMER2_PORT);
- /*
- * Check if the timer was running. If not,
- * result is rubbish and need to start it
+ /*
+ * Check if the timer was running. If not,
+ * result is rubbish and need to start it
*/
if (portb & PPCB_T2GATE) {
totticks += (0x10000 - ticks);
Modified: openbios-devel/drivers/vga.h
===================================================================
--- openbios-devel/drivers/vga.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/drivers/vga.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -9,7 +9,7 @@
* Based on VGA info at http://www.goodnet.com/~tinara/FreeVGA/home.htm
* Based on VESA framebuffer (c) 1998 Gerd Knorr <kraxel at goldbach.in-berlin.de>
*
- */
+ */
#ifndef VGA_H_INCL
#define VGA_H_INCL 1
@@ -164,7 +164,7 @@
/*
* vga register parameters
- * these are copied to the
+ * these are copied to the
* registers.
*
*/
@@ -187,8 +187,8 @@
struct fb_bitfield {
__u32 offset; /* beginning of bitfield */
__u32 length; /* length of bitfield */
- __u32 msb_right; /* != 0 : Most significant bit is */
- /* right */
+ __u32 msb_right; /* != 0 : Most significant bit is */
+ /* right */
};
struct screeninfo {
@@ -205,7 +205,7 @@
struct fb_bitfield red; /* bitfield in fb mem if true color, */
struct fb_bitfield green; /* else only length is significant */
struct fb_bitfield blue;
- struct fb_bitfield transp; /* transparency */
+ struct fb_bitfield transp; /* transparency */
__u32 nonstd; /* != 0 Non standard pixel format */
Modified: openbios-devel/drivers/vga_load_regs.c
===================================================================
--- openbios-devel/drivers/vga_load_regs.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/drivers/vga_load_regs.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -42,7 +42,7 @@
}
u8 read_att_b(u16 addr) {
inb(IS1_RC);
- inb(0x80);
+ inb(0x80);
outb(addr,ATT_IW);
return inb(ATT_R);
}
@@ -131,7 +131,7 @@
48, 16, 39, 8, // margins left,right,upper,lower
96, // hsync length
- 2, // vsync length
+ 2, // vsync length
0, // sync polarity
0, // non interlaced, single mode
{0,0,0,0,0,0} // compatibility
@@ -144,7 +144,7 @@
static int vga_decode_var(const struct screeninfo *var,
struct vga_par *par)
{
- u8 VgaAttributeTable[16] =
+ u8 VgaAttributeTable[16] =
{ 0x000, 0x001, 0x002, 0x003, 0x004, 0x005, 0x014, 0x007, 0x038, 0x039, 0x03A, 0x03B, 0x03C, 0x03D, 0x03E, 0x03F};
u32 xres, right, hslen, left, xtotal;
@@ -272,7 +272,7 @@
par->crtc[CRTC_OFFSET] = vxres >> 1;
// put the underline off of the character, necessary in alpha color mode
- par->crtc[CRTC_UNDERLINE] = 0x1f;
+ par->crtc[CRTC_UNDERLINE] = 0x1f;
par->crtc[CRTC_MODE] = rMode | 0xA3; // word mode
par->crtc[CRTC_LINE_COMPARE] = 0xFF;
@@ -292,22 +292,22 @@
par->atc[ATC_PLANE_ENABLE] = 0x0F;
par->atc[ATC_PEL] = xoffset & 7;
par->atc[ATC_COLOR_PAGE] = 0x00;
-
+
par->misc = 0x67; /* enable CPU, ports 0x3Dx, positive sync*/
if (var->sync & SYNC_HOR_HIGH_ACT)
par->misc &= ~0x40;
if (var->sync & SYNC_VERT_HIGH_ACT)
par->misc &= ~0x80;
-
+
par->seq[SEQ_CLOCK_MODE] = 0x01; //8-bit char; 0x01=alpha mode
par->seq[SEQ_PLANE_WRITE] = 0x03; // just char/attr plane
par->seq[SEQ_CHARACTER_MAP] = 0x00;
par->seq[SEQ_MEMORY_MODE] = 0x02; // A/G bit not used in stpc; O/E on, C4 off
-
+
par->gdc[GDC_SR_VALUE] = 0x00;
// bits set in the SR_EN regs will enable set/reset action
// based on the bit settings in the SR_VAL register
- par->gdc[GDC_SR_ENABLE] = 0x00;
+ par->gdc[GDC_SR_ENABLE] = 0x00;
par->gdc[GDC_COMPARE_VALUE] = 0x00;
par->gdc[GDC_DATA_ROTATE] = 0x00;
par->gdc[GDC_PLANE_READ] = 0;
@@ -333,7 +333,7 @@
*
* Write the data in the vga parameter structure
* to the vga registers, along with other default
- * settings.
+ * settings.
*
*/
static int vga_set_regs(const struct vga_par *par)
@@ -342,7 +342,7 @@
/* update misc output register */
outb(par->misc, MIS_W);
-
+
/* synchronous reset on */
outb(0x00, SEQ_I);
outb(0x00, SEQ_D);
@@ -354,11 +354,11 @@
outb(i, SEQ_I);
outb(par->seq[i], SEQ_D);
}
-
+
/* synchronous reset off */
outb(0x00, SEQ_I);
outb(0x03, SEQ_D);
-
+
/* deprotect CRT registers 0-7 */
outb(0x11, CRT_IC);
outb(par->crtc[0x11], CRT_DC);
@@ -373,7 +373,7 @@
outb(i, GRA_I);
outb(par->gdc[i], GRA_D);
}
-
+
/* write attribute controller registers */
for (i = 0; i < ATT_C; i++) {
inb(IS1_RC); /* reset flip-flop */
@@ -412,7 +412,7 @@
// turn on display, disable access to attr palette
inb(IS1_RC);
outb(0x20, ATT_IW);
-
+
return 0;
}
Modified: openbios-devel/fs/grubfs/defs.h
===================================================================
--- openbios-devel/fs/grubfs/defs.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/grubfs/defs.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,25 +1,25 @@
-/*
+/*
* Mach Operating System
* Copyright (c) 1991,1990 Carnegie Mellon University
* All Rights Reserved.
- *
+ *
* Permission to use, copy, modify and distribute this software and its
* documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
- *
+ *
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
+ *
* Carnegie Mellon requests users of this software to return to
- *
+ *
* Software Distribution Coordinator or Software.Distribution at CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
- *
+ *
* any improvements or extensions that they make and grant Carnegie Mellon
* the rights to redistribute these changes.
*/
Modified: openbios-devel/fs/grubfs/dir.h
===================================================================
--- openbios-devel/fs/grubfs/dir.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/grubfs/dir.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,26 +1,26 @@
-/*
+/*
* Mach Operating System
* Copyright (c) 1991,1990 Carnegie Mellon University
* All Rights Reserved.
- *
+ *
* Permission to use, copy, modify and distribute this software and its
* documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
- *
+ *
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
+ *
* Carnegie Mellon requests users of this software to return to
- *
+ *
* Software Distribution Coordinator or Software.Distribution at CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
- *
+ *
* any improvements or extensions that they make and grant Carnegie Mellon
* the rights to redistribute these changes.
*/
Modified: openbios-devel/fs/grubfs/disk_inode_ffs.h
===================================================================
--- openbios-devel/fs/grubfs/disk_inode_ffs.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/grubfs/disk_inode_ffs.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,25 +1,25 @@
-/*
+/*
* Mach Operating System
* Copyright (c) 1991,1990 Carnegie Mellon University
* All Rights Reserved.
- *
+ *
* Permission to use, copy, modify and distribute this software and its
* documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
- *
+ *
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
+ *
* Carnegie Mellon requests users of this software to return to
- *
+ *
* Software Distribution Coordinator or Software.Distribution at CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
- *
+ *
* any improvements or extensions that they make and grant Carnegie Mellon
* the rights to redistribute these changes.
*/
Modified: openbios-devel/fs/grubfs/filesys.h
===================================================================
--- openbios-devel/fs/grubfs/filesys.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/grubfs/filesys.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,4 +1,4 @@
-/* GRUB compatibility header
+/* GRUB compatibility header
*
* taken from filo and grub.
*/
@@ -76,21 +76,21 @@
/* assume 8 bits per byte. */
unsigned int i = 1 << (sizeof(word)*8 - 1);
unsigned int pow = sizeof(word) * 8 - 1;
-
+
if (! word) {
/* invalid parameter */
return -1;
}
for(; i > word; i >>= 1, pow--) ;
-
- return pow;
+
+ return pow;
}
#define ffz(n) log2(~(n))
#endif
-static inline int
+static inline int
substring (const char *s1, const char *s2)
{
while (*s1 == *s2)
@@ -115,7 +115,7 @@
#define MAXINT 0x7fffffff
/* This is only used by fsys_* to determine if it's hard disk. If it is,
- * they try to guess filesystem type by partition type. I guess it is
+ * they try to guess filesystem type by partition type. I guess it is
* not necessory, so hardcoded to 0 (first floppy) --ts1 */
#define current_drive 0
#define current_slice 0
Modified: openbios-devel/fs/grubfs/fs.h
===================================================================
--- openbios-devel/fs/grubfs/fs.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/grubfs/fs.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,25 +1,25 @@
-/*
+/*
* Mach Operating System
* Copyright (c) 1991,1990 Carnegie Mellon University
* All Rights Reserved.
- *
+ *
* Permission to use, copy, modify and distribute this software and its
* documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
- *
+ *
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
+ *
* Carnegie Mellon requests users of this software to return to
- *
+ *
* Software Distribution Coordinator or Software.Distribution at CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
- *
+ *
* any improvements or extensions that they make and grant Carnegie Mellon
* the rights to redistribute these changes.
*/
@@ -75,7 +75,7 @@
/*
* Addresses stored in inodes are capable of addressing fragments
- * of `blocks'. File system blocks of at most size MAXBSIZE can
+ * of `blocks'. File system blocks of at most size MAXBSIZE can
* be optionally broken into 2, 4, or 8 pieces, each of which is
* addressible; these pieces may be DEV_BSIZE, or some multiple of
* a DEV_BSIZE unit.
@@ -113,7 +113,7 @@
/*
* The path name on which the file system is mounted is maintained
- * in fs_fsmnt. MAXMNTLEN defines the amount of space allocated in
+ * in fs_fsmnt. MAXMNTLEN defines the amount of space allocated in
* the super block for this name.
* The limit on the amount of summary information per file system
* is defined by MAXCSBUFS. It is currently parameterized for a
Modified: openbios-devel/fs/grubfs/fsys_affs.c
===================================================================
--- openbios-devel/fs/grubfs/fsys_affs.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/grubfs/fsys_affs.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -92,7 +92,7 @@
#define ST_FILE -3
#define ST_ROOT 1
-#define ST_USERDIR 2
+#define ST_USERDIR 2
struct BootBlock{
int id;
@@ -465,7 +465,7 @@
static unsigned int getHashKey(char *name,unsigned int tablesize, unsigned char flags)
{
unsigned int length;
-
+
length=0;
while (name[length] != 0)
length++;
@@ -667,7 +667,7 @@
if (print_possibilities>0)
print_possibilities = -print_possibilities;
#endif
- }
+ }
else
{
errnum = ERR_BAD_FILETYPE;
@@ -689,7 +689,7 @@
while (*current && !isspace(*current))
*fname++ = *current++;
*fname = 0;
-
+
errnum = findBlock(filename, &buffer2);
if (errnum)
return 0;
Modified: openbios-devel/fs/grubfs/fsys_ext2fs.c
===================================================================
--- openbios-devel/fs/grubfs/fsys_ext2fs.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/grubfs/fsys_ext2fs.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -285,7 +285,7 @@
printf(" flags=%d\n", __le32_to_cpu(i->i_flags));
}
-void
+void
dump_inode_data(unsigned char *inode, int len)
{
static char hexdigit[] = "0123456789abcdef";
@@ -333,8 +333,8 @@
ext2_rdfsb (int fsblock, char * buffer)
{
#ifdef E2DEBUG
- printf ("ext2_rdfsb: fsblock %d, devblock %d, size %d\n", fsblock,
- fsblock * (EXT2_BLOCK_SIZE (SUPERBLOCK) / DEV_BSIZE),
+ printf ("ext2_rdfsb: fsblock %d, devblock %d, size %d\n", fsblock,
+ fsblock * (EXT2_BLOCK_SIZE (SUPERBLOCK) / DEV_BSIZE),
EXT2_BLOCK_SIZE (SUPERBLOCK));
#endif /* E2DEBUG */
return devread (fsblock * (EXT2_BLOCK_SIZE (SUPERBLOCK) / DEV_BSIZE), 0,
@@ -574,14 +574,14 @@
#ifdef E2DEBUG
dump_group_desc(GROUP_DESC);
-#endif /* E2DEBUG */
+#endif /* E2DEBUG */
gdp = GROUP_DESC;
ino_blk = __le32_to_cpu(gdp[desc].bg_inode_table) +
(((current_ino - 1) % __le32_to_cpu(SUPERBLOCK->s_inodes_per_group))
>> log2 (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode)));
#ifdef E2DEBUG
- printf ("ext2fs_dir: itab_blk=%d, i_in_grp=%d, log2=%d\n",
+ printf ("ext2fs_dir: itab_blk=%d, i_in_grp=%d, log2=%d\n",
__le32_to_cpu(gdp[desc].bg_inode_table),
((current_ino - 1) % __le32_to_cpu(SUPERBLOCK->s_inodes_per_group)),
log2 (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode)));
Modified: openbios-devel/fs/grubfs/fsys_fat.c
===================================================================
--- openbios-devel/fs/grubfs/fsys_fat.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/grubfs/fsys_fat.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -23,7 +23,7 @@
#include "filesys.h"
#include "fat.h"
-struct fat_superblock
+struct fat_superblock
{
int fat_offset;
int fat_length;
@@ -31,7 +31,7 @@
int root_offset;
int root_max;
int data_offset;
-
+
int num_sectors;
int num_clust;
int clust_eof_marker;
@@ -39,7 +39,7 @@
int sectsize_bits;
int clustsize_bits;
int root_cluster;
-
+
int cached_fat;
int file_cluster;
int current_cluster_num;
@@ -59,13 +59,13 @@
{
struct fat_bpb bpb;
__u32 magic, first_fat;
-
+
/* Check partition type for harddisk */
if (((current_drive & 0x80) || (current_slice != 0))
&& ! IS_PC_SLICE_TYPE_FAT (current_slice)
&& (! IS_PC_SLICE_TYPE_BSD_WITH_FS (current_slice, FS_MSDOS)))
return 0;
-
+
/* Read bpb */
if (! devread (0, 0, sizeof (bpb), (char *) &bpb))
return 0;
@@ -74,40 +74,40 @@
zero division. */
if (bpb.sects_per_clust == 0)
return 0;
-
+
FAT_SUPER->sectsize_bits = log2 (bpb.bytes_per_sect);
FAT_SUPER->clustsize_bits
= FAT_SUPER->sectsize_bits + log2 (bpb.sects_per_clust);
-
+
/* Fill in info about super block */
- FAT_SUPER->num_sectors = bpb.short_sectors
+ FAT_SUPER->num_sectors = bpb.short_sectors
? bpb.short_sectors : bpb.long_sectors;
-
+
/* FAT offset and length */
FAT_SUPER->fat_offset = bpb.reserved_sects;
- FAT_SUPER->fat_length =
+ FAT_SUPER->fat_length =
bpb.fat_length ? bpb.fat_length : bpb.fat32_length;
-
+
/* Rootdir offset and length for FAT12/16 */
- FAT_SUPER->root_offset =
+ FAT_SUPER->root_offset =
FAT_SUPER->fat_offset + bpb.num_fats * FAT_SUPER->fat_length;
FAT_SUPER->root_max = FAT_DIRENTRY_LENGTH * bpb.dir_entries;
-
+
/* Data offset and number of clusters */
- FAT_SUPER->data_offset =
+ FAT_SUPER->data_offset =
FAT_SUPER->root_offset
+ ((FAT_SUPER->root_max - 1) >> FAT_SUPER->sectsize_bits) + 1;
- FAT_SUPER->num_clust =
- 2 + ((FAT_SUPER->num_sectors - FAT_SUPER->data_offset)
+ FAT_SUPER->num_clust =
+ 2 + ((FAT_SUPER->num_sectors - FAT_SUPER->data_offset)
/ bpb.sects_per_clust);
FAT_SUPER->sects_per_clust = bpb.sects_per_clust;
-
+
if (!bpb.fat_length)
{
/* This is a FAT32 */
if (bpb.dir_entries)
return 0;
-
+
if (bpb.flags & 0x0080)
{
/* FAT mirroring is disabled, get active FAT */
@@ -116,34 +116,34 @@
return 0;
FAT_SUPER->fat_offset += active_fat * FAT_SUPER->fat_length;
}
-
+
FAT_SUPER->fat_size = 8;
FAT_SUPER->root_cluster = bpb.root_cluster;
/* Yes the following is correct. FAT32 should be called FAT28 :) */
FAT_SUPER->clust_eof_marker = 0xffffff8;
- }
- else
+ }
+ else
{
if (!FAT_SUPER->root_max)
return 0;
-
+
FAT_SUPER->root_cluster = -1;
- if (FAT_SUPER->num_clust > FAT_MAX_12BIT_CLUST)
+ if (FAT_SUPER->num_clust > FAT_MAX_12BIT_CLUST)
{
FAT_SUPER->fat_size = 4;
FAT_SUPER->clust_eof_marker = 0xfff8;
- }
+ }
else
{
FAT_SUPER->fat_size = 3;
FAT_SUPER->clust_eof_marker = 0xff8;
}
}
-
-
+
+
/* Now do some sanity checks */
-
+
if (bpb.bytes_per_sect != (1 << FAT_SUPER->sectsize_bits)
|| bpb.bytes_per_sect != SECTOR_SIZE
|| bpb.sects_per_clust != (1 << (FAT_SUPER->clustsize_bits
@@ -152,7 +152,7 @@
|| (FAT_SUPER->fat_size * FAT_SUPER->num_clust / (2 * SECTOR_SIZE)
> FAT_SUPER->fat_length))
return 0;
-
+
/* kbs: Media check on first FAT entry [ported from PUPA] */
if (!devread(FAT_SUPER->fat_offset, 0,
@@ -189,7 +189,7 @@
int offset;
int ret = 0;
int size;
-
+
if (FAT_SUPER->file_cluster < 0)
{
/* root directory for fat16 */
@@ -201,7 +201,7 @@
filepos += size;
return size;
}
-
+
logical_clust = filepos >> FAT_SUPER->clustsize_bits;
offset = (filepos & ((1 << FAT_SUPER->clustsize_bits) - 1));
if (logical_clust < FAT_SUPER->current_cluster_num)
@@ -209,19 +209,19 @@
FAT_SUPER->current_cluster_num = 0;
FAT_SUPER->current_cluster = FAT_SUPER->file_cluster;
}
-
+
while (len > 0)
{
int sector;
while (logical_clust > FAT_SUPER->current_cluster_num)
{
/* calculate next cluster */
- int fat_entry =
+ int fat_entry =
FAT_SUPER->current_cluster * FAT_SUPER->fat_size;
int next_cluster;
int cached_pos = (fat_entry - FAT_SUPER->cached_fat);
-
- if (cached_pos < 0 ||
+
+ if (cached_pos < 0 ||
(cached_pos + FAT_SUPER->fat_size) > 2*FAT_CACHE_SIZE)
{
FAT_SUPER->cached_fat = (fat_entry & ~(2*SECTOR_SIZE - 1));
@@ -240,7 +240,7 @@
}
else if (FAT_SUPER->fat_size == 4)
next_cluster &= 0xFFFF;
-
+
if (next_cluster >= FAT_SUPER->clust_eof_marker)
return ret;
if (next_cluster < 2 || next_cluster >= FAT_SUPER->num_clust)
@@ -248,24 +248,24 @@
errnum = ERR_FSYS_CORRUPT;
return 0;
}
-
+
FAT_SUPER->current_cluster = next_cluster;
FAT_SUPER->current_cluster_num++;
}
-
+
sector = FAT_SUPER->data_offset +
((FAT_SUPER->current_cluster - 2) << (FAT_SUPER->clustsize_bits
- FAT_SUPER->sectsize_bits));
size = (1 << FAT_SUPER->clustsize_bits) - offset;
if (size > len)
size = len;
-
+
disk_read_func = disk_read_hook;
-
+
devread(sector, offset, size, buf);
-
+
disk_read_func = NULL;
-
+
len -= size;
buf += size;
ret += size;
@@ -285,25 +285,25 @@
#ifndef STAGE1_5
int do_possibilities = 0;
#endif
-
+
/* XXX I18N:
- * the positions 2,4,6 etc are high bytes of a 16 bit unicode char
+ * the positions 2,4,6 etc are high bytes of a 16 bit unicode char
*/
- static unsigned char longdir_pos[] =
+ static unsigned char longdir_pos[] =
{ 1, 3, 5, 7, 9, 14, 16, 18, 20, 22, 24, 28, 30 };
int slot = -2;
int alias_checksum = -1;
-
+
FAT_SUPER->file_cluster = FAT_SUPER->root_cluster;
filepos = 0;
FAT_SUPER->current_cluster_num = MAXINT;
-
+
/* main loop to find desired directory entry */
loop:
-
+
/* if we have a real file (and we're not just printing possibilities),
then this is where we want to exit */
-
+
if (!*dirname || isspace (*dirname))
{
if (attrib & FAT_ATTRIB_DIR)
@@ -311,15 +311,15 @@
errnum = ERR_BAD_FILETYPE;
return 0;
}
-
+
return 1;
}
-
+
/* continue with the file/directory name interpretation */
-
+
while (*dirname == '/')
dirname++;
-
+
if (!(attrib & FAT_ATTRIB_DIR))
{
errnum = ERR_BAD_FILETYPE;
@@ -327,16 +327,16 @@
}
/* Directories don't have a file size */
filemax = MAXINT;
-
+
for (rest = dirname; (ch = *rest) && !isspace (ch) && ch != '/'; rest++);
-
+
*rest = 0;
-
+
# ifndef STAGE1_5
if (print_possibilities && ch != '/')
do_possibilities = 1;
# endif
-
+
while (1)
{
if (fat_read (dir_buf, FAT_DIRENTRY_LENGTH) != FAT_DIRENTRY_LENGTH
@@ -353,14 +353,14 @@
return 1;
}
# endif /* STAGE1_5 */
-
+
errnum = ERR_FILE_NOT_FOUND;
*rest = ch;
}
-
+
return 0;
}
-
+
if (FAT_DIRENTRY_ATTRIB (dir_buf) == FAT_ATTRIB_LONGNAME)
{
/* This is a long filename. The filename is build from back
@@ -377,72 +377,72 @@
*/
int i, offset;
unsigned char id = FAT_LONGDIR_ID(dir_buf);
-
- if ((id & 0x40))
+
+ if ((id & 0x40))
{
id &= 0x3f;
slot = id;
filename[slot * 13] = 0;
alias_checksum = FAT_LONGDIR_ALIASCHECKSUM(dir_buf);
- }
-
+ }
+
if (id != slot || slot == 0
|| alias_checksum != FAT_LONGDIR_ALIASCHECKSUM(dir_buf))
{
alias_checksum = -1;
continue;
}
-
+
slot--;
offset = slot * 13;
-
+
for (i=0; i < 13; i++)
filename[offset+i] = dir_buf[longdir_pos[i]];
continue;
}
-
+
if (!FAT_DIRENTRY_VALID (dir_buf))
continue;
-
+
if (alias_checksum != -1 && slot == 0)
{
int i;
unsigned char sum;
-
+
slot = -2;
for (sum = 0, i = 0; i< 11; i++)
sum = ((sum >> 1) | (sum << 7)) + dir_buf[i];
-
+
if (sum == alias_checksum)
{
# ifndef STAGE1_5
if (do_possibilities)
goto print_filename;
# endif /* STAGE1_5 */
-
+
if (substring (dirname, filename) == 0)
break;
}
}
-
+
/* XXX convert to 8.3 filename format here */
{
int i, j, c;
-
+
for (i = 0; i < 8 && (c = filename[i] = tolower (dir_buf[i]))
&& !isspace (c); i++);
-
+
filename[i++] = '.';
-
+
for (j = 0; j < 3 && (c = filename[i + j] = tolower (dir_buf[8 + j]))
&& !isspace (c); j++);
-
+
if (j == 0)
i--;
-
+
filename[i + j] = 0;
}
-
+
# ifndef STAGE1_5
if (do_possibilities)
{
@@ -456,19 +456,19 @@
continue;
}
# endif /* STAGE1_5 */
-
+
if (substring (dirname, filename) == 0)
break;
}
-
+
*(dirname = rest) = ch;
-
+
attrib = FAT_DIRENTRY_ATTRIB (dir_buf);
filemax = FAT_DIRENTRY_FILELENGTH (dir_buf);
filepos = 0;
FAT_SUPER->file_cluster = FAT_DIRENTRY_FIRST_CLUSTER (dir_buf);
FAT_SUPER->current_cluster_num = MAXINT;
-
+
/* go back to main loop at top of function */
goto loop;
}
Modified: openbios-devel/fs/grubfs/fsys_ffs.c
===================================================================
--- openbios-devel/fs/grubfs/fsys_ffs.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/grubfs/fsys_ffs.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -91,7 +91,7 @@
mapblock = -1;
mapblock_offset = -1;
-
+
return retval;
}
@@ -99,10 +99,10 @@
block_map (int file_block)
{
int bnum, offset, bsize;
-
+
if (file_block < NDADDR)
return (INODE->i_db[file_block]);
-
+
/* If the blockmap loaded does not include FILE_BLOCK,
load a new blockmap. */
if ((bnum = fsbtodb (SUPERBLOCK, INODE->i_ib[0])) != mapblock
@@ -112,7 +112,7 @@
{
offset = ((file_block - NDADDR) % NINDIR (SUPERBLOCK));
bsize = MAPBUF_LEN;
-
+
if (offset + MAPBUF_LEN > SUPERBLOCK->fs_bsize)
offset = (SUPERBLOCK->fs_bsize - MAPBUF_LEN) / sizeof (int);
}
@@ -121,7 +121,7 @@
bsize = SUPERBLOCK->fs_bsize;
offset = 0;
}
-
+
if (! devread (bnum, offset * sizeof (int), bsize, (char *) MAPBUF))
{
mapblock = -1;
@@ -130,12 +130,12 @@
errnum = ERR_FSYS_CORRUPT;
return -1;
}
-
+
mapblock = bnum;
mapblock_bsize = bsize;
mapblock_offset = offset;
}
-
+
return (((int *) MAPBUF)[((file_block - NDADDR) % NINDIR (SUPERBLOCK))
- mapblock_offset]);
}
@@ -145,7 +145,7 @@
ffs_read (char *buf, int len)
{
int logno, off, size, map, ret = 0;
-
+
while (len && !errnum)
{
off = blkoff (SUPERBLOCK, filepos);
@@ -296,7 +296,7 @@
familiar with BSD should check for this. */
if (needed_sectors > 14)
return 0;
-
+
*start_sector = 1;
#if 1
/* FIXME: Disable the embedding in FFS until someone checks if
Modified: openbios-devel/fs/grubfs/fsys_iso9660.c
===================================================================
--- openbios-devel/fs/grubfs/fsys_iso9660.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/grubfs/fsys_iso9660.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -82,7 +82,7 @@
*/
for (sector = 16 ; sector < 32 ; sector++)
{
- if (!iso9660_devread(sector, 0, sizeof(*PRIMDESC), (char *)PRIMDESC))
+ if (!iso9660_devread(sector, 0, sizeof(*PRIMDESC), (char *)PRIMDESC))
break;
/* check ISO_VD_PRIMARY and ISO_STANDARD_ID */
if (CHECK4(&PRIMDESC->type, ISO_VD_PRIMARY, 'C', 'D', '0')
Modified: openbios-devel/fs/grubfs/fsys_jfs.c
===================================================================
--- openbios-devel/fs/grubfs/fsys_jfs.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/grubfs/fsys_jfs.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,5 +1,5 @@
/* fsys_jfs.c - an implementation for the IBM JFS file system */
-/*
+/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2001,2002 Free Software Foundation, Inc.
*
@@ -240,7 +240,7 @@
offset = offsetXAD (xad);
xadlen = lengthXAD (xad);
if (isinxt (filepos >> jfs.l2bsize, offset, xadlen)) {
- endofcur = (offset + xadlen) << jfs.l2bsize;
+ endofcur = (offset + xadlen) << jfs.l2bsize;
toread = (endofcur >= endpos)
? len : (endofcur - filepos);
@@ -262,7 +262,7 @@
}
continue;
}
- endofprev = offset + xadlen;
+ endofprev = offset + xadlen;
xad = next_extent ();
} while (len > 0 && xad);
Modified: openbios-devel/fs/grubfs/fsys_minix.c
===================================================================
--- openbios-devel/fs/grubfs/fsys_minix.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/grubfs/fsys_minix.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -20,7 +20,7 @@
/* Restrictions:
This is MINIX V1 only (yet)
Disk creation is like:
- mkfs.minix -c DEVICE
+ mkfs.minix -c DEVICE
*/
#ifdef FSYS_MINIX
@@ -75,7 +75,7 @@
#define MINIX_V1 0x0001 /* original minix fs */
#define MINIX_V2 0x0002 /* minix V2 fs */
-/* originally this is :
+/* originally this is :
#define INODE_VERSION(inode) inode->i_sb->u.minix_sb.s_version
here we have */
#define INODE_VERSION(inode) (SUPERBLOCK->s_version)
@@ -164,15 +164,15 @@
&& ! IS_PC_SLICE_TYPE_MINIX (current_slice)
&& ! IS_PC_SLICE_TYPE_BSD_WITH_FS (current_slice, FS_OTHER))
return 0; /* The partition is not of MINIX type */
-
+
if (part_length < (SBLOCK +
(sizeof (struct minix_super_block) / DEV_BSIZE)))
return 0; /* The partition is too short */
-
+
if (!devread (SBLOCK, 0, sizeof (struct minix_super_block),
(char *) SUPERBLOCK))
return 0; /* Cannot read superblock */
-
+
switch (SUPERBLOCK->s_magic)
{
case MINIX_SUPER_MAGIC:
@@ -210,7 +210,7 @@
if (logical_block < 512)
{
i = INODE->i_zone[7];
-
+
if (!i || ((mapblock1 != 1)
&& !minix_rdfsb (i, DATABLOCK1)))
{
@@ -311,7 +311,7 @@
char * rest;
char ch;
- int off; /* offset within block of directory
+ int off; /* offset within block of directory
entry */
int loc; /* location within a directory */
int blk; /* which data blk within dir entry */
@@ -326,7 +326,7 @@
#ifdef DEBUG_MINIX
printf ("\n");
-#endif
+#endif
while (1)
{
@@ -345,7 +345,7 @@
raw_inode = INODE + ((current_ino - 1) % MINIX_INODES_PER_BLOCK);
/* copy inode to fixed location */
- memmove ((void *) INODE, (void *) raw_inode,
+ memmove ((void *) INODE, (void *) raw_inode,
sizeof (struct minix_inode));
/* If we've got a symbolic link, then chase it. */
@@ -430,7 +430,7 @@
while (*dirname == '/')
dirname++;
- /* if this isn't a directory of sufficient size to hold our file,
+ /* if this isn't a directory of sufficient size to hold our file,
abort */
if (!(INODE->i_size) || !S_ISDIR (INODE->i_mode))
{
Modified: openbios-devel/fs/grubfs/fsys_ntfs.c
===================================================================
--- openbios-devel/fs/grubfs/fsys_ntfs.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/grubfs/fsys_ntfs.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -431,7 +431,7 @@
{
#ifdef DEBUG_NTFS
printf("searching attribute %x <%s>\n", type, name);
-#endif
+#endif
mftr->attr_type = type;
mftr->attr_name = name;
@@ -907,7 +907,7 @@
ret += len0;
}
#else
- errnum = FSYS_CORRUPT;
+ errnum = FSYS_CORRUPT;
#endif /*NO_NTFS_DECOMPRESSION*/
#endif /*STAGE1_5*/
return ret;
Modified: openbios-devel/fs/grubfs/fsys_reiserfs.c
===================================================================
--- openbios-devel/fs/grubfs/fsys_reiserfs.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/grubfs/fsys_reiserfs.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -96,9 +96,9 @@
/* this header block gets written whenever a transaction is considered
fully flushed, and is more recent than the last fully flushed
- transaction.
+ transaction.
fully flushed means all the log blocks and all the real blocks are
- on disk, and this transaction does not need to be replayed.
+ on disk, and this transaction does not need to be replayed.
*/
struct reiserfs_journal_header {
/* id of last fully flushed transaction */
@@ -110,7 +110,7 @@
};
/* magic string to find desc blocks in the journal */
-#define JOURNAL_DESC_MAGIC "ReIsErLB"
+#define JOURNAL_DESC_MAGIC "ReIsErLB"
/*
@@ -127,7 +127,7 @@
* hashing the name and using few bits (23 or more) of the resulting
* hash, and generation number that allows distinguishing names with
* hash collisions. If number of collisions overflows generation
- * number, we return EEXIST. High order bit is 0 always
+ * number, we return EEXIST. High order bit is 0 always
*/
__u32 k_offset;
__u32 k_uniqueness;
@@ -144,7 +144,7 @@
* hashing the name and using few bits (23 or more) of the resulting
* hash, and generation number that allows distinguishing names with
* hash collisions. If number of collisions overflows generation
- * number, we return EEXIST. High order bit is 0 always
+ * number, we return EEXIST. High order bit is 0 always
*/
__u64 k_offset:60;
__u64 k_type: 4;
@@ -171,7 +171,7 @@
/* Header of a disk block. More precisely, header of a formatted leaf
or internal node, and not the header of an unformatted node. */
struct block_head
-{
+{
__u16 blk_level; /* Level of a block in the tree. */
__u16 blk_nr_item; /* Number of keys/items in a block. */
__u16 blk_free_space; /* Block free space in bytes. */
@@ -184,7 +184,7 @@
struct item_head
{
struct key ih_key; /* Everything in the tree is found by searching for it based on its key.*/
-
+
union
{
__u16 ih_free_space; /* The free space in the last unformatted node of an indirect item if this
@@ -197,8 +197,8 @@
u;
__u16 ih_item_len; /* total size of the item body */
__u16 ih_item_location; /* an offset to the item body within the block */
- __u16 ih_version; /* ITEM_VERSION_1 for all old items,
- ITEM_VERSION_2 for new ones.
+ __u16 ih_version; /* ITEM_VERSION_1 for all old items,
+ ITEM_VERSION_2 for new ones.
Highest bit is set by fsck
temporary, cleaned after all done */
};
@@ -268,7 +268,7 @@
#define V2_TYPE_STAT_DATA 0
#define V2_TYPE_INDIRECT 1
#define V2_TYPE_DIRECT 2
-#define V2_TYPE_DIRENTRY 3
+#define V2_TYPE_DIRENTRY 3
#define REISERFS_ROOT_OBJECTID 2
#define REISERFS_ROOT_PARENT_OBJECTID 1
@@ -327,7 +327,7 @@
__u16 cached_slots;
/* The number of valid transactions in journal */
__u16 journal_transactions;
-
+
unsigned int blocks[MAX_HEIGHT];
unsigned int next_key_nr[MAX_HEIGHT];
};
@@ -348,13 +348,13 @@
*/
#define INFO \
((struct fsys_reiser_info *) ((char *) FSYS_BUF + FSYSREISER_CACHE_SIZE))
-/*
+/*
* The journal cache. For each transaction it contains the number of
- * blocks followed by the real block numbers of this transaction.
+ * blocks followed by the real block numbers of this transaction.
*
* If the block numbers of some transaction won't fit in this space,
* this list is stopped with a 0xffffffff marker and the remaining
- * uncommitted transactions aren't cached.
+ * uncommitted transactions aren't cached.
*/
#define JOURNAL_START ((__u32 *) (INFO + 1))
#define JOURNAL_END ((__u32 *) (FSYS_BUF + FSYS_BUFLEN))
@@ -365,16 +365,16 @@
return (word & -word) == word;
}
-static int
-journal_read (int block, int len, char *buffer)
+static int
+journal_read (int block, int len, char *buffer)
{
- return devread ((INFO->journal_block + block) << INFO->blocksize_shift,
+ return devread ((INFO->journal_block + block) << INFO->blocksize_shift,
0, len, buffer);
}
/* Read a block from ReiserFS file system, taking the journal into
* account. If the block nr is in the journal, the block from the
- * journal taken.
+ * journal taken.
*/
static int
block_read (int blockNr, int start, int len, char *buffer)
@@ -384,7 +384,7 @@
int journal_mask = INFO->journal_block_count - 1;
int translatedNr = blockNr;
__u32 *journal_table = JOURNAL_START;
- while (transactions-- > 0)
+ while (transactions-- > 0)
{
int i = 0;
int j_len;
@@ -416,11 +416,11 @@
while (i < j_len && i < JOURNAL_TRANS_HALF)
if (desc.j_realblock[i++] == blockNr)
goto found;
-
+
if (j_len >= JOURNAL_TRANS_HALF)
{
int commit_block = (desc_block + 1 + j_len) & journal_mask;
- if (! journal_read (commit_block,
+ if (! journal_read (commit_block,
sizeof (commit), (char *) &commit))
return 0;
while (i < j_len)
@@ -429,11 +429,11 @@
}
}
goto not_found;
-
+
found:
translatedNr = INFO->journal_block + ((desc_block + i) & journal_mask);
#ifdef REISERDEBUG
- printf ("block_read: block %d is mapped to journal block %d.\n",
+ printf ("block_read: block %d is mapped to journal block %d.\n",
blockNr, translatedNr - INFO->journal_block);
#endif
/* We must continue the search, as this block may be overwritten
@@ -450,8 +450,8 @@
* we can still read the rest from the disk on demand.
*
* The first number of valid transactions and the descriptor block of the
- * first valid transaction are held in INFO. The transactions are all
- * adjacent, but we must take care of the journal wrap around.
+ * first valid transaction are held in INFO. The transactions are all
+ * adjacent, but we must take care of the journal wrap around.
*/
static int
journal_init (void)
@@ -474,11 +474,11 @@
next_trans_id = header.j_last_flush_trans_id + 1;
#ifdef REISERDEBUG
- printf ("journal_init: last flushed %d\n",
+ printf ("journal_init: last flushed %d\n",
header.j_last_flush_trans_id);
#endif
- while (1)
+ while (1)
{
journal_read (desc_block, sizeof (desc), (char *) &desc);
if (substring (JOURNAL_DESC_MAGIC, desc.j_magic) > 0
@@ -486,16 +486,16 @@
|| desc.j_mount_id != header.j_mount_id)
/* no more valid transactions */
break;
-
+
commit_block = (desc_block + desc.j_len + 1) & (block_count - 1);
journal_read (commit_block, sizeof (commit), (char *) &commit);
if (desc.j_trans_id != commit.j_trans_id
|| desc.j_len != commit.j_len)
/* no more valid transactions */
break;
-
+
#ifdef REISERDEBUG
- printf ("Found valid transaction %d/%d at %d.\n",
+ printf ("Found valid transaction %d/%d at %d.\n",
desc.j_trans_id, desc.j_mount_id, desc_block);
#endif
@@ -521,7 +521,7 @@
{
*journal_table++ = desc.j_realblock[i];
#ifdef REISERDEBUG
- printf ("block %d is in journal %d.\n",
+ printf ("block %d is in journal %d.\n",
desc.j_realblock[i], desc_block);
#endif
}
@@ -529,8 +529,8 @@
{
*journal_table++ = commit.j_realblock[i-JOURNAL_TRANS_HALF];
#ifdef REISERDEBUG
- printf ("block %d is in journal %d.\n",
- commit.j_realblock[i-JOURNAL_TRANS_HALF],
+ printf ("block %d is in journal %d.\n",
+ commit.j_realblock[i-JOURNAL_TRANS_HALF],
desc_block);
#endif
}
@@ -539,7 +539,7 @@
desc_block = (commit_block + 1) & (block_count - 1);
}
#ifdef REISERDEBUG
- printf ("Transaction %d/%d at %d isn't valid.\n",
+ printf ("Transaction %d/%d at %d isn't valid.\n",
desc.j_trans_id, desc.j_mount_id, desc_block);
#endif
@@ -556,7 +556,7 @@
int superblock = REISERFS_DISK_OFFSET_IN_BYTES >> SECTOR_BITS;
if (part_length < superblock + (sizeof (super) >> SECTOR_BITS)
- || ! devread (superblock, 0, sizeof (struct reiserfs_super_block),
+ || ! devread (superblock, 0, sizeof (struct reiserfs_super_block),
(char *) &super)
|| (substring (REISER2FS_SUPER_MAGIC_STRING, super.s_magic) > 0
&& substring (REISERFS_SUPER_MAGIC_STRING, super.s_magic) > 0)
@@ -567,7 +567,7 @@
/* Try old super block position */
superblock = REISERFS_OLD_DISK_OFFSET_IN_BYTES >> SECTOR_BITS;
if (part_length < superblock + (sizeof (super) >> SECTOR_BITS)
- || ! devread (superblock, 0, sizeof (struct reiserfs_super_block),
+ || ! devread (superblock, 0, sizeof (struct reiserfs_super_block),
(char *) &super))
return 0;
@@ -575,10 +575,10 @@
&& substring (REISERFS_SUPER_MAGIC_STRING, super.s_magic) > 0)
{
/* pre journaling super block ? */
- if (substring (REISERFS_SUPER_MAGIC_STRING,
+ if (substring (REISERFS_SUPER_MAGIC_STRING,
(char*) ((char *) &super + 20)) > 0)
return 0;
-
+
super.s_blocksize = REISERFS_OLD_BLOCKSIZE;
super.s_journal_block = 0;
super.s_version = 0;
@@ -588,16 +588,16 @@
/* check the version number. */
if (super.s_version > REISERFS_MAX_SUPPORTED_VERSION)
return 0;
-
+
INFO->version = super.s_version;
INFO->blocksize = super.s_blocksize;
INFO->fullblocksize_shift = log2 (super.s_blocksize);
INFO->blocksize_shift = INFO->fullblocksize_shift - SECTOR_BITS;
- INFO->cached_slots =
+ INFO->cached_slots =
(FSYSREISER_CACHE_SIZE >> INFO->fullblocksize_shift) - 1;
#ifdef REISERDEBUG
- printf ("reiserfs_mount: version=%d, blocksize=%d\n",
+ printf ("reiserfs_mount: version=%d, blocksize=%d\n",
INFO->version, INFO->blocksize);
#endif /* REISERDEBUG */
@@ -610,7 +610,7 @@
return 0;
/* Initialize journal code. If something fails we end with zero
- * journal_transactions, so we don't access the journal at all.
+ * journal_transactions, so we don't access the journal at all.
*/
INFO->journal_transactions = 0;
if (super.s_journal_block != 0 && super.s_journal_dev == 0)
@@ -621,17 +621,17 @@
journal_init ();
/* Read in super block again, maybe it is in the journal */
- block_read (superblock >> INFO->blocksize_shift,
+ block_read (superblock >> INFO->blocksize_shift,
0, sizeof (struct reiserfs_super_block), (char *) &super);
}
if (! block_read (super.s_root_block, 0, INFO->blocksize, (char*) ROOT))
return 0;
-
+
INFO->tree_depth = BLOCKHEAD (ROOT)->blk_level;
-
+
#ifdef REISERDEBUG
- printf ("root read_in: block=%d, depth=%d\n",
+ printf ("root read_in: block=%d, depth=%d\n",
super.s_root_block, INFO->tree_depth);
#endif /* REISERDEBUG */
@@ -639,7 +639,7 @@
return 0;
if (INFO->tree_depth == DISK_LEAF_NODE_LEVEL)
{
- /* There is only one node in the whole filesystem,
+ /* There is only one node in the whole filesystem,
* which is simultanously leaf and root */
memcpy (LEAF, ROOT, INFO->blocksize);
}
@@ -654,7 +654,7 @@
* My tree node cache is organized as following
* 0 ROOT node
* 1 LEAF node (if the ROOT is also a LEAF it is copied here
- * 2-n other nodes on current path from bottom to top.
+ * 2-n other nodes on current path from bottom to top.
* if there is not enough space in the cache, the top most are
* omitted.
*
@@ -664,7 +664,7 @@
* next_key() gets the next key in tree order.
*
* This means, that I can only sequential reads of files are
- * efficient, but this really doesn't hurt for grub.
+ * efficient, but this really doesn't hurt for grub.
*/
/* Read in the node at the current path and depth into the node cache.
@@ -678,7 +678,7 @@
if (depth < num_cached)
{
/* This is the cached part of the path. Check if same block is
- * needed.
+ * needed.
*/
if (blockNr == INFO->blocks[depth])
return cache;
@@ -704,7 +704,7 @@
}
/* Get the next key, i.e. the key following the last retrieved key in
- * tree order. INFO->current_ih and
+ * tree order. INFO->current_ih and
* INFO->current_info are adapted accordingly. */
static int
next_key (void)
@@ -712,21 +712,21 @@
int depth;
struct item_head *ih = INFO->current_ih + 1;
char *cache;
-
+
#ifdef REISERDEBUG
- printf ("next_key:\n old ih: key %d:%d:%d:%d version:%d\n",
- INFO->current_ih->ih_key.k_dir_id,
- INFO->current_ih->ih_key.k_objectid,
+ printf ("next_key:\n old ih: key %d:%d:%d:%d version:%d\n",
+ INFO->current_ih->ih_key.k_dir_id,
+ INFO->current_ih->ih_key.k_objectid,
INFO->current_ih->ih_key.u.v1.k_offset,
INFO->current_ih->ih_key.u.v1.k_uniqueness,
INFO->current_ih->ih_version);
#endif /* REISERDEBUG */
-
+
if (ih == &ITEMHEAD[BLOCKHEAD (LEAF)->blk_nr_item])
{
depth = DISK_LEAF_NODE_LEVEL;
- /* The last item, was the last in the leaf node.
- * Read in the next block
+ /* The last item, was the last in the leaf node.
+ * Read in the next block
*/
do
{
@@ -743,18 +743,18 @@
#endif /* REISERDEBUG */
}
while (INFO->next_key_nr[depth] == 0);
-
+
if (depth == INFO->tree_depth)
cache = ROOT;
else if (depth <= INFO->cached_slots)
cache = CACHE (depth);
- else
+ else
{
cache = read_tree_node (INFO->blocks[depth], depth);
if (! cache)
return 0;
}
-
+
do
{
int nr_item = BLOCKHEAD (cache)->blk_nr_item;
@@ -771,16 +771,16 @@
return 0;
}
while (depth > DISK_LEAF_NODE_LEVEL);
-
+
ih = ITEMHEAD;
}
found:
INFO->current_ih = ih;
INFO->current_item = &LEAF[ih->ih_item_location];
#ifdef REISERDEBUG
- printf (" new ih: key %d:%d:%d:%d version:%d\n",
- INFO->current_ih->ih_key.k_dir_id,
- INFO->current_ih->ih_key.k_objectid,
+ printf (" new ih: key %d:%d:%d:%d version:%d\n",
+ INFO->current_ih->ih_key.k_dir_id,
+ INFO->current_ih->ih_key.k_objectid,
INFO->current_ih->ih_key.u.v1.k_offset,
INFO->current_ih->ih_key.u.v1.k_uniqueness,
INFO->current_ih->ih_version);
@@ -788,18 +788,18 @@
return 1;
}
-/* preconditions: reiserfs_mount already executed, therefore
+/* preconditions: reiserfs_mount already executed, therefore
* INFO block is valid
- * returns: 0 if error (errnum is set),
+ * returns: 0 if error (errnum is set),
* nonzero iff we were able to find the key successfully.
- * postconditions: on a nonzero return, the current_ih and
+ * postconditions: on a nonzero return, the current_ih and
* current_item fields describe the key that equals the
* searched key. INFO->next_key contains the next key after
* the searched key.
* side effects: messes around with the cache.
*/
static int
-search_stat (__u32 dir_id, __u32 objectid)
+search_stat (__u32 dir_id, __u32 objectid)
{
char *cache;
int depth;
@@ -809,21 +809,21 @@
#ifdef REISERDEBUG
printf ("search_stat:\n key %d:%d:0:0\n", dir_id, objectid);
#endif /* REISERDEBUG */
-
+
depth = INFO->tree_depth;
cache = ROOT;
-
+
while (depth > DISK_LEAF_NODE_LEVEL)
{
struct key *key;
nr_item = BLOCKHEAD (cache)->blk_nr_item;
-
+
key = KEY (cache);
-
- for (i = 0; i < nr_item; i++)
+
+ for (i = 0; i < nr_item; i++)
{
if (key->k_dir_id > dir_id
- || (key->k_dir_id == dir_id
+ || (key->k_dir_id == dir_id
&& (key->k_objectid > objectid
|| (key->k_objectid == objectid
&& (key->u.v1.k_offset
@@ -831,7 +831,7 @@
break;
key++;
}
-
+
#ifdef REISERDEBUG
printf (" depth=%d, i=%d/%d\n", depth, i, nr_item);
#endif /* REISERDEBUG */
@@ -840,13 +840,13 @@
if (! cache)
return 0;
}
-
+
/* cache == LEAF */
nr_item = BLOCKHEAD (LEAF)->blk_nr_item;
ih = ITEMHEAD;
- for (i = 0; i < nr_item; i++)
+ for (i = 0; i < nr_item; i++)
{
- if (ih->ih_key.k_dir_id == dir_id
+ if (ih->ih_key.k_dir_id == dir_id
&& ih->ih_key.k_objectid == objectid
&& ih->ih_key.u.v1.k_offset == 0
&& ih->ih_key.u.v1.k_uniqueness == 0)
@@ -871,32 +871,32 @@
unsigned int offset;
unsigned int to_read;
char *prev_buf = buf;
-
+
#ifdef REISERDEBUG
printf ("reiserfs_read: filepos=%d len=%d, offset=%x:%x\n",
filepos, len, (__u64) IH_KEY_OFFSET (INFO->current_ih) - 1);
#endif /* REISERDEBUG */
-
+
if (INFO->current_ih->ih_key.k_objectid != INFO->fileinfo.k_objectid
|| IH_KEY_OFFSET (INFO->current_ih) > filepos + 1)
{
search_stat (INFO->fileinfo.k_dir_id, INFO->fileinfo.k_objectid);
goto get_next_key;
}
-
+
while (! errnum)
{
if (INFO->current_ih->ih_key.k_objectid != INFO->fileinfo.k_objectid)
break;
-
+
offset = filepos - IH_KEY_OFFSET (INFO->current_ih) + 1;
blocksize = INFO->current_ih->ih_item_len;
-
+
#ifdef REISERDEBUG
printf (" loop: filepos=%d len=%d, offset=%d blocksize=%d\n",
filepos, len, offset, blocksize);
#endif /* REISERDEBUG */
-
+
if (IH_KEY_ISTYPE(INFO->current_ih, TYPE_DIRECT)
&& offset < blocksize)
{
@@ -907,14 +907,14 @@
to_read = blocksize - offset;
if (to_read > len)
to_read = len;
-
+
if (disk_read_hook != NULL)
{
disk_read_func = disk_read_hook;
-
+
block_read (INFO->blocks[DISK_LEAF_NODE_LEVEL],
(INFO->current_item - LEAF + offset), to_read, buf);
-
+
disk_read_func = NULL;
}
else
@@ -928,25 +928,25 @@
printf ("indirect_read: offset=%d, blocksize=%d\n",
offset, blocksize);
#endif /* REISERDEBUG */
-
+
while (offset < blocksize)
{
__u32 blocknr = ((__u32 *) INFO->current_item)
[offset >> INFO->fullblocksize_shift];
int blk_offset = offset & (INFO->blocksize-1);
-
+
to_read = INFO->blocksize - blk_offset;
if (to_read > len)
to_read = len;
-
+
disk_read_func = disk_read_hook;
-
+
/* Journal is only for meta data. Data blocks can be read
* directly without using block_read
*/
devread (blocknr << INFO->blocksize_shift,
blk_offset, to_read, buf);
-
+
disk_read_func = NULL;
update_buf_len:
len -= to_read;
@@ -965,11 +965,11 @@
}
-/* preconditions: reiserfs_mount already executed, therefore
+/* preconditions: reiserfs_mount already executed, therefore
* INFO block is valid
* returns: 0 if error, nonzero iff we were able to find the file successfully
* postconditions: on a nonzero return, INFO->fileinfo contains the info
- * of the file we were trying to look up, filepos is 0 and filemax is
+ * of the file we were trying to look up, filepos is 0 and filemax is
* the size of the file.
*/
int
@@ -987,23 +987,23 @@
dir_id = REISERFS_ROOT_PARENT_OBJECTID;
objectid = REISERFS_ROOT_OBJECTID;
-
+
while (1)
{
#ifdef REISERDEBUG
printf ("dirname=%s\n", dirname);
#endif /* REISERDEBUG */
-
+
/* Search for the stat info first. */
if (! search_stat (dir_id, objectid))
return 0;
-
+
#ifdef REISERDEBUG
- printf ("sd_mode=%x sd_size=%d\n",
+ printf ("sd_mode=%x sd_size=%d\n",
((struct stat_data *) INFO->current_item)->sd_mode,
((struct stat_data *) INFO->current_item)->sd_size);
#endif /* REISERDEBUG */
-
+
mode = ((struct stat_data *) INFO->current_item)->sd_mode;
/* If we've got a symbolic link, then chase it. */
@@ -1029,7 +1029,7 @@
errnum = ERR_FILELENGTH;
return 0;
}
-
+
/* Copy the remaining name to the end of the symlink data.
Note that DIRNAME and LINKBUF may overlap! */
grub_memmove (linkbuf + filemax, dirname, len+1);
@@ -1069,7 +1069,7 @@
/* if we have a real file (and we're not just printing possibilities),
then this is where we want to exit */
-
+
if (! *dirname || isspace (*dirname))
{
if (! S_ISREG (mode))
@@ -1077,22 +1077,22 @@
errnum = ERR_BAD_FILETYPE;
return 0;
}
-
+
filepos = 0;
filemax = ((struct stat_data *) INFO->current_item)->sd_size;
-
- /* If this is a new stat data and size is > 4GB set filemax to
+
+ /* If this is a new stat data and size is > 4GB set filemax to
* maximum
*/
if (INFO->current_ih->ih_version == ITEM_VERSION_2
&& ((struct stat_data *) INFO->current_item)->sd_size_hi > 0)
filemax = 0xffffffff;
-
+
INFO->fileinfo.k_dir_id = dir_id;
INFO->fileinfo.k_objectid = objectid;
return next_key ();
}
-
+
/* continue with the file/directory name interpretation */
while (*dirname == '/')
dirname++;
@@ -1103,31 +1103,31 @@
}
for (rest = dirname; (ch = *rest) && ! isspace (ch) && ch != '/'; rest++);
*rest = 0;
-
+
# ifndef STAGE1_5
if (print_possibilities && ch != '/')
do_possibilities = 1;
# endif /* ! STAGE1_5 */
-
+
while (1)
{
char *name_end;
int num_entries;
-
+
if (! next_key ())
return 0;
#ifdef REISERDEBUG
- printf ("ih: key %d:%d:%d:%d version:%d\n",
- INFO->current_ih->ih_key.k_dir_id,
- INFO->current_ih->ih_key.k_objectid,
+ printf ("ih: key %d:%d:%d:%d version:%d\n",
+ INFO->current_ih->ih_key.k_dir_id,
+ INFO->current_ih->ih_key.k_objectid,
INFO->current_ih->ih_key.u.v1.k_offset,
INFO->current_ih->ih_key.u.v1.k_uniqueness,
INFO->current_ih->ih_version);
#endif /* REISERDEBUG */
-
+
if (INFO->current_ih->ih_key.k_objectid != objectid)
break;
-
+
name_end = INFO->current_item + INFO->current_ih->ih_item_len;
de_head = (struct reiserfs_de_head *) INFO->current_item;
num_entries = INFO->current_ih->u.ih_entry_count;
@@ -1142,7 +1142,7 @@
* terminated. We write a temporary 0 behind it.
* NOTE: that this may overwrite the first block in
* the tree cache. That doesn't hurt as long as we
- * don't call next_key () in between.
+ * don't call next_key () in between.
*/
*name_end = 0;
cmp = substring (dirname, filename);
@@ -1171,18 +1171,18 @@
num_entries--;
}
}
-
+
# ifndef STAGE1_5
if (print_possibilities < 0)
return 1;
# endif /* ! STAGE1_5 */
-
+
errnum = ERR_FILE_NOT_FOUND;
*rest = ch;
return 0;
-
+
found:
-
+
*rest = ch;
dirname = rest;
@@ -1198,22 +1198,22 @@
{
struct reiserfs_super_block super;
int num_sectors;
-
- if (! devread (REISERFS_DISK_OFFSET_IN_BYTES >> SECTOR_BITS, 0,
+
+ if (! devread (REISERFS_DISK_OFFSET_IN_BYTES >> SECTOR_BITS, 0,
sizeof (struct reiserfs_super_block), (char *) &super))
return 0;
-
+
*start_sector = 1; /* reserve first sector for stage1 */
if ((substring (REISERFS_SUPER_MAGIC_STRING, super.s_magic) <= 0
|| substring (REISER2FS_SUPER_MAGIC_STRING, super.s_magic) <= 0)
&& (/* check that this is not a super block copy inside
* the journal log */
- super.s_journal_block * super.s_blocksize
+ super.s_journal_block * super.s_blocksize
> REISERFS_DISK_OFFSET_IN_BYTES))
num_sectors = (REISERFS_DISK_OFFSET_IN_BYTES >> SECTOR_BITS) - 1;
else
num_sectors = (REISERFS_OLD_DISK_OFFSET_IN_BYTES >> SECTOR_BITS) - 1;
-
+
return (needed_sectors <= num_sectors);
}
#endif /* FSYS_REISERFS */
Modified: openbios-devel/fs/grubfs/fsys_vstafs.c
===================================================================
--- openbios-devel/fs/grubfs/fsys_vstafs.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/grubfs/fsys_vstafs.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -41,21 +41,21 @@
*/
static int f_sector;
-int
+int
vstafs_mount (void)
{
int retval = 1;
-
+
if( (((current_drive & 0x80) || (current_slice != 0))
&& current_slice != PC_SLICE_TYPE_VSTAFS)
|| ! devread (0, 0, BLOCK_SIZE, (char *) FSYS_BUF)
|| FIRST_SECTOR->fs_magic != 0xDEADFACE)
retval = 0;
-
+
return retval;
}
-static void
+static void
get_file_info (int sector)
{
devread (sector, 0, BLOCK_SIZE, (char *) FILE_INFO);
@@ -76,13 +76,13 @@
errnum = ERR_FILE_NOT_FOUND;
return NULL;
}
-
+
a1 = FILE_INFO->blocks;
curr_ext = 0;
devread (a1[curr_ext].a_start, 0, 512, (char *) DIRECTORY_BUF);
current_direntry = 11;
current_blockpos = 0;
-
+
return &DIRECTORY_BUF[10];
}
@@ -97,7 +97,7 @@
current_blockpos = 0;
curr_ext++;
}
-
+
if (curr_ext < FILE_INFO->extents)
{
devread (a1[curr_ext].a_start + current_blockpos, 0,
@@ -109,17 +109,17 @@
return NULL;
}
}
-
+
return &DIRECTORY_BUF[current_direntry++];
}
-int
+int
vstafs_dir (char *dirname)
{
char *fn, ch;
struct dir_entry *d;
/* int l, i, s; */
-
+
/*
* Read in the entries of the current directory.
*/
@@ -130,7 +130,7 @@
{
return 0;
}
-
+
/*
* Find the file in the path
*/
@@ -138,19 +138,19 @@
fn = dirname;
while ((ch = *fn) && ch != '/' && ! isspace (ch)) fn++;
*fn = 0;
-
+
do
{
if (d->name[0] == 0 || d->name[0] & 0x80)
continue;
-
+
#ifndef STAGE1_5
if (print_possibilities && ch != '/'
&& (! *dirname || strcmp (dirname, d->name) <= 0))
{
if (print_possibilities > 0)
print_possibilities = -print_possibilities;
-
+
printf (" %s", d->name);
}
#endif
@@ -158,12 +158,12 @@
{
f_sector = d->start;
get_file_info (f_sector);
- filemax = FILE_INFO->len;
+ filemax = FILE_INFO->len;
break;
}
}
while ((d =vstafs_nextdir ()));
-
+
*(dirname = fn) = ch;
if (! d)
{
@@ -174,17 +174,17 @@
#endif
return 1;
}
-
+
errnum = ERR_FILE_NOT_FOUND;
return 0;
}
}
while (*dirname && ! isspace (ch));
-
+
return 1;
}
-int
+int
vstafs_read (char *addr, int len)
{
struct alloc *a2;
@@ -193,11 +193,11 @@
char extent;
int ext_size;
char *curr_pos;
-
+
get_file_info (f_sector);
size = FILE_INFO->len-VSTAFS_START_DATA;
a2 = FILE_INFO->blocks;
-
+
if (filepos > 0)
{
if (filepos < a2[0].a_len * 512 - VSTAFS_START_DATA)
@@ -226,11 +226,11 @@
extent = 0;
curr_len = a2[0].a_len * 512 - offset;
}
-
+
curr_pos = addr;
if (curr_len > len)
curr_len = len;
-
+
for (curr_ext2=extent;
curr_ext2 < FILE_INFO->extents;
curr_len = a2[curr_ext].a_len * 512, curr_pos += curr_len, curr_ext2++)
@@ -242,11 +242,11 @@
ret += size;
curr_len += size;
}
-
+
devread (a2[curr_ext2].a_start,offset, curr_len, curr_pos);
offset = 0;
}
-
+
return ret;
}
Modified: openbios-devel/fs/grubfs/fsys_xfs.c
===================================================================
--- openbios-devel/fs/grubfs/fsys_xfs.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/grubfs/fsys_xfs.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,5 +1,5 @@
/* fsys_xfs.c - an implementation for the SGI XFS file system */
-/*
+/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2001,2002 Free Software Foundation, Inc.
*
@@ -107,7 +107,7 @@
return x;
#else
return __be16_to_cpu(x);
-#endif
+#endif
}
static inline __uint32_t
@@ -142,7 +142,7 @@
static xfs_fsblock_t
xt_start (xfs_bmbt_rec_32_t *r)
{
- return (((xfs_fsblock_t)(le32 (r->l1) & mask32lo(9))) << 43) |
+ return (((xfs_fsblock_t)(le32 (r->l1) & mask32lo(9))) << 43) |
(((xfs_fsblock_t)le32 (r->l2)) << 11) |
(((xfs_fsblock_t)le32 (r->l3)) >> 21);
}
@@ -369,7 +369,7 @@
++name;
++namelen;
sfe = (xfs_dir2_sf_entry_t *)
- (inode->di_u.di_c
+ (inode->di_u.di_c
+ sizeof(xfs_dir2_sf_hdr_t)
- xfs.i8param);
break;
@@ -466,7 +466,7 @@
if (!devread (0, 0, sizeof(super), (char *)&super)
|| (le32(super.sb_magicnum) != XFS_SB_MAGIC)
- || ((le16(super.sb_versionnum)
+ || ((le16(super.sb_versionnum)
& XFS_SB_VERSION_NUMBITS) != XFS_SB_VERSION_4) ) {
return 0;
}
@@ -513,7 +513,7 @@
offset = xad->offset;
xadlen = xad->len;
if (isinxt (filepos >> xfs.blklog, offset, xadlen)) {
- endofcur = (offset + xadlen) << xfs.blklog;
+ endofcur = (offset + xadlen) << xfs.blklog;
toread = (endofcur >= endpos)
? len : (endofcur - filepos);
@@ -535,7 +535,7 @@
}
continue;
}
- endofprev = offset + xadlen;
+ endofprev = offset + xadlen;
}
return filepos - startpos;
Modified: openbios-devel/fs/grubfs/glue.h
===================================================================
--- openbios-devel/fs/grubfs/glue.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/grubfs/glue.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -23,7 +23,7 @@
extern int using_devsize;
/*
- * some of the filesystem drivers don't correctly provide their
+ * some of the filesystem drivers don't correctly provide their
* prototypes. we fix this here so we can leave them untouched.
*/
Modified: openbios-devel/fs/grubfs/grubfs_fs.c
===================================================================
--- openbios-devel/fs/grubfs/grubfs_fs.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/grubfs/grubfs_fs.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* <grubfs_fs.c>
- *
+ *
* grub vfs
- *
+ *
* Copyright (C) 2004 Stefan Reinauer
* Copyright (C) 2004 Samuel Rydh
*
* inspired by HFS code from Samuel Rydh
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation
- *
+ *
*/
#include "openbios/config.h"
@@ -34,7 +34,7 @@
/* we fake this for now, assuming that the filesystem is not corrupt */
unsigned long part_length=(unsigned long)-1;
-/* these are not even used by us, instead
+/* these are not even used by us, instead
* the grub fs drivers want them:
*/
int fsmax;
@@ -163,7 +163,7 @@
filepos=file->pos;
filemax=file->len;
-
+
ret=curfs->fsys->read_func(buf, count);
file->pos=filepos;
@@ -174,7 +174,7 @@
get_path( file_desc_t *fd, char *retbuf, int len )
{
const char *path=((grubfile_t *)fd)->path;
-
+
if(strlen(path) > len)
return NULL;
@@ -208,7 +208,7 @@
ret->len=filemax;
ret->path=strdup(path);
ret->fs=fs;
-
+
return (file_desc_t *)ret;
}
@@ -217,7 +217,7 @@
{
free( fs->fs_data );
fs->fs_data = NULL;
-
+
/* callers responsibility to call free(fs) */
}
@@ -226,7 +226,7 @@
{
grubfs_t *gfs = (grubfs_t*)fs->fs_data;
return gfs->fsys->name;
-}
+}
static const fs_ops_t grubfs_ops = {
.close_fs = close_fs,
@@ -285,7 +285,7 @@
#ifdef CONFIG_DEBUG_FS
//printk("devread s=%x buf=%x, fd=%x\n",sector, buf, curfs->dev_fd);
#endif
-
+
if( !curfs ) {
#ifdef CONFIG_DEBUG_FS
printk("devread: fsys == NULL!\n");
@@ -309,4 +309,4 @@
len = filemax - filepos;
errnum = 0;
return curfs->fsys->read_func( buf, len );
-}
+}
Modified: openbios-devel/fs/grubfs/jfs.h
===================================================================
--- openbios-devel/fs/grubfs/jfs.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/grubfs/jfs.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,22 +1,22 @@
/* jfs.h - an extractions from linux/include/linux/jfs/jfs* into one file */
-/*
+/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2000 International Business Machines Corp.
* Copyright (C) 2001 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
@@ -177,7 +177,7 @@
s64 s_size; /* 8: aggregate size in hardware/LVM blocks;
* VFS: number of blocks
*/
- s32 s_bsize; /* 4: aggregate block size in bytes;
+ s32 s_bsize; /* 4: aggregate block size in bytes;
* VFS: fragment size
*/
s16 s_l2bsize; /* 2: log2 of s_bsize */
@@ -191,7 +191,7 @@
u32 s_flag; /* 4: aggregate attributes:
* see jfs_filsys.h
*/
- u32 s_state; /* 4: mount/unmount/recovery state:
+ u32 s_state; /* 4: mount/unmount/recovery state:
* see jfs_filsys.h
*/
s32 s_compress; /* 4: > 0 if data compression */
@@ -212,11 +212,11 @@
struct timestruc_t s_time; /* 8: time last updated */
s32 s_fsckloglen; /* 4: Number of filesystem blocks reserved for
- * the fsck service log.
+ * the fsck service log.
* N.B. These blocks are divided among the
* versions kept. This is not a per
* version size.
- * N.B. These blocks are included in the
+ * N.B. These blocks are included in the
* length field of s_fsckpxd.
*/
s8 s_fscklog; /* 1: which fsck service log is most recent
@@ -224,7 +224,7 @@
* 1 => the first one
* 2 => the 2nd one
*/
- char s_fpack[11]; /* 11: file system volume name
+ char s_fpack[11]; /* 11: file system volume name
* N.B. This must be 11 bytes to
* conform with the OS/2 BootSector
* requirements
@@ -237,7 +237,7 @@
/* - 128 byte boundary - */
/*
- * DFS VFS support (preliminary)
+ * DFS VFS support (preliminary)
*/
char s_attach; /* 1: VFS: flag: set when aggregate is attached
*/
@@ -246,22 +246,22 @@
u64 totalUsable; /* 8: VFS: total of 1K blocks which are
* available to "normal" (non-root) users.
*/
- u64 minFree; /* 8: VFS: # of 1K blocks held in reserve for
+ u64 minFree; /* 8: VFS: # of 1K blocks held in reserve for
* exclusive use of root. This value can be 0,
- * and if it is then totalUsable will be equal
+ * and if it is then totalUsable will be equal
* to # of blocks in aggregate. I believe this
* means that minFree + totalUsable = # blocks.
- * In that case, we don't need to store both
+ * In that case, we don't need to store both
* totalUsable and minFree since we can compute
- * one from the other. I would guess minFree
- * would be the one we should store, and
- * totalUsable would be the one we should
+ * one from the other. I would guess minFree
+ * would be the one we should store, and
+ * totalUsable would be the one we should
* compute. (Just a guess...)
*/
- u64 realFree; /* 8: VFS: # of free 1K blocks can be used by
+ u64 realFree; /* 8: VFS: # of free 1K blocks can be used by
* "normal" users. It may be this is something
- * we should compute when asked for instead of
+ * we should compute when asked for instead of
* storing in the superblock. I don't know how
* often this information is needed.
*/
@@ -318,7 +318,7 @@
/*
* dir_table used for directory traversal during readdir
-*/
+*/
/*
* Maximum entry in inline directory table
@@ -562,8 +562,8 @@
/*
* inode allocation map:
- *
- * inode allocation map consists of
+ *
+ * inode allocation map consists of
* . the inode map control page and
* . inode allocation group pages (per 4096 inodes)
* which are addressed by standard JFS xtree.
Modified: openbios-devel/fs/grubfs/ufs_fs.h
===================================================================
--- openbios-devel/fs/grubfs/ufs_fs.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/grubfs/ufs_fs.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -55,7 +55,7 @@
* the ``cgbase(fs, cg)'' macro.
*
* Depending on the architecture and the media, the superblock may
- * reside in any one of four places. For tiny media where every block
+ * reside in any one of four places. For tiny media where every block
* counts, it is placed at the very front of the partition. Historically,
* UFS1 placed it 8K from the front to leave room for the disk label and
* a small bootstrap. For UFS2 it got moved to 64K from the front to leave
@@ -338,7 +338,7 @@
int32_t fs_save_cgsize; /* save real cg size to use fs_bsize */
int32_t fs_sparecon32[26]; /* reserved for future constants */
int32_t fs_flags; /* see FS_ flags below */
- int32_t fs_contigsumsize; /* size of cluster summary array */
+ int32_t fs_contigsumsize; /* size of cluster summary array */
int32_t fs_maxsymlinklen; /* max length of an internal symlink */
int32_t fs_old_inodefmt; /* format of on-disk inodes */
uint64_t fs_maxfilesize; /* maximum representable file size */
Modified: openbios-devel/fs/grubfs/xfs.h
===================================================================
--- openbios-devel/fs/grubfs/xfs.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/grubfs/xfs.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,35 +1,35 @@
/* xfs.h - an extraction from xfsprogs-1.3.5/include/xfs* into one file */
-/*
+/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2000 Silicon Graphics, Inc. All Rights Reserved.
* Copyright (C) 2001 Free Software Foundation, Inc.
- *
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
- *
+ *
* This program is distributed in the hope that it would be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
+ *
* Further, this software is distributed without any warranty that it is
* free of the rightful claim of any third person regarding infringement
* or the like. Any license provided herein, whether implied or
* otherwise, applies only to this software file. Patent licenses, if
* any, provided herein do not apply to combinations of this program with
* other software, or any other product whatsoever.
- *
+ *
* You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
+ * with this program; if not, write the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
+ *
* Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
* Mountain View, CA 94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
+ *
+ * http://www.sgi.com
+ *
+ * For further information regarding this notice, see:
+ *
* http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
*/
@@ -132,7 +132,7 @@
__uint8_t sb_shared_vn; /* shared version number */
xfs_extlen_t sb_inoalignmt; /* inode chunk alignment, fsblocks */
__uint32_t sb_unit; /* stripe or raid unit */
- __uint32_t sb_width; /* stripe or raid width */
+ __uint32_t sb_width; /* stripe or raid width */
__uint8_t sb_dirblklog; /* log2 of dir block size (fsbs) */
__uint8_t sb_dummy[7]; /* padding */
} xfs_sb_t;
Modified: openbios-devel/fs/hfs/block.c
===================================================================
--- openbios-devel/fs/hfs/block.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/hfs/block.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -37,7 +37,7 @@
{
bcache *cache;
int i;
-
+
ASSERT(vol->cache == 0);
cache = ALLOC(bcache, 1);
Modified: openbios-devel/fs/hfs/hfs.c
===================================================================
--- openbios-devel/fs/hfs/hfs.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/hfs/hfs.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -69,7 +69,7 @@
{
hfsvol *vol, *check;
int mode = HFS_MODE_RDONLY;
-
+
/* see if the volume is already mounted */
for (check = hfs_mounts; check; check = check->next)
{
Modified: openbios-devel/fs/hfs/hfs_fs.c
===================================================================
--- openbios-devel/fs/hfs/hfs_fs.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/hfs/hfs_fs.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2001/05/06 22:47:23 samuel>
* Time-stamp: <2004/01/12 10:24:35 samuel>
- *
+ *
* <hfs_fs.c>
- *
+ *
* HFS world interface
- *
+ *
* Copyright (C) 2001-2004 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation
- *
+ *
*/
#include "openbios/config.h"
@@ -39,7 +39,7 @@
hfsdirent ent;
hfsdir *dir;
int ret=1;
-
+
if( !(dir=hfs_opendir(vol, path)) )
return 1;
@@ -76,24 +76,24 @@
while( status && !hfs_readdir(dir, &ent) ) {
ulong type, creator;
-
+
*p = 0;
topdir = 0;
-
+
strncat( buf, ent.name, sizeof(buf) );
if( (status=_search(vol, buf, sname, ret_fd)) != 2 )
continue;
topdir = 1;
-
+
/* name search? */
if( sname ) {
status = strcasecmp( ent.name, sname );
continue;
}
-
+
type = *(ulong*)ent.u.file.type;
creator = *(ulong*)ent.u.file.creator;
-
+
/* look for Mac OS ROM, System and Finder in the same directory */
if( type == MAC_OS_ROM_TYPE && creator == MAC_OS_ROM_CREATOR ) {
if( strcasecmp(ent.name, MAC_OS_ROM_NAME) )
@@ -113,11 +113,11 @@
}
static file_desc_t *
-_do_search( fs_ops_t *fs, const char *sname )
+_do_search( fs_ops_t *fs, const char *sname )
{
hfsvol *vol = hfs_getvol( NULL );
file_desc_t *ret_fd = NULL;
-
+
(void)_search( vol, ":", sname, &ret_fd );
return ret_fd;
}
@@ -183,7 +183,7 @@
hfsdirent ent;
int start, ns;
ulong id;
-
+
hfs_fstat( file, &ent );
start = sizeof(buf) - strlen(ent.name) - 1;
if( start <= 0 )
@@ -202,7 +202,7 @@
}
if( strlen(buf + start) >= len )
return NULL;
-
+
strcpy( retbuf, buf+start );
return retbuf;
}
@@ -220,7 +220,7 @@
hfsvol *vol = (hfsvol*)fs->fs_data;
const char *s;
char buf[256];
-
+
if( !strncmp(path, "\\\\", 2) ) {
hfsvolent ent;
@@ -231,7 +231,7 @@
} else {
hfs_chdir( vol, ":" );
}
-
+
for( path-- ;; ) {
int n;
@@ -241,7 +241,7 @@
n = MIN( sizeof(buf)-1, (path-s) );
if( !n )
continue;
-
+
strncpy( buf, s, n );
buf[n] = 0;
if( hfs_chdir(vol, buf) )
@@ -254,16 +254,16 @@
file_desc_t *ret = NULL;
hfsdirent ent;
hfsdir *dir;
-
+
s++;
id = oldid;
hfs_dirinfo( vol, &id, buf );
hfs_setcwd( vol, id );
-
+
if( !(dir=hfs_opendir(vol, buf)) )
return NULL;
hfs_setcwd( vol, oldid );
-
+
while( !hfs_readdir(dir, &ent) ) {
if( ent.flags & HFS_ISDIR )
continue;
@@ -289,10 +289,10 @@
}
static char *
-get_fstype( fs_ops_t *fs )
+get_fstype( fs_ops_t *fs )
{
return ("HFS");
-}
+}
static const fs_ops_t hfs_ops = {
.close_fs = close_fs,
@@ -319,6 +319,6 @@
*fs = hfs_ops;
fs->fs_data = vol;
-
+
return 0;
}
Modified: openbios-devel/fs/hfs_mdb.h
===================================================================
--- openbios-devel/fs/hfs_mdb.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/hfs_mdb.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,15 +1,15 @@
-/*
+/*
* Creation Date: <2000/09/03 23:04:27 samuel>
* Time-stamp: <2000/09/04 01:23:55 samuel>
- *
+ *
* <hfs_mdb.h>
- *
+ *
* HFS Master Directory Block (MDB)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation
- *
+ *
*/
#ifndef _H_HFS_MDB
@@ -22,7 +22,7 @@
#define hfs_get_ushort(addr) (*((unsigned short*)(addr)))
#define hfs_get_uint(addr) (*((unsigned int*)(addr)))
-/*
+/*
* The HFS Master Directory Block (MDB).
*
* Also known as the Volume Information Block (VIB), this structure is
@@ -64,8 +64,8 @@
hfs_uint_t drDirCnt; /* number of directories in the fs */
hfs_char_t drFndrInfo[32]; /* data used by the Finder */
hfs_ushort_t drEmbedSigWord; /* embedded volume signature */
- hfs_uint_t drEmbedExtent; /* starting block number (xdrStABN)
- and number of allocation blocks
+ hfs_uint_t drEmbedExtent; /* starting block number (xdrStABN)
+ and number of allocation blocks
(xdrNumABlks) occupied by embedded
volume */
hfs_uint_t drXTFlSize; /* bytes in the extents B-tree */
Modified: openbios-devel/fs/hfsplus/blockiter.c
===================================================================
--- openbios-devel/fs/hfsplus/blockiter.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/hfsplus/blockiter.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -5,7 +5,7 @@
*
* Copyright (C) 2000 Klaus Halfmann <khalfmann at libra.de>
* Original work by 1996-1998 Robert Leslie <rob at mars.org>
- * other work 2000 from Brad Boyer (flar at pants.nu)
+ * other work 2000 from Brad Boyer (flar at pants.nu)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -35,8 +35,8 @@
#include "hfstime.h"
/* Initialize iterator for a given fork */
-void
-blockiter_init(blockiter* b, volume* vol, hfsp_fork_raw* f,
+void
+blockiter_init(blockiter* b, volume* vol, hfsp_fork_raw* f,
UInt8 forktype, UInt32 fileId)
{
b->vol = vol;
@@ -52,7 +52,7 @@
}
/* get next extent record when needed */
-static int
+static int
blockiter_next_extent(blockiter *b)
{
btree* extents_tree = volume_get_extents_tree(b->vol);
@@ -64,7 +64,7 @@
err = record_next_extent(&b->er);
// Hope there is no need to check this ...
// if (b->er.key.start_block != b->curr_block)
- // HFSP_ERROR(ENOENT,
+ // HFSP_ERROR(ENOENT,
// "Extents record inconistent");
}
else
@@ -78,10 +78,10 @@
}
/* find next block of the fork iterating over */
-int
+int
blockiter_next(blockiter *b)
{
- b->curr_block ++;
+ b->curr_block ++;
b->block ++;
if (b->curr_block >= b->max_block)
return -1; // end of Blocks, but no error
@@ -104,7 +104,7 @@
}
/* skip the indicated number of blocks */
-int
+int
blockiter_skip(blockiter *b, UInt32 skip)
{
while (skip > 0)
@@ -118,7 +118,7 @@
}
else
skip -= diff;
- b->curr_block += diff;
+ b->curr_block += diff;
b->block += diff;
if (b->curr_block >= b->max_block)
return -1; // end of Blocks, but no error
Modified: openbios-devel/fs/hfsplus/btree.c
===================================================================
--- openbios-devel/fs/hfsplus/btree.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/hfsplus/btree.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -8,7 +8,7 @@
*
* Copyright (C) 2000 Klaus Halfmann <khalfmann at libra.de>
* Original 1996-1998 Robert Leslie <rob at mars.org>
- * Additional work by Brad Boyer (flar at pants.nu)
+ * Additional work by Brad Boyer (flar at pants.nu)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -47,7 +47,7 @@
node->num_rec = bswabU16_inc(p);
node->reserved = bswabU16_inc(p);
return p;
-}
+}
/* read a btree header from the given buffer and swap the bytes.
*
@@ -81,15 +81,15 @@
* Should be the average number of keys per node but these vary. */
#define DEPTH_FACTOR 1000
-/* Cache size is height of tree + this value
+/* Cache size is height of tree + this value
* Really big numbers wont help in case of ls -R
*/
-#define EXTRA_CACHESIZE 3
+#define EXTRA_CACHESIZE 3
/* Not in use by now ... */
#define CACHE_DIRTY 0x0001
-/* Intialize cache with default cache Size,
+/* Intialize cache with default cache Size,
* must call node_cache_close to deallocate memory */
static int node_cache_init(node_cache* cache, btree* tree, int size)
{
@@ -129,7 +129,7 @@
free(cache->entries);
}
-/* Load the cach node indentified by index with
+/* Load the cach node indentified by index with
* the node identified by node_index */
static node_buf* node_cache_load_buf
@@ -138,7 +138,7 @@
node_buf *result = node_buf_get(cache ,index);
UInt32 blkpernode = bt->blkpernode;
UInt32 block = node_index * blkpernode;
- void* p = volume_readfromfork(bt->vol, result->node, bt->fork,
+ void* p = volume_readfromfork(bt->vol, result->node, bt->fork,
block, blkpernode, HFSP_EXTENT_DATA, bt->cnid);
node_entry *e = &cache->entries[index];
@@ -210,9 +210,9 @@
/** intialize the btree with the first entry in the fork */
static int btree_init(btree* bt, volume* vol, hfsp_fork_raw* fork)
-{
+{
void *p;
- char buf[vol->blksize];
+ char buf[vol->blksize];
UInt16 node_size;
btree_node_desc node;
@@ -236,7 +236,7 @@
node_cache_init(&bt->cache, bt, bt->head.depth + EXTRA_CACHESIZE);
- // Allocate buffer
+ // Allocate buffer
// bt->buf = malloc(node_size);
// if (!bt->buf)
// return ENOMEM;
@@ -249,10 +249,10 @@
{
bt->cache.entries = NULL;
}
-
+
/** Intialize catalog btree */
int btree_init_cat(btree* bt, volume* vol, hfsp_fork_raw* fork)
-{
+{
int result = btree_init(bt,vol,fork); // super (...)
bt->cnid = HFSP_CAT_CNID;
bt->kcomp = record_key_compare;
@@ -262,7 +262,7 @@
/** Intialize catalog btree */
int btree_init_extent(btree* bt, volume* vol, hfsp_fork_raw* fork)
-{
+{
int result = btree_init(bt,vol,fork); // super (...)
bt->cnid = HFSP_EXT_CNID;
bt->kcomp = record_extent_key_compare;
@@ -280,16 +280,16 @@
/* returns pointer to key given by index in current node.
*
* Assumes that current node is not NODE_HEAD ...
- */
+ */
void* btree_key_by_index(btree* bt, node_buf* buf, UInt16 index)
{
- UInt16 node_size = bt->head.node_size;
+ UInt16 node_size = bt->head.node_size;
// The offsets are found at the end of the node ...
UInt16 off_pos = node_size - (index +1) * sizeof(btree_record_offset);
// position of offset at end of node
- btree_record_offset* offset =
+ btree_record_offset* offset =
(btree_record_offset*) (buf->node + off_pos);
-
+
// now we have the offset and can read the key ...
#ifdef CONFIG_LITTLE_ENDIAN
return buf->node + bswap_16(*offset);
@@ -297,8 +297,8 @@
return buf->node + *offset;
#endif
}
-
+
#ifdef DEBUG
/* print btree header node information */
@@ -338,7 +338,7 @@
/* Dump all the node information to stdout */
void btree_print(btree* bt)
-{
+{
btree_node_desc* node;
btree_printhead(&bt->head);
@@ -350,7 +350,7 @@
printf("num_rec : %#X\n", node->num_rec);
printf("reserved : %#X\n", node->reserved);
printf("height : %#X\n", node->height); switch(node->kind)
- {
+ {
case HFSP_NODE_NDX :
printf("HFSP_NODE_NDX\n");
break;
@@ -365,8 +365,8 @@
break;
default:
printf("*** Unknown Node type ***\n");
- }
-}
+ }
+}
#endif
Modified: openbios-devel/fs/hfsplus/hfsp_fs.c
===================================================================
--- openbios-devel/fs/hfsplus/hfsp_fs.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/hfsplus/hfsp_fs.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2001/05/05 23:33:49 samuel>
* Time-stamp: <2004/01/12 10:25:39 samuel>
- *
+ *
* <hfsp_fs.c>
- *
+ *
* HFS+ file system interface (and ROM lookup support)
- *
+ *
* Copyright (C) 2001, 2002, 2003, 2004 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation
- *
+ *
*/
#include "openbios/config.h"
@@ -95,13 +95,13 @@
return search_files( &r, recursive, proc, match_data, pt );
}
-static int
+static int
match_file( record *r, record *parent, const void *match_data, hfsp_file_t *pt )
{
const char *p = (const char*)match_data;
char name[256];
int ret=1;
-
+
if( r->record.type != HFSP_FILE )
return 1;
@@ -119,7 +119,7 @@
FInfo *fi = &file->user_info;
int ret = 1;
char buf[256];
-
+
if( r->record.type == HFSP_FILE && fi->fdCreator == MAC_OS_ROM_CREATOR && fi->fdType == MAC_OS_ROM_TYPE ) {
ret = search_files( par, 0, match_file, "System", NULL )
|| search_files( par, 0, match_file, "Finder", NULL );
@@ -193,7 +193,7 @@
}
static file_desc_t *
-_create_fops( hfsp_file_t *t )
+_create_fops( hfsp_file_t *t )
{
hfsp_file_t *r = malloc( sizeof(hfsp_file_t) );
@@ -208,7 +208,7 @@
hfsp_file_t t;
volume *vol = (volume*)fs->fs_data;
record r;
-
+
/* Leading \\ means system folder. The finder info block has
* the following meaning.
*
@@ -341,7 +341,7 @@
}
size = (count-act_count > max)? max : count-act_count;
memcpy( (char *)buf + act_count, &buf2[add], size );
-
+
curpos += blksize;
act_count += size;
@@ -360,10 +360,10 @@
}
static char *
-get_fstype( fs_ops_t *fs )
+get_fstype( fs_ops_t *fs )
{
return ("HFS+");
-}
+}
static const fs_ops_t fs_ops = {
@@ -377,7 +377,7 @@
.close = file_close,
.read = file_read,
.lseek = file_lseek,
-
+
.get_fstype = get_fstype
};
@@ -392,6 +392,6 @@
}
*fs = fs_ops;
fs->fs_data = vol;
-
+
return 0;
}
Modified: openbios-devel/fs/hfsplus/include/apple.h
===================================================================
--- openbios-devel/fs/hfsplus/include/apple.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/hfsplus/include/apple.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -3,10 +3,10 @@
*
* This file contains defintions that are special for Apple.
* The names match the defintions found in Apple Header files.
- *
+ *
* Copyright (C) 2000 Klaus Halfmann <khalfmann at libra.de>
* Original code 1996-1998 by Robert Leslie <rob at mars.rog>
- * other work 2000 from Brad Boyer (flar at pants.nu)
+ * other work 2000 from Brad Boyer (flar at pants.nu)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -36,15 +36,15 @@
typedef unsigned long OSType;
typedef unsigned long long UInt64;
-/* A point, normally used by Quickdraw,
- * but found in Finderinformation, too
+/* A point, normally used by Quickdraw,
+ * but found in Finderinformation, too
*/
typedef struct {
SInt16 v; /* vertical coordinate */
SInt16 h; /* horizontal coordinate */
} Point;
-/* A rectancle, normally used by Quickdraw,
+/* A rectancle, normally used by Quickdraw,
* but found in Finderinformation, too.
*/
typedef struct {
@@ -54,8 +54,8 @@
SInt16 right; /* right edge */
} Rect;
-/* Information about the location and size of a folder
- * used by the Finder.
+/* Information about the location and size of a folder
+ * used by the Finder.
*/
typedef struct {
Rect frRect; /* folder's rectangle */
Modified: openbios-devel/fs/hfsplus/include/blockiter.h
===================================================================
--- openbios-devel/fs/hfsplus/include/blockiter.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/hfsplus/include/blockiter.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -2,10 +2,10 @@
* libhfs - library for reading and writing Macintosh HFS volumes
*
* The iterator shown here iterates over the blocks of a fork.
- *
+ *
* Copyright (C) 2000 Klaus Halfmann <khalfmann at libra.de>
* Original work by 1996-1998 Robert Leslie <rob at mars.org>
- * other work 2000 from Brad Boyer (flar at pants.nu)
+ * other work 2000 from Brad Boyer (flar at pants.nu)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@
*/
/* Structure of the blockiterator */
-typedef struct
+typedef struct
{
volume* vol; // volume we iterate over
UInt32 curr_block; // current, absolute block
@@ -38,11 +38,11 @@
UInt8 forktype; // type of fork we iterate over
UInt8 in_extent; // boolean 0 - in file extent
// 1 - in extents file
- extent_record er; // record to iterate in extents file.
+ extent_record er; // record to iterate in extents file.
} blockiter;
/* Initialize iterator for a given fork */
-extern void blockiter_init(blockiter* b, volume* vol, hfsp_fork_raw* f,
+extern void blockiter_init(blockiter* b, volume* vol, hfsp_fork_raw* f,
UInt8 forktype, UInt32 fileId);
/* find next block of the fork iterating over */
Modified: openbios-devel/fs/hfsplus/include/btree.h
===================================================================
--- openbios-devel/fs/hfsplus/include/btree.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/hfsplus/include/btree.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -6,7 +6,7 @@
*
* Copyright (C) 2000 Klaus Halfmann <khalfmann at libra.de>
* Original 1996-1998 Robert Leslie <rob at mars.org>
- * Additional work by Brad Boyer (flar at pants.nu)
+ * Additional work by Brad Boyer (flar at pants.nu)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Modified: openbios-devel/fs/hfsplus/include/hfs.h
===================================================================
--- openbios-devel/fs/hfsplus/include/hfs.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/hfsplus/include/hfs.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,11 +1,11 @@
/*
* libhfsp - library for reading and writing Macintosh HFS+ volumes
- *
+ *
* This file includes definitions for access to old HFS structures.
*
* Copyright (C) 2000 Klaus Halfmann <khalfmann at libra.de>
* Original code 1996-1998 by Robert Leslie <rob at mars.rog>
- * other work 2000 from Brad Boyer (flar at pants.nu)
+ * other work 2000 from Brad Boyer (flar at pants.nu)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@
*/
-#define HFS_BLOCKSZ 512
+#define HFS_BLOCKSZ 512
/* A sector for Apple is always 512 bytes */
#define HFS_BLOCKSZ_BITS 9 /* 1<<9 == 512 */
#define HFS_VOLHEAD_SIG 0x4244 /* 'BD' */
Modified: openbios-devel/fs/hfsplus/include/hfsp.h
===================================================================
--- openbios-devel/fs/hfsplus/include/hfsp.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/hfsplus/include/hfsp.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,6 +1,6 @@
/*
* libhfsp - library for reading and writing Macintosh HFS+ volumes
- *
+ *
* This file includes definitions for the structures found on
* HFS+ Volumes. The structures are further wrapped by struct
* found in libhfsp.h. fucntions on those enhanced structures
@@ -8,7 +8,7 @@
*
* Copyright (C) 2000 Klaus Halfmann <khalfmann at libra.de>
* Original code 1996-1998 by Robert Leslie <rob at mars.rog>
- * other work 2000 from Brad Boyer (flar at pants.nu)
+ * other work 2000 from Brad Boyer (flar at pants.nu)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -68,29 +68,29 @@
*/
typedef struct hfsp_vh {
UInt16 signature; // must be HFSPLUS_VOLHEAD_SIG 'H+'
- UInt16 version; // currently 4, ignored
+ UInt16 version; // currently 4, ignored
UInt32 attributes; // See bit constants below
UInt32 last_mount_vers;
// Use a registered creator code here (what do we use ?)
// Mac OS uses '8.10' well
UInt32 reserved;
-
+
UInt32 create_date; // local time !
UInt32 modify_date; // GMT (?)
UInt32 backup_date; // GMT (?)
UInt32 checked_date; // GMT (?) fsck ?
-
+
UInt32 file_count;
// not including special files but including DATA and RSRC forks
UInt32 folder_count; // excluding the root folder
-
+
UInt32 blocksize;
// must be multiple of HFSPLUS_SECTOR_SIZE,
// should be a multiple of 4k for harddisk
UInt32 total_blocks;
UInt32 free_blocks;
// The total number of unused allocation blocks on the disk.
-
+
UInt32 next_alloc;
// hint wher to search for next allocation blocks
UInt32 rsrc_clump_sz;
@@ -104,7 +104,7 @@
UInt64 encodings_bmp;
// for every encoding used on the disk a bit is set
// ignored but eventually must be cared for
- Char finder_info[32];
+ Char finder_info[32];
hfsp_fork_raw alloc_file;
// stores bitmap of use/free blocks
hfsp_fork_raw ext_file;
@@ -162,7 +162,7 @@
UInt16 depth;
// equal to height of btree_node_desc
UInt32 root;
- // root node of the hierarchy
+ // root node of the hierarchy
UInt32 leaf_count;
UInt32 leaf_head;
UInt32 leaf_tail;
@@ -179,9 +179,9 @@
// always 0 for HFS+
UInt8 reserved2;
UInt32 attributes;
- // see below
+ // see below
UInt32 reserved3[16];
-} btree_head;
+} btree_head;
/* BTree attributes */
#define HFSPLUS_BAD_CLOSE 0x01
@@ -192,7 +192,7 @@
#define HFSPLUS_TREE_VAR_NDXKEY_SIZE 0x04
// use variable length index nodes, always set for catalog btree,
// always cleared for extents btree.
-
+
#define HFSPLUS_TREE_UNUSED 0xFFFFFFF8
/* Some special File ID numbers */
@@ -226,7 +226,7 @@
UInt8 fork_type; /* Seee below */
UInt8 filler;
UInt32 file_id;
- UInt32 start_block;
+ UInt32 start_block;
} hfsp_extent_key;
#define HFSP_EXTENT_DATA 0x00
@@ -238,10 +238,10 @@
#define HFSP_FOLDER 0x0001 // entry fo a Folder
#define HFSP_FILE 0x0002 // entry for a File
-#define HFSP_FOLDER_THREAD 0x0003
+#define HFSP_FOLDER_THREAD 0x0003
// Like '.' in unix, identifies the folder by its id, only
-#define HFSP_FILE_THREAD 0x0004
- // Im unsure if this is used by HFS+, too
+#define HFSP_FILE_THREAD 0x0004
+ // Im unsure if this is used by HFS+, too
/* HFS+ folder data (part of an hfsp_cat_entry) */
typedef struct {
Modified: openbios-devel/fs/hfsplus/include/hfstime.h
===================================================================
--- openbios-devel/fs/hfsplus/include/hfstime.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/hfsplus/include/hfstime.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -5,7 +5,7 @@
* other work 2000 from Brad Boyer (flar at pants.nu)
*
* The HFS+ dates are stored as UInt32 containing the number of seconds since
- * midnight, January 1, 1904, GMT. This is slightly different from HFS,
+ * midnight, January 1, 1904, GMT. This is slightly different from HFS,
* where the value represents local time. A notable exception is the
* creationdate !. Linux uses times in GMT starting at January 1, 1970
*
@@ -25,7 +25,7 @@
*
* $Id: hfstime.h,v 1.2 2000/10/19 13:33:38 hasi Exp $
*/
-
+
/* The number of seconds between 1.1.1904 and 1.1.1970 */
#define HFSPTIMEDIFF 2082844800U
Modified: openbios-devel/fs/hfsplus/include/libhfsp.h
===================================================================
--- openbios-devel/fs/hfsplus/include/libhfsp.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/hfsplus/include/libhfsp.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -28,7 +28,7 @@
# include "hfsp.h"
/* Last error is eventually found here */
-extern const char *hfsp_error;
+extern const char *hfsp_error;
# define HFSP_ERROR(code, str) \
do { hfsp_error = (str), errno = (code); goto fail; } while (0)
@@ -66,7 +66,7 @@
/* Signatures registered with Apple to identify this driver */
/* Identifies the userland implementation */
-# define HPLS_SIGNATURE 0x482B4C58 // 'H+LX'
+# define HPLS_SIGNATURE 0x482B4C58 // 'H+LX'
/* Identifies the kernel module by Brad Boyer (flar at pants.nu) */
# define HPLS_SIGRES1 0x482B4C78 // 'H+Lx'
/* not jet in use ... */
@@ -81,7 +81,7 @@
/* Othe Signatures may follow for informational purpos */
-
+
/* prototype for key comparing functions. */
typedef int (*hfsp_key_compare) (void* key1, void* key2);
@@ -92,13 +92,13 @@
/* Structures for a node cache. The cache is an array
* with linear search. (So making it to big may make
- * things slower). It is searched in a round robin
+ * things slower). It is searched in a round robin
* fashion.
*/
-typedef struct
+typedef struct
{
- UInt32 priority;
+ UInt32 priority;
// as lower this number as higher the priority.
// decremetned on any sucessfull usage
// incremented else, intial value height*DEPTHFACTOR
@@ -116,29 +116,29 @@
// contents of node in original byte order
} node_buf;
-typedef struct
+typedef struct
{
int size; // number of nodes in the cache
int currindex; // round robin index
int nodebufsize; // size of complete node_buf, including node
- node_entry *entries;
+ node_entry *entries;
char *buffers; // actually *node_buf
} node_cache;
-typedef struct
-{
+typedef struct
+{
struct volume* vol; /* pointer to volume this tree is part of */
hfsp_fork_raw* fork; /* pointer to fork this tree is part of */
UInt32 cnid; /* (pseudo) file id for the fork */
- hfsp_key_compare kcomp;
+ hfsp_key_compare kcomp;
/* function used for key compare in _this_ btree */
hfsp_key_read kread;
/* fucntion used to read a key int _this_ btree */
btree_head head;
-
+
UInt16 blkpernode;
/* Number of volume blocks per node (usually 1-4) */
- node_cache cache;
+ node_cache cache;
/* Warning all functions of btrees and records may modify
the following values ! */
// UInt16 node_index; /* index of node in fork */
@@ -158,22 +158,22 @@
UInt16 blksize_bits; /* blocksize of device = 1 << blksize_bits */
UInt16 filler;
UInt32 blksize; /* always 1 << blksize_bits */
- UInt32 startblock;
- /* Offset from physical to logical blocks,
- eventually intodruced by HFS wrapper */
+ UInt32 startblock;
+ /* Offset from physical to logical blocks,
+ eventually intodruced by HFS wrapper */
UInt32 maxblocks; /* maximum number of blocks in device */
// UInt32 currblock; /* value of current block, to cache blocks */
hfsp_vh vol; /* raw volume data */
// void* blockbuf; /* (single) buffer for fetching one block */
/* Buffer has double size of blksize to allow cross block reading */
-
+
btree* extents; /* is NULL by default and intialized when needed */
btree catalog; /* This is always neeeded */
-} volume;
+} volume;
/* Functions on volumes are defined in volume.h */
-typedef struct { // may not be used as found here
+typedef struct { // may not be used as found here
btree* tree; // tree where this record is contained in.
UInt16 node_index; /* index of record in btree */
UInt16 keyind; /* index of current key in btree */
@@ -181,7 +181,7 @@
UInt32 child; /* child node belonging to this key */
} index_record;
-typedef struct {
+typedef struct {
btree* tree; // tree where this record is contained in.
UInt16 node_index; /* index of record in btree */
UInt16 keyind; /* index of current key in btree */
Modified: openbios-devel/fs/hfsplus/include/record.h
===================================================================
--- openbios-devel/fs/hfsplus/include/record.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/hfsplus/include/record.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -6,7 +6,7 @@
*
* Copyright (C) 2000 Klaus Halfmann <khalfmann at libra.de>
* Original 1996-1998 Robert Leslie <rob at mars.org>
- * Additional work by Brad Boyer (flar at pants.nu)
+ * Additional work by Brad Boyer (flar at pants.nu)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -51,7 +51,7 @@
extern int record_init_parent(record* r, record* parent);
/* intialize the record by searching for the given string in the given folder.
- *
+ *
* parent and r may be the same.
*/
extern int record_init_string_parent(record* r, record* parent, char* key);
@@ -65,9 +65,9 @@
*/
extern int record_next(record* r);
-/* intialize the extent_record to the extent identified by
+/* intialize the extent_record to the extent identified by
* a given file */
-extern int record_init_file(extent_record* r, btree* tree,
+extern int record_init_file(extent_record* r, btree* tree,
UInt8 forktype, UInt32 fileId, UInt32 blockindex);
/* move foreward to next entent record. */
Modified: openbios-devel/fs/hfsplus/include/unicode.h
===================================================================
--- openbios-devel/fs/hfsplus/include/unicode.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/hfsplus/include/unicode.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -24,5 +24,5 @@
/* similar to strcmp for unicode, pascal strings */
-SInt32 fast_unicode_compare (const hfsp_unistr255 *ustr1,
+SInt32 fast_unicode_compare (const hfsp_unistr255 *ustr1,
const hfsp_unistr255 *ustr2);
Modified: openbios-devel/fs/hfsplus/include/volume.h
===================================================================
--- openbios-devel/fs/hfsplus/include/volume.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/hfsplus/include/volume.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -34,8 +34,8 @@
*
* returns given pointer or NULL on failure.
*/
-extern void* volume_readfromfork(volume* vol, void* buf,
- hfsp_fork_raw* f, UInt32 block,
+extern void* volume_readfromfork(volume* vol, void* buf,
+ hfsp_fork_raw* f, UInt32 block,
UInt32 count, UInt8 forktype, UInt32 fileId);
/* Fill a given buffer with the given block in volume.
@@ -57,7 +57,7 @@
/* Read a raw hfsp_extent_rec from memory. */
extern void* volume_readextent(void *p, hfsp_extent_rec er);
-/* Read fork information from raw memory */
+/* Read fork information from raw memory */
extern void* volume_readfork(void *p, hfsp_fork_raw* f);
/* internal function used to create the extents btree,
@@ -70,8 +70,8 @@
volume_create_extents_tree(vol);
return vol->extents;
}
-
+
#ifdef DEBUG
/* Print raw fork information to stdout */
void volume_print_fork(hfsp_fork_raw* f);
Modified: openbios-devel/fs/hfsplus/libhfsp.c
===================================================================
--- openbios-devel/fs/hfsplus/libhfsp.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/hfsplus/libhfsp.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -25,4 +25,4 @@
#include "openbios/config.h"
#include "libhfsp.h"
-const char *hfsp_error = "no error"; /* static error string */
+const char *hfsp_error = "no error"; /* static error string */
Modified: openbios-devel/fs/hfsplus/record.c
===================================================================
--- openbios-devel/fs/hfsplus/record.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/hfsplus/record.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -6,7 +6,7 @@
*
* Copyright (C) 2000 Klaus Halfmann <khalfmann at libra.de>
* Original 1996-1998 Robert Leslie <rob at mars.org>
- * Additional work by Brad Boyer (flar at pants.nu)
+ * Additional work by Brad Boyer (flar at pants.nu)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -52,7 +52,7 @@
/* check if keylenght was correct */
if (key_length != ((char*) p) - ((char*) check))
HFSP_ERROR(EINVAL, "Invalid key length in record_readkey");
- return p;
+ return p;
fail:
return NULL;
}
@@ -70,7 +70,7 @@
HFSP_ERROR(-1, "Invalid key length in record_extent_readkey");
key->file_id = bswabU32_inc(p);
key->start_block = bswabU32_inc(p);
- return p;
+ return p;
fail:
return NULL;
}
@@ -282,7 +282,7 @@
hfsp_cat_key* key2 = (hfsp_cat_key*) k2;
int diff = key2->parent_cnid - key1->parent_cnid;
if (!diff) // same parent
- diff = fast_unicode_compare(&key1->name, &key2->name);
+ diff = fast_unicode_compare(&key1->name, &key2->name);
return diff;
}
@@ -333,7 +333,7 @@
start = mid + 1;
else if (comp < 0)
end = mid;
- else
+ else
break;
}
if (!p) // Empty tree, fascinating ...
@@ -349,7 +349,7 @@
if (!p)
HFSP_ERROR(-1, "record_find_node: unexpected error");
}
-
+
index = bswabU32_inc(p);
node = btree_node_by_index(tree, index);
}
@@ -359,7 +359,7 @@
}
/* search for the given key in the btree.
- *
+ *
* returns pointer to memory just after key or NULL
* In any case *keyind recives the index where the
* key was found (or could be inserted.)
@@ -392,7 +392,7 @@
start = mid + 1;
else if (comp < 0)
end = mid;
- else
+ else
break;
}
if (!p) // Empty tree, fascinating ...
@@ -408,7 +408,7 @@
}
/* intialize the record by searching for the given key in the btree.
- *
+ *
* r is umodified on error.
*/
static int
@@ -417,7 +417,7 @@
int keyind;
UInt16 node_index;
void *p = record_find_key(tree, key, &keyind, &node_index);
-
+
if (p)
{
r -> tree = tree;
@@ -438,14 +438,14 @@
*
* forktype: either HFSP_EXTEND_DATA or HFSP_EXTEND_RSRC
*/
-int record_init_file(extent_record* r, btree* tree,
+int record_init_file(extent_record* r, btree* tree,
UInt8 forktype, UInt32 fileId, UInt32 blockindex)
{
int keyind;
UInt16 node_index;
hfsp_extent_key key = { 10, forktype, 0, fileId, blockindex };
void *p = record_find_key(tree, &key, &keyind, &node_index);
-
+
if (p)
{
r -> tree = tree;
@@ -466,7 +466,7 @@
int record_init_cnid(record* r, btree* tree, UInt32 cnid)
{
hfsp_cat_key thread_key; // the thread is the first record
-
+
thread_key.key_length = 6; // null name (like '.' in unix )
thread_key.parent_cnid = cnid;
thread_key.name.strlen = 0;
@@ -486,7 +486,7 @@
*r = *parent; // The folder thread is in fact the first entry, like '.'
return 0;
}
- HFSP_ERROR(EINVAL,
+ HFSP_ERROR(EINVAL,
"record_init_parent: parent is neither folder nor folder thread.");
fail:
@@ -513,9 +513,9 @@
}
return buf;
}
-/* move record foreward to next entry.
+/* move record foreward to next entry.
*
- * In case of an error the value of *r is undefined !
+ * In case of an error the value of *r is undefined !
*/
int record_next(record* r)
{
@@ -523,10 +523,10 @@
UInt16 index = r->keyind +1;
UInt32 parent;
node_buf* buf = prepare_next(tree, r->node_index, &index);
-
+
if (!buf)
return ENOENT; // No (more) such file or directory
-
+
parent = r->key.parent_cnid;
if (record_init(r, tree, buf, index))
@@ -539,9 +539,9 @@
return 0;
}
-/* move record foreward to next extent record.
+/* move record foreward to next extent record.
*
- * In case of an error the value of *r is undefined !
+ * In case of an error the value of *r is undefined !
*/
int record_next_extent(extent_record* r)
{
@@ -553,7 +553,7 @@
if (!buf)
return ENOENT; // No (more) such file or directory
-
+
file_id = r->key.file_id;
fork_type = r->key.fork_type;
@@ -569,13 +569,13 @@
}
/* intialize the record by searching for the given string in the given folder.
- *
+ *
* parent and r may be the same.
*/
int record_init_string_parent(record* r, record* parent, char* name)
{
hfsp_cat_key key;
-
+
if (parent->record.type == HFSP_FOLDER)
key.parent_cnid = parent->record.u.folder.id;
else if(parent->record.type == HFSP_FOLDER_THREAD)
@@ -632,8 +632,8 @@
/* print the key of a record */
static void record_print_key(hfsp_cat_key* key)
{
- char buf[255]; // mh this _might_ overflow
- unicode_uni2asc(buf, &key->name, 255);
+ char buf[255]; // mh this _might_ overflow
+ unicode_uni2asc(buf, &key->name, 255);
printf("parent cnid : %ld\n", key->parent_cnid);
printf("name : %s\n", buf);
}
@@ -687,7 +687,7 @@
printf( "fdLocation :\t"); record_print_Point(&finfo->fdLocation);
printf("\nfdFldr :\t%d\n", finfo->fdFldr);
}
-
+
/* print extended File info */
static void record_print_FXInfo(FXInfo* xinfo)
{
@@ -695,7 +695,7 @@
// xinfo -> fdUnused;
printf( "fdComment :\t%d\n", xinfo->fdComment);
printf( "fdPutAway :\t%ld\n", xinfo->fdPutAway);
-}
+}
/* print folder entry */
@@ -719,8 +719,8 @@
/* print info for a file or folder thread */
static void record_print_thread(hfsp_cat_thread* entry)
{
- char buf[255]; // mh this _might_ overflow
- unicode_uni2asc(buf, &entry->nodeName, 255);
+ char buf[255]; // mh this _might_ overflow
+ unicode_uni2asc(buf, &entry->nodeName, 255);
printf("parent cnid :\t%ld\n", entry->parentID);
printf("name :\t%s\n" , buf);
}
Modified: openbios-devel/fs/hfsplus/unicode.c
===================================================================
--- openbios-devel/fs/hfsplus/unicode.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/hfsplus/unicode.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -18,7 +18,7 @@
asc2uni( unsigned char *ustr, const char *astr, int maxlen )
{
int len;
-
+
if( maxlen <= 0 )
return 0;
@@ -35,10 +35,10 @@
uni2asc( char *astr, const unsigned char *ustr, int ustrlen, int maxlen )
{
int len;
-
+
if( maxlen <= 0 )
return 0;
-
+
for( len=0; ustrlen-- > 0 && len < maxlen-1 ; ustr += 2 ) {
/* might be unrepresentable (or too complicated for us) */
if( ustr[0] || !ustr[1] )
@@ -70,7 +70,7 @@
static const UInt16 gLowerCaseTable[];
-SInt32 fast_unicode_compare ( const hfsp_unistr255 *ustr1,
+SInt32 fast_unicode_compare ( const hfsp_unistr255 *ustr1,
const hfsp_unistr255 *ustr2)
{
register UInt16 c1,c2;
Modified: openbios-devel/fs/hfsplus/volume.c
===================================================================
--- openbios-devel/fs/hfsplus/volume.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/hfsplus/volume.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -5,7 +5,7 @@
*
* Copyright (C) 2000 Klaus Halfmann <khalfmann at libra.de>
* Original work by 1996-1998 Robert Leslie <rob at mars.org>
- * other work 2000 from Brad Boyer (flar at pants.nu)
+ * other work 2000 from Brad Boyer (flar at pants.nu)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -36,15 +36,15 @@
/* Fill a given buffer with the given block in volume.
*/
-int
+int
volume_readinbuf(volume * vol,void* buf, long block)
{
UInt16 blksize_bits;
ASSERT( block < vol->maxblocks);
-
- blksize_bits = vol->blksize_bits;
+
+ blksize_bits = vol->blksize_bits;
block += vol->startblock;
- if( os_seek(vol->os_fd, block, blksize_bits) == block)
+ if( os_seek(vol->os_fd, block, blksize_bits) == block)
if( 1 == os_read(vol->os_fd, buf, 1, blksize_bits))
return 0;
return -1;
@@ -54,9 +54,9 @@
*
* returns given pinter or NULL on failure.
*/
-void*
-volume_readfromfork(volume* vol, void* buf,
- hfsp_fork_raw* f, UInt32 block,
+void*
+volume_readfromfork(volume* vol, void* buf,
+ hfsp_fork_raw* f, UInt32 block,
UInt32 count, UInt8 forktype, UInt32 fileId)
{
blockiter iter;
@@ -71,7 +71,7 @@
if( volume_readinbuf(vol, cbuf, blockiter_curr(&iter)))
return NULL;
cbuf += vol->blksize;
- if( count > 0 && blockiter_next(&iter))
+ if( count > 0 && blockiter_next(&iter))
return NULL;
}
return buf;
@@ -79,7 +79,7 @@
/* Read a raw hfsp_extent_rec from memory.
- *
+ *
* return pointer right after the structure.
*/
void*
@@ -97,10 +97,10 @@
}
/* Read a raw hfsp_fork from memory.
- *
+ *
* return pointer right after the structure.
*/
-void*
+void*
volume_readfork(void *p, hfsp_fork_raw* f)
{
f->total_size = bswabU64_inc(p);
@@ -111,18 +111,18 @@
}
/* Read the volume from the given buffer and swap the bytes.
- *
- * ToDo: add more consitency checks.
+ *
+ * ToDo: add more consitency checks.
*/
static int
volume_readbuf(hfsp_vh* vh, char * p)
{
- if( (vh->signature = bswabU16_inc(p)) != HFSP_VOLHEAD_SIG)
+ if( (vh->signature = bswabU16_inc(p)) != HFSP_VOLHEAD_SIG)
HFSP_ERROR(-1, "This is not a HFS+ volume");
vh->version = bswabU16_inc(p);
- vh->attributes = bswabU32_inc(p);
- vh->last_mount_vers = bswabU32_inc(p);
+ vh->attributes = bswabU32_inc(p);
+ vh->last_mount_vers = bswabU32_inc(p);
vh->reserved = bswabU32_inc(p);
vh->create_date = bswabU32_inc(p);
vh->modify_date = bswabU32_inc(p);
@@ -139,7 +139,7 @@
vh->next_cnid = bswabU32_inc(p);
vh->write_count = bswabU32_inc(p);
vh->encodings_bmp = bswabU64_inc(p);
- memcpy(vh->finder_info, p, 32);
+ memcpy(vh->finder_info, p, 32);
p += 32; // So finderinfo must be swapped later, ***
p = volume_readfork(p, &vh->alloc_file );
p = volume_readfork(p, &vh->ext_file );
@@ -150,9 +150,9 @@
fail:
return -1;
}
-
+
/* Read the volume from the given block */
-static int
+static int
volume_read(volume * vol, hfsp_vh* vh, UInt32 block)
{
char buf[vol->blksize];
@@ -163,7 +163,7 @@
}
/* Find out wether the volume is wrapped and unwrap it eventually */
-static int
+static int
volume_read_wrapper(volume * vol, hfsp_vh* vh)
{
UInt16 signature;
@@ -179,19 +179,19 @@
UInt32 sect_per_block; /* how may block build an hfs sector */
UInt16 drAlBlSt; /* first allocation block in volume */
UInt16 embeds, embedl; /* Start/lenght of embedded area in blocks */
-
+
p += 0x12; /* skip unneded HFS vol fields */
drAlBlkSiz = bswabU32_inc(p); /* offset 0x14 */
p += 0x4; /* skip unneded HFS vol fields */
drAlBlSt = bswabU16_inc(p); /* offset 0x1C */
-
+
p += 0x5E; /* skip unneded HFS vol fields */
signature = bswabU16_inc(p); /* offset 0x7C, drEmbedSigWord */
if( signature != HFSP_VOLHEAD_SIG)
HFSP_ERROR(-1, "This looks like a normal HFS volume");
embeds = bswabU16_inc(p);
embedl = bswabU16_inc(p);
- sect_per_block = (drAlBlkSiz / HFSP_BLOCKSZ);
+ sect_per_block = (drAlBlkSiz / HFSP_BLOCKSZ);
// end is absolute (not relative to HFS+ start)
vol->maxblocks = embedl * sect_per_block;
vol->startblock = drAlBlSt + embeds * sect_per_block;
@@ -207,7 +207,7 @@
return -1;
}
-
+
/* Open the device, read and verify the volume header
(and its backup) */
int
@@ -223,12 +223,12 @@
vol->maxblocks = 3;
/* this should be enough until we find the volume descriptor */
vol->extents = NULL; /* Thanks to Jeremias Sauceda */
-
+
btree_reset(&vol->catalog);
vol->os_fd = os_fd;
- // vol->maxblocks = os_seek(vol->os_fd, -1, HFSP_BLOCKSZ_BITS);
- // This wont work for /dev/... but we do not really need it
+ // vol->maxblocks = os_seek(vol->os_fd, -1, HFSP_BLOCKSZ_BITS);
+ // This wont work for /dev/... but we do not really need it
if( volume_read_wrapper(vol, &vol->vol))
return -1;
@@ -249,17 +249,17 @@
shift++;
} /* shift = 3 */
}
- vol -> blksize_bits += shift;
+ vol -> blksize_bits += shift;
vol -> blksize = 1 << vol->blksize_bits;
vol -> startblock >>= shift;
vol -> maxblocks = vol->vol.total_blocks; /* cant calculate via shift ? */
-
+
if( btree_init_cat(&vol->catalog, vol, &vol->vol.cat_file))
return -1;
-
+
return 0;
}
-
+
/* Write back all data eventually cached and close the device */
int
volume_close(volume* vol)
@@ -274,7 +274,7 @@
/* internal fucntion used to create the extents btree,
is called by inline function when needed */
-void
+void
volume_create_extents_tree(volume* vol)
{
btree* result = (btree*) ALLOC(btree*, sizeof(btree));
@@ -285,5 +285,5 @@
return;
}
fail:
- vol->extents = NULL;
+ vol->extents = NULL;
}
Modified: openbios-devel/fs/ioglue.c
===================================================================
--- openbios-devel/fs/ioglue.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/fs/ioglue.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2001/05/06 22:27:09 samuel>
* Time-stamp: <2003/12/12 02:24:56 samuel>
- *
+ *
* <fs.c>
- *
+ *
* I/O API used by the filesystem code
- *
+ *
* Copyright (C) 2001, 2002, 2003 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation
- *
+ *
*/
#include "openbios/config.h"
Modified: openbios-devel/include/a.out.h
===================================================================
--- openbios-devel/include/a.out.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/include/a.out.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -63,7 +63,7 @@
#define NMAGIC 0410
/* Code indicating demand-paged executable. */
#define ZMAGIC 0413
-/* This indicates a demand-paged executable with the header in the text.
+/* This indicates a demand-paged executable with the header in the text.
The first page is unmapped to help trap NULL pointer references */
#define QMAGIC 0314
Modified: openbios-devel/include/amd64/io.h
===================================================================
--- openbios-devel/include/amd64/io.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/include/amd64/io.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -7,9 +7,9 @@
#define virt_to_phys(virt) ((unsigned long) (virt) + virt_offset)
#define __SLOW_DOWN_IO "outb %%al,$0x80;"
-static inline void slow_down_io(void)
+static inline void slow_down_io(void)
{
- __asm__ __volatile__(
+ __asm__ __volatile__(
__SLOW_DOWN_IO
#ifdef REALLY_SLOW_IO
__SLOW_DOWN_IO __SLOW_DOWN_IO __SLOW_DOWN_IO
Modified: openbios-devel/include/elf_boot.h
===================================================================
--- openbios-devel/include/elf_boot.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/include/elf_boot.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,5 +1,5 @@
-#ifndef ELF_BOOT_H
-#define ELF_BOOT_H
+#ifndef ELF_BOOT_H
+#define ELF_BOOT_H
/* This defines the structure of a table of parameters useful for ELF
@@ -34,7 +34,7 @@
Elf_Half b_records;
} Elf_Bhdr;
-/*
+/*
* ELF Notes.
*/
Modified: openbios-devel/include/ia64/io.h
===================================================================
--- openbios-devel/include/ia64/io.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/include/ia64/io.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -7,9 +7,9 @@
#define virt_to_phys(virt) ((unsigned long) (virt) + virt_offset)
#define __SLOW_DOWN_IO "outb %%al,$0x80;"
-static inline void slow_down_io(void)
+static inline void slow_down_io(void)
{
- __asm__ __volatile__(
+ __asm__ __volatile__(
__SLOW_DOWN_IO
#ifdef REALLY_SLOW_IO
__SLOW_DOWN_IO __SLOW_DOWN_IO __SLOW_DOWN_IO
@@ -46,7 +46,7 @@
BUILDIO(b,b,char)
BUILDIO(w,w,short)
BUILDIO(l,,int)
-#else
+#else
extern u8 inb( u32 reg );
extern u16 inw( u32 reg );
extern u32 inl( u32 reg );
Modified: openbios-devel/include/libc/diskio.h
===================================================================
--- openbios-devel/include/libc/diskio.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/include/libc/diskio.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2003/12/20 00:57:01 samuel>
* Time-stamp: <2004/01/07 19:32:29 samuel>
- *
+ *
* <diskio.h>
- *
- *
- *
+ *
+ *
+ *
* Copyright (C) 2003, 2004 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#ifndef _H_DISKIO
Modified: openbios-devel/include/libc/stdlib.h
===================================================================
--- openbios-devel/include/libc/stdlib.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/include/libc/stdlib.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,16 +1,16 @@
-/*
+/*
* Creation Date: <2003/12/19 18:52:20 samuel>
* Time-stamp: <2003/12/19 18:52:21 samuel>
- *
+ *
* <stdlib.h>
- *
- *
+ *
+ *
* Copyright (C) 2003 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#ifndef _H_STDLIB
Modified: openbios-devel/include/libc/string.h
===================================================================
--- openbios-devel/include/libc/string.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/include/libc/string.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2002/10/12 20:41:57 samuel>
* Time-stamp: <2003/10/25 12:51:22 samuel>
- *
+ *
* <string.h>
- *
+ *
* string library functions
- *
+ *
* Copyright (C) 2002, 2003 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation
- *
+ *
*/
#ifndef _H_STRING
Modified: openbios-devel/include/libc/vsprintf.h
===================================================================
--- openbios-devel/include/libc/vsprintf.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/include/libc/vsprintf.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2003/12/20 01:51:22 samuel>
* Time-stamp: <2004/01/07 19:02:17 samuel>
- *
+ *
* <vsprintf.h>
- *
- *
- *
+ *
+ *
+ *
* Copyright (C) 2003, 2004 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#ifndef _H_VSPRINTF
Modified: openbios-devel/include/mconfig.h
===================================================================
--- openbios-devel/include/mconfig.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/include/mconfig.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,4 +1,4 @@
-/*
+/*
* We got rid of configure for now, and I hope it stays like this.
* This file may have to be changed/reworked completely
*
Modified: openbios-devel/include/ofmem.h
===================================================================
--- openbios-devel/include/ofmem.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/include/ofmem.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <1999/11/16 00:47:06 samuel>
* Time-stamp: <2003/10/18 13:28:14 samuel>
- *
+ *
* <ofmem.h>
- *
- *
- *
+ *
+ *
+ *
* Copyright (C) 1999, 2002 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation
- *
+ *
*/
#ifndef _H_OFMEM
Modified: openbios-devel/include/openbios/bindings.h
===================================================================
--- openbios-devel/include/openbios/bindings.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/include/openbios/bindings.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2003/12/19 23:09:56 samuel>
* Time-stamp: <2004/01/07 19:36:42 samuel>
- *
+ *
* <bindings.h>
- *
+ *
* Forth bindings
- *
+ *
* Copyright (C) 2003, 2004 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#ifndef _H_BINDINGS
Modified: openbios-devel/include/openbios/config.h
===================================================================
--- openbios-devel/include/openbios/config.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/include/openbios/config.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2003/12/20 00:07:16 samuel>
* Time-stamp: <2004/01/19 17:40:26 stepan>
- *
+ *
* <config.h>
- *
- *
- *
+ *
+ *
+ *
* Copyright (C) 2003, 2004 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#ifndef _H_CONFIG
Modified: openbios-devel/include/openbios/drivers.h
===================================================================
--- openbios-devel/include/openbios/drivers.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/include/openbios/drivers.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,8 +1,8 @@
/*
* OpenBIOS driver prototypes
- *
+ *
* (C) 2004 Stefan Reinauer <stepan at openbios.org>
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
Modified: openbios-devel/include/openbios/elfload.h
===================================================================
--- openbios-devel/include/openbios/elfload.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/include/openbios/elfload.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2001/05/05 16:44:17 samuel>
* Time-stamp: <2003/10/22 23:18:42 samuel>
- *
+ *
* <elfload.h>
- *
+ *
* Elf loader
- *
+ *
* Copyright (C) 2001, 2003 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation
- *
+ *
*/
#ifndef _H_ELFLOAD
Modified: openbios-devel/include/openbios/fs.h
===================================================================
--- openbios-devel/include/openbios/fs.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/include/openbios/fs.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2001/05/06 17:12:45 samuel>
* Time-stamp: <2003/10/22 11:43:45 samuel>
- *
+ *
* <fs_loader.h>
- *
+ *
* Generic file system access
- *
+ *
* Copyright (C) 2001, 2002, 2003 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation
- *
+ *
*/
#ifndef _H_FS
Modified: openbios-devel/include/openbios/kernel.h
===================================================================
--- openbios-devel/include/openbios/kernel.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/include/openbios/kernel.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,18 +1,18 @@
-/*
+/*
* Creation Date: <2003/12/19 00:20:11 samuel>
* Time-stamp: <2004/01/07 19:19:14 samuel>
- *
+ *
* <kernel.h>
- *
- *
- *
+ *
+ *
+ *
* Copyright (C) 2003, 2004 Samuel Rydh (samuel at ibrium.se)
* Stefan Reinauer (stepan at openbios.org)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#ifndef _H_KERNEL
Modified: openbios-devel/include/openbios/nvram.h
===================================================================
--- openbios-devel/include/openbios/nvram.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/include/openbios/nvram.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2003/12/20 01:04:25 samuel>
* Time-stamp: <2004/01/07 19:59:11 samuel>
- *
+ *
* <nvram.h>
- *
+ *
* arch NVRAM interface
- *
+ *
* Copyright (C) 2003, 2004 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#ifndef _H_NVRAM
Modified: openbios-devel/include/openbios/of.h
===================================================================
--- openbios-devel/include/openbios/of.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/include/openbios/of.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2004/01/07 19:19:18 samuel>
* Time-stamp: <2004/01/07 19:19:48 samuel>
- *
+ *
* <of.h>
- *
+ *
* OpenFirmware related defines
- *
+ *
* Copyright (C) 2004 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#ifndef _H_OF
Modified: openbios-devel/include/ppc/asmdefs.h
===================================================================
--- openbios-devel/include/ppc/asmdefs.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/include/ppc/asmdefs.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,18 +1,18 @@
-/* -*- asm -*-
+/* -*- asm -*-
*
* Creation Date: <2001/02/03 19:38:07 samuel>
* Time-stamp: <2003/07/08 18:55:50 samuel>
- *
+ *
* <asmdefs.h>
- *
+ *
* Common assembly definitions
- *
+ *
* Copyright (C) 2001, 2002, 2003 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation
- *
+ *
*/
#ifndef _H_ASMDEFS
@@ -82,7 +82,7 @@
/* an underscore is needed on Darwin */
#define GLOBL( name ) .globl _##name ; name: ; _##name
#define EXTERN( name ) _##name
-#endif
+#endif
#define BIT(n) (1<<(31-(n)))
Modified: openbios-devel/include/ppc/processor.h
===================================================================
--- openbios-devel/include/ppc/processor.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/include/ppc/processor.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,16 +1,16 @@
-/*
+/*
* Creation Date: <2000/10/29 01:43:29 samuel>
* Time-stamp: <2003/07/27 22:37:49 samuel>
- *
+ *
* <processor.h>
- *
+ *
* Extract from <asm/processor.h>
- *
- *
+ *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation
- *
+ *
*/
#ifndef _H_PROCESSOR
@@ -144,7 +144,7 @@
#define S_PTELO 982 /* 7445/7455 */
#define S_L3PM 983 /* L3 Private Memory Address Control Register */
#define S_L3ITCR0 984 /* ??? */
-#define S_L3OHCR 1000 /* ??? */
+#define S_L3OHCR 1000 /* ??? */
#define S_L3ITCR1 1001 /* ??? */
#define S_L3ITCR2 1002 /* ??? */
#define S_L3ITCR3 1003 /* ??? */
Modified: openbios-devel/include/sys_info.h
===================================================================
--- openbios-devel/include/sys_info.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/include/sys_info.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -29,6 +29,6 @@
/* Our name and version. I want to see single instance of these in the image */
extern const char *program_name, *program_version;
-#define LOADER_NOT_SUPPORT 0xbadf11e
+#define LOADER_NOT_SUPPORT 0xbadf11e
#endif /* SYS_INFO_H */
Modified: openbios-devel/include/unix/plugin_pci.h
===================================================================
--- openbios-devel/include/unix/plugin_pci.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/include/unix/plugin_pci.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,5 +1,5 @@
/* tag: openbios pci plugin headers
- *
+ *
* Copyright (C) 2003 Stefan Reinauer
*
* See the file "COPYING" for further information about
Modified: openbios-devel/include/unix/plugins.h
===================================================================
--- openbios-devel/include/unix/plugins.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/include/unix/plugins.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -21,7 +21,7 @@
#define PLUGIN_LICENSE(license) const char *plugin_license=license;
#define PLUGIN_DESCRIPTION(desc) const char *plugin_description=desc;
-int register_iorange(const char *name, io_ops_t *ops,
+int register_iorange(const char *name, io_ops_t *ops,
unsigned int rstart, unsigned int rend);
io_ops_t *find_iorange(u32 reg);
Modified: openbios-devel/include/x86/io.h
===================================================================
--- openbios-devel/include/x86/io.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/include/x86/io.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -7,9 +7,9 @@
#define virt_to_phys(virt) ((unsigned long) (virt) + virt_offset)
#define __SLOW_DOWN_IO "outb %%al,$0x80;"
-static inline void slow_down_io(void)
+static inline void slow_down_io(void)
{
- __asm__ __volatile__(
+ __asm__ __volatile__(
__SLOW_DOWN_IO
#ifdef REALLY_SLOW_IO
__SLOW_DOWN_IO __SLOW_DOWN_IO __SLOW_DOWN_IO
Modified: openbios-devel/kernel/bootstrap.c
===================================================================
--- openbios-devel/kernel/bootstrap.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/kernel/bootstrap.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -104,20 +104,20 @@
ucell *reloc_table;
int pos, bit;
int l=(length+(sizeof(cell)-1))/sizeof(ucell), i;
-
+
/* prepare relocation table */
relocation_length=(length+BITS-1)/BITS;
reloc_table = malloc(relocation_length*sizeof(cell));
memset(reloc_table,0,relocation_length*sizeof(cell));
-
+
for (i=0; i<l; i++) {
-
+
pos=i/BITS;
bit=i&~(-BITS);
-
+
if(d1[i]==d2[i]) {
reloc_table[pos] &= target_ucell(~((ucell)1UL<<bit));
-
+
// This check might bring false positives in data.
//if(d1[i] >= pointer2cell(dict_one) &&
// d1[i] <= pointer2cell(dict_one+length))
@@ -148,7 +148,7 @@
/*
* get memory for dictionary
*/
-
+
write_len = sizeof(dictionary_header_t)+dicthead+relocation_length*sizeof(cell);
write_data = malloc(write_len);
if(!write_data) {
@@ -157,11 +157,11 @@
exit(1);
}
memset(write_data, 0, write_len);
-
+
/*
- * prepare dictionary header
+ * prepare dictionary header
*/
-
+
header = (dictionary_header_t *)write_data;
*header = (dictionary_header_t){
.signature = DICTID,
@@ -185,15 +185,15 @@
/*
* prepare dictionary data
*/
-
+
walk_data=write_data+sizeof(dictionary_header_t);
memcpy (walk_data, dict, dicthead);
-
+
/*
- * prepare relocation data.
+ * prepare relocation data.
* relocation_address is zero when writing a dictionary core.
*/
-
+
if (relocation_address) {
#ifdef CONFIG_DEBUG_DICTIONARY
printk("writing %d reloc cells \n",relocation_length);
@@ -207,9 +207,9 @@
} else {
header->relocation=0;
}
-
+
/*
- * Calculate Checksum
+ * Calculate Checksum
*/
walk_data=write_data;
@@ -218,11 +218,11 @@
walk_data+=sizeof(u32);
}
checksum=(u32)-checksum;
-
+
header->checksum=target_long(checksum);
-
+
dump_header(header);
-
+
f = fopen(filename, "w");
if (!f) {
printk("panic: can't write to dictionary '%s'.\n", filename);
@@ -329,7 +329,7 @@
/*
* parse_word is a small helper that skips whitespaces before a word.
- * it's behaviour is similar to the forth version parse-word.
+ * it's behaviour is similar to the forth version parse-word.
*/
static void parse_word(FILE * f, char *line)
@@ -381,7 +381,7 @@
printk("WARNING: tried to create unnamed word.\n");
return;
}
-
+
writestring(word);
/* get us at least 1 byte for flags */
writebyte(0);
@@ -479,8 +479,8 @@
exit(1);
}
- /* FIXME: We should read this file at
- * once. No need to get it char by char
+ /* FIXME: We should read this file at
+ * once. No need to get it char by char
*/
while (!feof(f)) {
@@ -655,7 +655,7 @@
else
num = strtoul(tib, &test, read_ucell(base));
-
+
if (*test != 0) {
/* what is it?? */
printk("%s is not defined.\n\n", tib);
@@ -692,10 +692,10 @@
/* we need a temporary place for latest outside the dictionary */
latest = &lfa;
-
+
/* starting a new dictionary: clear dicthead */
dicthead = 0;
-
+
#ifdef CONFIG_DEBUG_DICTIONARY
printk("building dictionary, %d primitives.\nbuilt words:",
sizeof(wordnames) / sizeof(void *));
@@ -721,7 +721,7 @@
*latest = target_ucell(pointer2cell(latest)-2*sizeof(cell));
base=buildvariable("base", 10);
-
+
buildconstant("/c", sizeof(u8));
buildconstant("/w", sizeof(u16));
buildconstant("/l", sizeof(u32));
@@ -759,12 +759,12 @@
int get_inputbyte( void )
{
int tmp;
-
+
if( cursrc < 1 ) {
runforth = 0;
return 0;
}
-
+
tmp = getc( srcfiles[cursrc-1] );
if (tmp != EOF)
return tmp;
@@ -810,14 +810,14 @@
exit(1);
}
-/*
+/*
* allocate memory and prepare engine for memory management.
*/
static void init_memory(void)
{
memset(memory, 0, MEMORY_SIZE);
-
+
/* we push start and end of memory to the stack
* so that it can be used by the forth word QUIT
* to initialize the memory allocator.
@@ -865,7 +865,7 @@
{
FILE *file = fopen_include(name);
int size;
-
+
if( !file ) {
printk("\npanic: Can't open '%s'\n", name );
exit(1);
@@ -873,7 +873,7 @@
fseek( file, 0, SEEK_END );
size = ftell( file );
fseek( file, 0, SEEK_SET );
-
+
printk("\nEncoding %s [%d bytes]\n", name, size );
fread( dict + dicthead, size, 1, file );
PUSH( pointer2cell(dict + dicthead) );
@@ -912,7 +912,7 @@
static void new_dictionary(const char *source)
{
build_dictionary();
-
+
interpret_source((char *)source);
printk("interpretion finished. %d errors occured.\n",
@@ -1035,10 +1035,10 @@
/*
- * Get all required resources
+ * Get all required resources
*/
-
-
+
+
ressources = malloc(MEMORY_SIZE + (2 * DICTIONARY_SIZE) + TRAMPOLINE_SIZE);
if (!ressources) {
printk("panic: not enough memory on host system.\n");
@@ -1048,13 +1048,13 @@
#ifdef NATIVE_BITWIDTH_SMALLER_THAN_HOST_BITWIDTH
base_address=(unsigned long)ressources;
#endif
-
+
memory = (ucell *)ressources;
-
+
bootstrapdict[0] = ressources + MEMORY_SIZE;
bootstrapdict[1] = ressources + MEMORY_SIZE + DICTIONARY_SIZE;
trampoline = (ucell *)(ressources + MEMORY_SIZE + DICTIONARY_SIZE + DICTIONARY_SIZE);
-
+
#ifdef CONFIG_DEBUG_INTERPRETER
printf("memory: %p\n",memory);
printf("dict1: %p\n",bootstrapdict[0]);
@@ -1064,9 +1064,9 @@
DICTIONARY_SIZE) + TRAMPOLINE_SIZE,
TRAMPOLINE_SIZE);
#endif
-
+
init_trampoline();
-
+
if (!segfault) {
if (verbose)
printk("Installing SIGSEGV handler...");
@@ -1079,11 +1079,11 @@
if (verbose)
printk("done.\n");
}
-
+
/*
* Now do the real work
*/
-
+
for (cnt=0; cnt<2; cnt++) {
printk("Compiling dictionary %d/%d\n", cnt+1, 2);
dict=bootstrapdict[cnt];
@@ -1095,7 +1095,7 @@
run_dictionary(basedict);
}
- if(errors)
+ if(errors)
break;
}
@@ -1108,7 +1108,7 @@
relocation_table( bootstrapdict[0], bootstrapdict[1], dicthead);
write_dictionary( dictname ? dictname : "bootstrap.dict");
}
-
+
free(ressources);
return 0;
}
Modified: openbios-devel/kernel/cross.h
===================================================================
--- openbios-devel/kernel/cross.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/kernel/cross.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,5 +1,5 @@
/* memory access abstraction layer for forth kernel
- *
+ *
* Copyright (C) 2005 Stefan Reinauer
*
* See the file "COPYING" for further information about
@@ -9,7 +9,7 @@
#ifndef __CROSS_H
#define __CROSS_H 1
-/* The forthstrap compiler has to abstract the underlying dictionary
+/* The forthstrap compiler has to abstract the underlying dictionary
* type: big/little endian, 32/64bit. All other binaries shall use
* unchanged memory access for performance.
*/
Modified: openbios-devel/kernel/dict.c
===================================================================
--- openbios-devel/kernel/dict.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/kernel/dict.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,6 +1,6 @@
/*
* tag: dict management
- *
+ *
* Copyright (C) 2003-2005 Stefan Reinauer, Patrick Mauritz
*
* See the file "COPYING" for further information about
@@ -39,7 +39,7 @@
/* lfa2cfa
* converts a link field address to a code field address.
- * in this forth implementation this is just a fixed offset
+ * in this forth implementation this is just a fixed offset
*/
static xt_t lfa2cfa(ucell ilfa)
@@ -151,16 +151,16 @@
len -= sizeof(dictionary_header_t);
dicthead = target_long(header->length);
-
+
memcpy(dict, data, dicthead);
reloc_table=(ucell *)(data+dicthead);
#ifdef CONFIG_DEBUG_DICTIONARY
- printk("\nmoving dictionary (%x bytes) to %x\n",
+ printk("\nmoving dictionary (%x bytes) to %x\n",
(ucell)dicthead, (ucell)dict);
printk("\ndynamic relocation...");
#endif
-
+
for (walk = (ucell *) dict; walk < (ucell *) (dict + dicthead);
walk++) {
int pos, bit, l;
Modified: openbios-devel/kernel/forth.c
===================================================================
--- openbios-devel/kernel/forth.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/kernel/forth.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -778,7 +778,7 @@
/*
- * unaligned-l! ( quad addr -- )
+ * unaligned-l! ( quad addr -- )
*/
static void unalignedlongwrite(void)
Modified: openbios-devel/kernel/include/dict.h
===================================================================
--- openbios-devel/kernel/include/dict.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/kernel/include/dict.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -37,7 +37,7 @@
ucell lfa2nfa(ucell ilfa);
ucell load_dictionary(const char *data, ucell len);
void dump_header(dictionary_header_t *header);
-
+
/* program counter */
extern ucell PC;
Modified: openbios-devel/kernel/internal.c
===================================================================
--- openbios-devel/kernel/internal.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/kernel/internal.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -20,7 +20,7 @@
#ifdef FCOMPILER
extern ucell *trampoline;
#else
-/* instead of pointing to an explicit 0 variable we
+/* instead of pointing to an explicit 0 variable we
* point behind the pointer.
*/
static ucell t[] = { DOCOL, 0, (ucell)(t+3), 0 };
@@ -98,7 +98,7 @@
* handle exceptions by returning immediately since the throw
* is supposed to abort the execution of this C-code too.
*/
-
+
if( rstackcnt != tmp )
printk("EXCEPTION DETECTED!\n");
#endif
@@ -157,7 +157,7 @@
}
/*
- * call ( ... function-ptr -- ??? )
+ * call ( ... function-ptr -- ??? )
*/
static void call(void)
{
@@ -172,7 +172,7 @@
#endif
}
-/*
+/*
* sys-debug ( errno -- )
*/
Modified: openbios-devel/kernel/primitives.c
===================================================================
--- openbios-devel/kernel/primitives.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/kernel/primitives.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -18,8 +18,8 @@
#include "cross.h"
-/*
- * Code Field Address (CFA) definitions (DOCOL and the like)
+/*
+ * Code Field Address (CFA) definitions (DOCOL and the like)
*/
#include "internal.c"
@@ -31,12 +31,12 @@
#include "forth.c"
/* words[] is a function array of all native code functions in used by
- * the dictionary, i.e. CFAs and primitives.
- * Any change here needs a matching change in the primitive word's
+ * the dictionary, i.e. CFAs and primitives.
+ * Any change here needs a matching change in the primitive word's
* name list that is kept for bootstrapping in arch/unix/unix.c
*
- * NOTE: THIS LIST SHALL NOT CHANGE (EXCEPT MANDATORY ADDITIONS AT
- * THE END). ANY OTHER CHANGE WILL BREAK COMPATIBILITY TO OLDER
+ * NOTE: THIS LIST SHALL NOT CHANGE (EXCEPT MANDATORY ADDITIONS AT
+ * THE END). ANY OTHER CHANGE WILL BREAK COMPATIBILITY TO OLDER
* BINARY DICTIONARIES.
*/
void * const words[] = {
Modified: openbios-devel/libc/diskio.c
===================================================================
--- openbios-devel/libc/diskio.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/libc/diskio.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2003/12/07 19:36:00 samuel>
* Time-stamp: <2004/01/07 19:28:43 samuel>
- *
+ *
* <diskio.c>
- *
+ *
* I/O wrappers
- *
+ *
* Copyright (C) 2003, 2004 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#include "openbios/config.h"
@@ -61,10 +61,10 @@
break;
if(fd==MAX_FD)
return -1;
-
+
fdp = malloc( sizeof(*fdp) );
- /* Better clear the fd, as it
- * contains valuable information
+ /* Better clear the fd, as it
+ * contains valuable information
*/
memset(fdp, 0, sizeof(*fdp));
fdp->ih = ih;
@@ -82,15 +82,15 @@
int fd;
ihandle_t ih = open_dev( spec );
priv_fd_t *fdp;
-
+
if( !ih )
return -1;
-
+
if( (fd=open_ih(ih)) == -1 ) {
close_dev( ih );
return -1;
}
-
+
fdp = file_descriptors[fd];
fdp->do_close = 1;
@@ -102,10 +102,10 @@
{
priv_fd_t *fdp = file_descriptors[fd];
int ret;
-
+
if( lookup_xt(fdp->ih, "reopen", &fdp->reopen_xt) )
return -1;
-
+
push_str( filename );
call_package( fdp->reopen_xt, fdp->ih );
ret = (POP() == (ucell)-1)? 0 : -1;
@@ -117,7 +117,7 @@
reopen_nwrom( int fd )
{
priv_fd_t *fdp = file_descriptors[fd];
-
+
if( lookup_xt(fdp->ih, "open-nwrom", &fdp->open_nwrom_xt) )
return -1;
call_package( fdp->open_nwrom_xt, fdp->ih );
@@ -166,12 +166,12 @@
{
priv_fd_t *fdp = file_descriptors[fd];
ucell ret;
-
+
PUSH( (ucell)buf );
PUSH( cnt );
call_package( fdp->read_xt, fdp->ih );
ret = POP();
-
+
if( !ret && cnt )
ret = -1;
return ret;
@@ -188,11 +188,11 @@
}
llong
-tell( int fd )
+tell( int fd )
{
priv_fd_t *fdp = file_descriptors[fd];
llong offs;
-
+
if( lookup_xt(fdp->ih, "tell", &fdp->tell_xt) )
return -1;
call_package( fdp->tell_xt, fdp->ih );
Modified: openbios-devel/libc/extra.c
===================================================================
--- openbios-devel/libc/extra.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/libc/extra.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2003/10/18 13:52:32 samuel>
* Time-stamp: <2003/10/18 13:54:24 samuel>
- *
+ *
* <extra.c>
- *
+ *
* Libc extras
- *
+ *
* Copyright (C) 2003 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#include "openbios/config.h"
Modified: openbios-devel/libc/misc.c
===================================================================
--- openbios-devel/libc/misc.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/libc/misc.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2002/10/19 21:05:07 samuel>
* Time-stamp: <2002/10/22 22:29:18 samuel>
- *
+ *
* <misc.c>
- *
+ *
* Miscellaneous
- *
+ *
* Copyright (C) 2002, 2003 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation
- *
+ *
*/
#include "openbios/config.h"
Modified: openbios-devel/libc/vsprintf.c
===================================================================
--- openbios-devel/libc/vsprintf.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/libc/vsprintf.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -216,7 +216,7 @@
/* get the precision */
precision = -1;
if (*fmt == '.') {
- ++fmt;
+ ++fmt;
if (isdigit(*fmt))
precision = skip_atoi(&fmt);
else if (*fmt == '*') {
Modified: openbios-devel/modules/bindings.c
===================================================================
--- openbios-devel/modules/bindings.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/modules/bindings.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2003/11/24 12:30:18 samuel>
* Time-stamp: <2004/01/07 19:37:38 samuel>
- *
+ *
* <bindings.c>
- *
+ *
* Forth bindings
- *
+ *
* Copyright (C) 2003, 2004 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#include "openbios/config.h"
@@ -297,10 +297,10 @@
get_property( phandle_t ph, const char *name, int *retlen )
{
int len;
-
+
if( retlen )
*retlen = -1;
-
+
push_str( name );
PUSH_ph( ph );
fword("get-package-property");
@@ -316,7 +316,7 @@
get_int_property( phandle_t ph, const char *name, int *retlen )
{
cell *p;
-
+
if( !(p=(cell *)get_property(ph, name, retlen)) )
return 0;
return __becell_to_cpu(*p);
@@ -378,7 +378,7 @@
{
if( !last )
return dt_iter_begin();
-
+
PUSH_ph( last );
fword("iterate-tree");
return POP_ph();
@@ -389,7 +389,7 @@
{
if( !last )
last = dt_iter_begin();
-
+
/* root node is never matched but we don't care about that */
while( (last=dt_iterate(last)) ) {
char *s = get_property( last, "device_type", NULL );
@@ -437,11 +437,11 @@
{
xt_t xt=0;
int i;
-
+
/* nodes might be matched multiple times */
if( find_package_method(methods[0].name, get_cur_dev()) )
return;
-
+
if( size ) {
PUSH( size );
fword("is-ibuf");
@@ -477,7 +477,7 @@
{
phandle_t save_ph = get_cur_dev();
int i;
-
+
for( i=0; i<npaths; i++ ) {
const char *name = paths[i];
@@ -512,7 +512,7 @@
const method_t *methods, int nmet )
{
phandle_t save_ph = get_cur_dev();
-
+
/* create node */
push_str( name );
fword("create-node");
Modified: openbios-devel/modules/client.c
===================================================================
--- openbios-devel/modules/client.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/modules/client.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,24 +1,24 @@
-/*
+/*
* Creation Date: <2003/11/25 14:29:08 samuel>
* Time-stamp: <2004/03/27 01:13:53 samuel>
- *
+ *
* <client.c>
- *
+ *
* OpenFirmware client interface
- *
+ *
* Copyright (C) 2003, 2004 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#include "openbios/config.h"
#include "openbios/bindings.h"
#include "openbios/of.h"
-/* OF client interface. r3 points to the argument array. On return,
+/* OF client interface. r3 points to the argument array. On return,
* r3 should contain 0==true or -1==false. r4-r12,cr0,cr1 may
* be modified freely.
*
@@ -39,7 +39,7 @@
handle_calls( prom_args_t *pb )
{
int i, dstacksave = dstackcnt;
-
+
/* printk("%s ([%d] -- [%d])\n", pb->service, pb->nargs, pb->nret ); */
for( i=pb->nargs-1; i>=0; i-- )
@@ -59,11 +59,11 @@
#if 0
/* useful for debug but not necessarily an error */
if( i != pb->nret || dstacksave != dstacksave ) {
- printk("%s '%s': possible argument error (%d--%d) got %d\n",
+ printk("%s '%s': possible argument error (%d--%d) got %d\n",
pb->service, (char*)pb->args[0], pb->nargs-2, pb->nret, i );
}
#endif
-
+
dstackcnt = dstacksave;
return 0;
}
@@ -81,12 +81,12 @@
for( i=0; i<pb->nargs; i++ )
printk("%lx ", pb->args[i] );
printk("\n");
-#endif
+#endif
/* call-method exceptions are special */
if( !strcmp("call-method", pb->service) || !strcmp("interpret", pb->service) )
return handle_calls( pb );
-
+
dstacksave = dstackcnt;
for( i=0; i<pb->nargs; i++ )
PUSH( pb->args[i] );
@@ -104,9 +104,9 @@
for( i=0; i<pb->nret && dstackcnt > dstacksave ; i++ )
pb->args[pb->nargs + i] = POP();
-
+
if( i != pb->nret || dstackcnt != dstacksave ) {
- printk("service %s: argument count error (%d %d)\n",
+ printk("service %s: argument count error (%d %d)\n",
pb->service, i, dstackcnt - dstacksave );
dstackcnt = dstacksave;
}
Modified: openbios-devel/modules/cmdline.c
===================================================================
--- openbios-devel/modules/cmdline.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/modules/cmdline.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2003/12/28 14:16:31 samuel>
* Time-stamp: <2004/01/07 10:37:40 samuel>
- *
+ *
* <cmdline.c>
- *
+ *
* OpenFirmwware User Interface
- *
+ *
* Copyright (C) 2003, 2004 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#include "openbios/config.h"
@@ -113,7 +113,7 @@
{
char *p = ci->history;
int len;
-
+
while( n-- && p )
if( (p=strchr(p,'\n')) )
p++;
@@ -133,7 +133,7 @@
history_remove( cmdline_info_t *ci, int line )
{
char *s, *p = history_get( ci, line );
-
+
if( !p || !(s=strchr(p, '\n')) )
return 1;
s++;
@@ -145,13 +145,13 @@
add_to_history( cmdline_info_t *ci, char *str )
{
int n, len;
-
+
if( !ci->history )
return 0;
len = strlen(str);
if( !len )
return 0;
-
+
/* make room for line in history */
for( ;; ) {
char *p;
@@ -159,7 +159,7 @@
if( n + len + 1 <= ci->hsize )
break;
-
+
if( !(p=strrchr(ci->history,'\n')) )
return 0;
*p = 0;
@@ -182,7 +182,7 @@
buf = ci->buf;
selfword("prepare");
-
+
emit('\n');
#ifdef NOLEAVE
for (;;)
@@ -191,13 +191,13 @@
#endif
{
int drop = 0;
-
+
if( prompt ) {
fword("print-prompt");
buf[0] = 0;
cur_added = prompt = histind = pos = n = 0;
}
-
+
switch( (ch=key()) ) {
case 27:
switch( key() ) {
@@ -312,7 +312,7 @@
fword("print-prompt");
move_cursor( pos-emit_str(buf) );
break;
-
+
//case 66: /* down */
// drop = 1;
case 14: /* ^n */
@@ -327,7 +327,7 @@
history_remove( ci, 0 );
}
break;
-
+
//case 65: /* up */
// drop = 1;
case 16: /* ^p */
@@ -344,7 +344,7 @@
}
if( (uint)ch < 32 )
drop = 1;
-
+
if( !drop && n < ci->ncol ) {
memmove( &buf[pos+1], &buf[pos], n+1-pos );
n++;
Modified: openbios-devel/modules/console.c
===================================================================
--- openbios-devel/modules/console.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/modules/console.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,15 +1,15 @@
-/*
+/*
* <console.c>
- *
+ *
* Simple text console
- *
+ *
* Copyright (C) 2002, 2003 Samuel Rydh (samuel at ibrium.se)
* Copyright (C) 2005 Stefan Reinauer <stepan at openbios.org>
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation
- *
+ *
*/
#include "openbios/config.h"
@@ -57,10 +57,10 @@
int x, y, xx, rskip, m;
int invert = (h==cons.x && v==cons.y && cons.cursor_on);
int ch = get_conschar( h, v );
-
+
while( h >= cons.w || v >= cons.h )
return;
-
+
h *= FONT_WIDTH;
v *= FONT_ADJ_HEIGHT;
@@ -106,36 +106,36 @@
static void
refresh( void )
{
- int i;
+ int i;
for( i=0; i<cons.h; i++ )
draw_line(i);
}
#endif
static int
-console_init( void )
+console_init( void )
{
if( video_get_res(&cons.physw,&cons.physh) < 0 )
return -1;
set_color( 0, 0 );
-
+
cons.w = cons.physw/FONT_WIDTH;
cons.h = cons.physh/FONT_ADJ_HEIGHT;
cons.buf = malloc( cons.w * cons.h );
- cons.inited = 1;
+ cons.inited = 1;
cons.x = cons.y = 0;
cons.vc_state = ESnormal;
return 0;
}
void
-console_close( void )
+console_close( void )
{
if( !cons.inited )
- return;
+ return;
free( cons.buf );
- cons.inited = 0;
+ cons.inited = 0;
}
static void
Modified: openbios-devel/modules/deblocker.c
===================================================================
--- openbios-devel/modules/deblocker.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/modules/deblocker.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2003/12/03 21:20:58 samuel>
* Time-stamp: <2004/01/07 19:34:50 samuel>
- *
+ *
* <deblocker.c>
- *
+ *
* deblocker implementation
- *
+ *
* Copyright (C) 2003, 2004 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#include "openbios/config.h"
@@ -81,7 +81,7 @@
RET(-1);
di->mark_hi = pos_hi;
di->mark_lo = pos_lo;
-
+
/* 0,1 == success, -1 == error */
PUSH(0);
}
@@ -130,7 +130,7 @@
w[1].len = w[1].nblks * di->blksize;
data += w[1].len;
len -= w[1].len;
-
+
w[2].blk_buf = di->buf;
w[2].data = data;
w[2].len = len;
@@ -147,7 +147,7 @@
ducell mark = ((ducell)di->mark_hi << BITS) | di->mark_lo;
/* printk("read: %x %x\n", (int)dest, len ); */
-
+
if( !xt )
return -1;
@@ -162,7 +162,7 @@
DO_IO( di->read_xt, w[i].blk_buf, blk, w[i].nblks );
memcpy( w[i].blk_buf + w[i].offs, w[i].data, w[i].len );
}
-
+
n = DO_IO( xt, w[i].blk_buf, blk, w[i].nblks );
if( n < 0 ) {
if( !retlen )
@@ -208,7 +208,7 @@
{ "open", deblk_open },
{ "close", deblk_close },
{ "read", deblk_read },
- { "write", deblk_write },
+ { "write", deblk_write },
{ "seek", deblk_seek },
{ "tell", deblk_tell },
};
Modified: openbios-devel/modules/disk-label.c
===================================================================
--- openbios-devel/modules/disk-label.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/modules/disk-label.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2003/12/03 22:10:45 samuel>
* Time-stamp: <2004/01/07 19:17:45 samuel>
- *
+ *
* <disk-label.c>
- *
+ *
* Partition support
- *
+ *
* Copyright (C) 2003, 2004 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#include "openbios/config.h"
@@ -21,7 +21,7 @@
typedef struct {
int fd;
-
+
ucell offs_hi, offs_lo;
ucell size_hi, size_lo;
int type; /* partition type or -1 */
@@ -85,7 +85,7 @@
PUSH( (ucell)block0 );
selfword("find-part-handler");
ph = POP_ph();
-
+
/* open partition package */
if( ph ) {
xt_t xt;
@@ -113,7 +113,7 @@
goto out;
}
success = 1;
-
+
out:
if( parstr )
free( parstr );
Modified: openbios-devel/modules/elfload.c
===================================================================
--- openbios-devel/modules/elfload.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/modules/elfload.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,4 +1,4 @@
-/* Mac-on-Linux ELF loader
+/* Mac-on-Linux ELF loader
Copyright (C) 2001-2003 Samuel Rydh
@@ -11,7 +11,7 @@
Copyright (C) 1999 Marius Vollmer
portions based on quik
-
+
Copyright (C) 1996 Paul Mackerras.
Because this program is derived from the corresponding file in the
@@ -44,12 +44,12 @@
find_elf( int fd )
{
int size, offs;
-
+
seek_io( fd, -1 );
size = tell( fd );
if( size > 0x10000 )
size = 0x10000;
-
+
for( offs=0; offs < size; offs+= BS )
if( is_elf(fd, offs) )
return offs;
@@ -82,18 +82,18 @@
{
int size;
Elf_phdr *ph;
-
+
if( !is_elf(fd, offs) ) {
printk("Not an ELF image\n");
return NULL;
}
-
+
seek_io( fd, offs );
if( read_io(fd, e, sizeof(*e)) != sizeof(*e) ) {
printk("\nCan't read ELF image header\n");
return NULL;
}
-
+
#if DEBUG
printk("ELF header:\n");
printk(" e.e_type = %d\n", (int)e->e_type);
Modified: openbios-devel/modules/filesystems.c
===================================================================
--- openbios-devel/modules/filesystems.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/modules/filesystems.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,18 +1,18 @@
-/*
+/*
* Creation Date: <2003/12/08 19:19:29 samuel>
* Time-stamp: <2004/01/07 19:22:40 samuel>
- *
+ *
* <filesystems.c>
- *
+ *
* generic filesystem support node
- *
+ *
* Copyright (C) 2003, 2004 Samuel Rydh (samuel at ibrium.se)
* Copyright (C) 2004 Stefan Reinauer
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#include "openbios/config.h"
@@ -47,9 +47,9 @@
if( !err ) {
err=fs_hfsp_open(fd, fs);
if( err ) err = fs_hfs_open(fd, fs);
- if( err ) err = fs_grubfs_open(fd, fs);
+ if( err ) err = fs_grubfs_open(fd, fs);
}
-
+
fs->fd = fd;
if( err ) {
@@ -76,7 +76,7 @@
{
fs_ops_t *fs = do_open( my_parent() );
char *name;
-
+
if( !fs )
RET( 0 );
@@ -90,7 +90,7 @@
/* printk("PATH: %s\n", fs->get_path(mi->file, mi->pathbuf, PATHBUF_SIZE) ); */
}
mi->fs = fs;
-
+
if( name )
free( name );
@@ -110,7 +110,7 @@
/* ( file-str len -- success? ) */
static void
-files_reopen( files_info_t *mi )
+files_reopen( files_info_t *mi )
{
file_desc_t *file = NULL;
char *name = pop_fstr_copy();
@@ -145,14 +145,14 @@
if( !mi->volname )
mi->volname = malloc( VOLNAME_SIZE );
-
+
ret = mi->fs->vol_name( mi->fs, mi->volname, VOLNAME_SIZE );
PUSH( (ucell)ret );
}
/* ( -- success? ) */
static void
-files_open_nwrom( files_info_t *mi )
+files_open_nwrom( files_info_t *mi )
{
file_desc_t *file = fs_search_rom( mi->fs );
do_reopen( mi, file );
@@ -180,7 +180,7 @@
int len = POP();
char *buf = (char*)POP();
int ret;
-
+
if( mi->file ) {
ret = mi->fs->read( mi->file, buf, len );
mi->filepos += ret;
@@ -204,7 +204,7 @@
{
llong pos = DPOP();
cell ret;
-
+
if( mi->file ) {
int offs = (int)pos;
int whence = SEEK_SET;
@@ -266,17 +266,17 @@
{ "open", files_open },
{ "close", files_close },
{ "read", files_read },
- { "write", files_write },
+ { "write", files_write },
{ "seek", files_seek },
{ "tell", files_tell },
-
+
/* special */
{ "reopen", files_reopen },
{ "open-nwrom", files_open_nwrom },
{ "get-path", files_get_path },
{ "get-fstype", files_get_fstype },
{ "volume-name", files_volume_name },
-
+
{ NULL, files_initializer },
};
Modified: openbios-devel/modules/init.c
===================================================================
--- openbios-devel/modules/init.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/modules/init.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2003/12/23 00:28:05 samuel>
* Time-stamp: <2003/12/28 19:43:41 samuel>
- *
+ *
* <init.c>
- *
+ *
* Module intialization
- *
+ *
* Copyright (C) 2003 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#include "openbios/config.h"
@@ -26,7 +26,7 @@
#endif
#ifdef CONFIG_DEBLOCKER
deblocker_init();
-#endif
+#endif
#ifdef CONFIG_DISK_LABEL
disklabel_init();
#endif
Modified: openbios-devel/modules/ipchecksum.c
===================================================================
--- openbios-devel/modules/ipchecksum.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/modules/ipchecksum.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -41,7 +41,7 @@
sum = ~sum & 0xFFFF;
new = ~new & 0xFFFF;
if (offset & 1) {
- /* byte swap the sum if it came from an odd offset
+ /* byte swap the sum if it came from an odd offset
* since the computation is endian independant this
* works.
*/
Modified: openbios-devel/modules/linuxbios.c
===================================================================
--- openbios-devel/modules/linuxbios.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/modules/linuxbios.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -11,7 +11,7 @@
#ifdef CONFIG_DEBUG_BOOT
#define debug printk
#else
-#define debug(x...)
+#define debug(x...)
#endif
#define for_each_lbrec(head, rec) \
@@ -19,7 +19,7 @@
(((char *)rec) < (((char *)head) + sizeof(*head) + head->table_bytes)) && \
(rec->size >= 1) && \
((((char *)rec) + rec->size) <= (((char *)head) + sizeof(*head) + head->table_bytes)); \
- rec = (struct lb_record *)(((char *)rec) + rec->size))
+ rec = (struct lb_record *)(((char *)rec) + rec->size))
static void convert_memmap(struct lb_memory *lbmem, struct sys_info *info)
{
@@ -67,7 +67,7 @@
count = 0;
end = ((char *)start) + length;
for(rec = start; ((void *)rec < end) &&
- ((signed long)rec->size <= (end - (void *)rec));
+ ((signed long)rec->size <= (end - (void *)rec));
rec = (void *)(((char *)rec) + rec->size)) {
count++;
}
@@ -80,7 +80,7 @@
/* For now be stupid.... */
for(ptr = start; (void *)ptr < end; ptr += 16) {
struct lb_header *head = (struct lb_header *)ptr;
- if ( (head->signature[0] != 'L') ||
+ if ( (head->signature[0] != 'L') ||
(head->signature[1] != 'B') ||
(head->signature[2] != 'I') ||
(head->signature[3] != 'O')) {
@@ -89,7 +89,7 @@
if (head->header_bytes != sizeof(*head))
continue;
debug("Found canidate at: %p\n", head);
- if (ipchksum((uint16_t *)head, sizeof(*head)) != 0)
+ if (ipchksum((uint16_t *)head, sizeof(*head)) != 0)
continue;
debug("header checksum o.k.\n");
if (ipchksum((uint16_t *)(ptr + sizeof(*head)), head->table_bytes) !=
Modified: openbios-devel/modules/linuxbios.h
===================================================================
--- openbios-devel/modules/linuxbios.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/modules/linuxbios.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -6,7 +6,7 @@
* is expected to be information that cannot be discovered by
* other means, such as quering the hardware directly.
*
- * All of the information should be Position Independent Data.
+ * All of the information should be Position Independent Data.
* That is it should be safe to relocated any of the information
* without it's meaning/correctnes changing. For table that
* can reasonably be used on multiple architectures the data
@@ -62,7 +62,7 @@
#define LB_MEM_RAM 1 /* Memory anyone can use */
#define LB_MEM_RESERVED 2 /* Don't use this memory region */
#define LB_MEM_TABLE 16 /* Ram configuration tables are kept in */
-
+
};
struct lb_memory {
@@ -128,7 +128,7 @@
uint32_t config; /* e=enumeration, h=hex, r=reserved */
uint32_t config_id; /* a number linking to an enumeration record */
#define CMOS_MAX_NAME_LENGTH 32
- uint8_t name[CMOS_MAX_NAME_LENGTH]; /* name of entry in ascii,
+ uint8_t name[CMOS_MAX_NAME_LENGTH]; /* name of entry in ascii,
variable length int aligned */
};
@@ -144,7 +144,7 @@
uint32_t config_id; /* a number identifying the config id */
uint32_t value; /* the value associated with the text */
#define CMOS_MAX_TEXT_LENGTH 32
- uint8_t text[CMOS_MAX_TEXT_LENGTH]; /* enum description in ascii,
+ uint8_t text[CMOS_MAX_TEXT_LENGTH]; /* enum description in ascii,
variable length int aligned */
};
Modified: openbios-devel/modules/mac-parts.c
===================================================================
--- openbios-devel/modules/mac-parts.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/modules/mac-parts.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2003/12/04 17:07:05 samuel>
* Time-stamp: <2004/01/07 19:36:09 samuel>
- *
+ *
* <mac-parts.c>
- *
+ *
* macintosh partition support
- *
+ *
* Copyright (C) 2003, 2004 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#include "openbios/config.h"
@@ -89,7 +89,7 @@
if( par.pmSig != 0x504d /* 'PM' */ || !par.pmPartBlkCnt )
RET(0);
-
+
di->offs = (llong)par.pmPyPartStart * bs;
di->size = (llong)par.pmPartBlkCnt * bs;
Modified: openbios-devel/modules/mac-parts.h
===================================================================
--- openbios-devel/modules/mac-parts.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/modules/mac-parts.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <1999/07/06 15:45:12 samuel>
* Time-stamp: <2002/10/20 16:31:48 samuel>
- *
+ *
* <partition_table.h>
- *
+ *
* Headers describing the partition table
- *
+ *
* Copyright (C) 1999, 2002 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation
- *
+ *
*/
#ifndef _H_PARTITION_TABLE
@@ -51,7 +51,7 @@
ulong pmPartBlkCnt; /* #blocks in partition */
char pmPartName[32]; /* partition name */
char pmPartType[32]; /* partition type */
-
+
/* these fields may or may not be used */
ulong pmLgDataStart;
ulong pmDataCnt;
Modified: openbios-devel/modules/modules.h
===================================================================
--- openbios-devel/modules/modules.h 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/modules/modules.h 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2003/12/23 00:32:12 samuel>
* Time-stamp: <2003/12/28 14:47:02 samuel>
- *
+ *
* <modules.h>
- *
+ *
* Module initialization
- *
+ *
* Copyright (C) 2003 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#ifndef _H_MODULES
Modified: openbios-devel/modules/nvram.c
===================================================================
--- openbios-devel/modules/nvram.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/modules/nvram.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2003/12/01 00:26:13 samuel>
* Time-stamp: <2004/01/07 19:59:53 samuel>
- *
+ *
* <nvram.c>
- *
+ *
* medium-level NVRAM handling
- *
+ *
* Copyright (C) 2003, 2004 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#include "openbios/config.h"
@@ -65,7 +65,7 @@
val = (val - 256 + 1) & 0xff;
}
return val;
-}
+}
static inline int
nvpart_size( nvpart_t *p )
@@ -114,11 +114,11 @@
{
nvpart_t *p = NULL;
int fs;
-
+
while( next_nvpart(&p) > 0 ) {
if( p->signature != NV_SIG_FREE )
continue;
-
+
fs = nvpart_size( p );
if( fs < size )
size = fs;
@@ -151,7 +151,7 @@
{
nvpart_t *p = NULL;
char buf[13];
-
+
while( next_nvpart(&p) > 0 ) {
memcpy( buf, p->name, sizeof(p->name) );
buf[12] = 0;
@@ -174,11 +174,11 @@
nvconf_init( void )
{
int once=0;
-
+
/* initialize nvram structure completely */
nvram.config = NULL;
nvram.config_size = 0;
-
+
nvram.size = arch_nvram_size();
nvram.data = malloc( nvram.size );
arch_nvram_get( nvram.data );
@@ -197,7 +197,7 @@
if( p->signature == NV_SIG_SYSTEM ) {
nvram.config = p;
nvram.config_size = nvpart_size(p) - 0x10;
-
+
if( !once++ ) {
PUSH( (ucell)p->data );
PUSH( nvram.config_size );
@@ -300,6 +300,6 @@
nvram_init( char *path )
{
nvconf_init();
-
+
REGISTER_NAMED_NODE( nvram, path );
}
Modified: openbios-devel/modules/pc-parts.c
===================================================================
--- openbios-devel/modules/pc-parts.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/modules/pc-parts.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,15 +1,15 @@
-/*
+/*
* pc partition support
- *
+ *
* Copyright (C) 2004 Stefan Reinauer
*
- * This code is based (and copied in many places) from
+ * This code is based (and copied in many places) from
* mac partition support by Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#include "openbios/config.h"
@@ -83,12 +83,12 @@
printk("pc partition magic not found.\n");
RET(0);
}
-
+
/* get partition data */
p = (struct pc_partition *) (buf + 0x1be);
bs=512;
-
+
if (parnum < 4) {
/* primary partition */
p += parnum;
@@ -101,27 +101,27 @@
/* printk("Primary partition at sector %x\n",
__le32_to_cpu(*((u32 *)p->start_sect))); */
-
+
RET( -1 );
} else {
/* Extended partition */
int i, cur_part;
unsigned long ext_start, cur_table;
-
+
/* Search for the extended partition
* which contains logical partitions */
for (i = 0; i < 4; i++) {
if (is_pc_extended_part(p[i].type))
break;
}
-
+
if (i >= 4) {
printk("Extended partition not found\n");
RET( 0 );
}
-
+
printk("Extended partition at %d\n", i+1);
-
+
/* Visit each logical partition labels */
ext_start = __le32_to_cpu(*((u32 *)p[i].start_sect));
cur_table = ext_start;
@@ -129,7 +129,7 @@
for (;;) {
/* printk("cur_part=%d at %x\n", cur_part, cur_table); */
-
+
SEEK( cur_table*bs );
if( READ(buf, sizeof(512)) != sizeof(512) )
RET( 0 );
@@ -138,7 +138,7 @@
printk("Extended partition has no magic\n");
break;
}
-
+
p = (struct pc_partition *) (buf + 0x1be);
/* First entry is the logical partition */
if (cur_part == parnum) {
@@ -151,7 +151,7 @@
di->size = (llong)__le32_to_cpu(*((u32 *)p->nr_sects)) * bs;
RET ( -1 );
}
-
+
/* Second entry is link to next partition */
if (!is_pc_extended_part(p[1].type)) {
printk("no link\n");
@@ -172,7 +172,7 @@
pcparts_probe( pcparts_info_t *dummy )
{
unsigned char *buf = (unsigned char *)POP();
-
+
RET ( has_pc_part_magic(buf) );
}
Modified: openbios-devel/modules/sun-parts.c
===================================================================
--- openbios-devel/modules/sun-parts.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/modules/sun-parts.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,15 +1,15 @@
-/*
+/*
* Sun (Sparc32/64) partition support
- *
+ *
* Copyright (C) 2004 Stefan Reinauer
*
- * This code is based (and copied in many places) from
+ * This code is based (and copied in many places) from
* mac partition support by Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
- *
+ *
*/
#include "openbios/config.h"
@@ -106,7 +106,7 @@
parnum = str[0] - 'a';
else
parnum = atol(str);
-
+
free( str );
}
@@ -156,7 +156,7 @@
sunparts_probe( __attribute__((unused))sunparts_info_t *dummy )
{
unsigned char *buf = (unsigned char *)POP();
-
+
RET ( has_sun_part_magic(buf) );
}
Modified: openbios-devel/modules/video.c
===================================================================
--- openbios-devel/modules/video.c 2008-12-11 17:10:03 UTC (rev 283)
+++ openbios-devel/modules/video.c 2008-12-11 20:30:53 UTC (rev 284)
@@ -1,17 +1,17 @@
-/*
+/*
* Creation Date: <2002/10/23 20:26:40 samuel>
* Time-stamp: <2004/01/07 19:39:15 samuel>
- *
+ *
* <video.c>
- *
+ *
* Mac-on-Linux display node
- *
+ *
* Copyright (C) 2002, 2003, 2004 Samuel Rydh (samuel at ibrium.se)
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation
- *
+ *
*/
#include "openbios/config.h"
@@ -57,7 +57,7 @@
return;
*(!i ? &width : &height) = atol(buf);
}
-
+
if( (s=width * height * 3) > 0x20000 )
return;
@@ -69,9 +69,9 @@
dx = (video.fb.w - width)/2;
dy = (video.fb.h - height)/3;
-
+
pp = (char*)video.fb.mphys + dy * video.fb.rb + dx * (video.fb.depth >= 24 ? 4 : 2);
-
+
for( y=0 ; y<height; y++, pp += video.fb.rb ) {
if( video.fb.depth >= 24 ) {
ulong *d = (ulong*)pp;
@@ -109,7 +109,7 @@
return 0;
}
-void
+void
draw_pixel( int x, int y, int colind )
{
char *p = (char*)video.fb.mphys + video.fb.rb * y;
@@ -221,7 +221,7 @@
int w, h;
(void) video_get_res( &w, &h );
PUSH( w );
- PUSH( h );
+ PUSH( h );
}
/* ( table start count -- ) (?) */
@@ -263,7 +263,7 @@
int y = POP();
int x = POP();
int color_ind = POP();
-
+
fill_rect( color_ind, x, y, w, h );
}
@@ -328,12 +328,12 @@
for( i=0; i<256; i++ )
set_color( i, i * 0x010101 );
-
+
set_color( 254, 0xffffcc );
fill_rect( 254, 0, 0, video.fb.w, video.fb.h );
refresh_palette();
startup_splash();
- REGISTER_NODE( video );
+ REGISTER_NODE( video );
}
More information about the OpenBIOS
mailing list