Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 1771 → Rev 1770

/boot/trunk/arch/ppc64/loader/ofw.c
29,27 → 29,7
#include <ofw.h>
#include <printf.h>
 
void write(const char *str, const int len)
void write(const char *str, const long len)
{
ofw_write(str, len);
}
 
int ofw_keyboard(keyboard_t *keyboard)
{
char device_name[BUF_SIZE];
if (ofw_get_property(ofw_aliases, "macio", device_name, sizeof(device_name)) <= 0)
return false;
phandle device = ofw_find_device(device_name);
if (device == -1)
return false;
pci_reg_t macio;
if (ofw_get_property(device, "assigned-addresses", &macio, sizeof(macio)) <= 0)
return false;
keyboard->addr = (void *) macio.addr.addr_lo;
keyboard->size = macio.size_lo;
 
return true;
}
/boot/trunk/arch/ppc32/loader/ofw.c
33,23 → 33,3
{
ofw_write(str, len);
}
 
int ofw_keyboard(keyboard_t *keyboard)
{
char device_name[BUF_SIZE];
if (ofw_get_property(ofw_aliases, "macio", device_name, sizeof(device_name)) <= 0)
return false;
phandle device = ofw_find_device(device_name);
if (device == -1)
return false;
pci_reg_t macio;
if (ofw_get_property(device, "assigned-addresses", &macio, sizeof(macio)) <= 0)
return false;
keyboard->addr = (void *) macio.addr.addr_lo;
keyboard->size = macio.size_lo;
 
return true;
}
/boot/trunk/arch/sparc64/loader/main.c
File deleted
/boot/trunk/arch/sparc64/loader/asm.h
File deleted
/boot/trunk/arch/sparc64/loader/types.h
File deleted
/boot/trunk/arch/sparc64/loader/main.h
File deleted
/boot/trunk/arch/sparc64/loader/ofw.c
File deleted
/boot/trunk/arch/sparc64/loader/Makefile
File deleted
/boot/trunk/arch/sparc64/loader/pack
File deleted
Property changes:
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/arch/sparc64/loader/asm.S
===================================================================
--- trunk/arch/sparc64/loader/asm.S (revision 1771)
+++ trunk/arch/sparc64/loader/asm.S (nonexistent)
@@ -1,45 +0,0 @@
-#
-# Copyright (C) 2006 Martin Decky
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# - Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# - Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# - The name of the author may not be used to endorse or promote products
-# derived from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-
-.text
-
-.global halt
-.global memcpy
-.global jump_to_kernel
-
-halt:
- b halt
- nop
-
-memcpy:
- b memcpy
- nop
-
-jump_to_kernel:
- b jump_to_kernel
- nop
Index: trunk/arch/sparc64/loader/boot.S
===================================================================
--- trunk/arch/sparc64/loader/boot.S (revision 1771)
+++ trunk/arch/sparc64/loader/boot.S (nonexistent)
@@ -1,38 +0,0 @@
-#
-# Copyright (C) 2006 Martin Decky
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# - Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# - Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# - The name of the author may not be used to endorse or promote products
-# derived from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-
-#define INITIAL_STACK 0x0
-
-.section BOOTSTRAP, "ax"
-
-.global start
-start:
- # TODO: set initial stack
-
- b bootstrap
- nop
Index: trunk/arch/sparc64/Makefile.inc
===================================================================
--- trunk/arch/sparc64/Makefile.inc (revision 1771)
+++ trunk/arch/sparc64/Makefile.inc (revision 1770)
@@ -31,7 +31,6 @@
build: image.iso
image.iso: kernel
- make -C arch/$(ARCH)/loader COMPILER=$(COMPILER) KERNELDIR=../../../$(KERNELDIR) USPACEDIR=../../../$(USPACEDIR) IMAGE=$(CONFIG_IMAGE)
mkdir -p $(TMP)/boot
mkdir -p $(TMP)/kernel
cat arch/$(ARCH)/silo/silo.tar.gz | (cd $(TMP)/boot; tar xvfz -)
/boot/trunk/genarch/ofw.h
29,12 → 29,16
#ifndef __OFW_H__
#define __OFW_H__
 
#include <types.h>
#include <stdarg.h>
#define NULL 0
#define MEMMAP_MAX_RECORDS 32
#define false 0
#define true 1
 
#define BUF_SIZE 1024
typedef __builtin_va_list va_list;
 
#define MEMMAP_MAX_RECORDS 32
#define va_start(ap, last) __builtin_va_start(ap, last)
#define va_arg(ap, type) __builtin_va_arg(ap, type)
#define va_end(ap) __builtin_va_end(ap)
 
typedef struct {
void *start;
60,30 → 64,10
unsigned int size;
} keyboard_t;
 
typedef struct {
unsigned int info;
unsigned int addr_hi;
unsigned int addr_lo;
} pci_addr_t;
 
typedef struct {
pci_addr_t addr;
unsigned int size_hi;
unsigned int size_lo;
} pci_reg_t;
 
typedef unsigned long ofw_arg_t;
typedef unsigned int ihandle;
typedef unsigned int phandle;
 
extern phandle ofw_aliases;
 
extern void init(void);
extern void ofw_write(const char *str, const int len);
 
extern int ofw_get_property(const phandle device, const char *name, const void *buf, const int buflen);
extern phandle ofw_find_device(const char *name);
 
extern void *ofw_translate(const void *virt);
extern int ofw_map(const void *phys, const void *virt, const int size, const int mode);
extern int ofw_memmap(memmap_t *map);
/boot/trunk/genarch/ofw.c
31,7 → 31,12
#include <asm.h>
 
#define MAX_OFW_ARGS 10
#define BUF_SIZE 1024
 
typedef unsigned int ofw_arg_t;
typedef unsigned int ihandle;
typedef unsigned int phandle;
 
/** OpenFirmware command structure
*
*/
44,6 → 49,20
 
typedef void (*ofw_entry)(ofw_args_t *);
 
 
typedef struct {
unsigned int info;
unsigned int addr_hi;
unsigned int addr_lo;
} pci_addr_t;
 
typedef struct {
pci_addr_t addr;
unsigned int size_hi;
unsigned int size_lo;
} pci_reg_t;
 
 
ofw_entry ofw;
 
phandle ofw_chosen;
80,13 → 99,13
}
 
 
phandle ofw_find_device(const char *name)
static phandle ofw_find_device(const char *name)
{
return ofw_call("finddevice", 1, 1, NULL, name);
}
 
 
int ofw_get_property(const phandle device, const char *name, const void *buf, const int buflen)
static int ofw_get_property(const phandle device, const char *name, const void *buf, const int buflen)
{
return ofw_call("getprop", 4, 1, NULL, device, name, buf, buflen);
}
185,8 → 204,8
 
int ofw_memmap(memmap_t *map)
{
unsigned long buf[BUF_SIZE];
int ret = ofw_get_property(ofw_memory, "reg", buf, sizeof(buf));
unsigned int buf[BUF_SIZE];
int ret = ofw_get_property(ofw_memory, "reg", buf, sizeof(unsigned int) * BUF_SIZE);
if (ret <= 0)
return false;
196,7 → 215,7
int pos;
map->total = 0;
map->count = 0;
for (pos = 0; (pos < ret / sizeof(unsigned long)) && (map->count < MEMMAP_MAX_RECORDS); pos += ac + sc) {
for (pos = 0; (pos < ret / sizeof(unsigned int)) && (map->count < MEMMAP_MAX_RECORDS); pos += ac + sc) {
void * start = (void *) buf[pos + ac - 1];
unsigned int size = buf[pos + ac + sc - 1];
214,7 → 233,7
{
char device_name[BUF_SIZE];
if (ofw_get_property(ofw_aliases, "screen", device_name, sizeof(device_name)) <= 0)
if (ofw_get_property(ofw_aliases, "screen", device_name, sizeof(char) * BUF_SIZE) <= 0)
return false;
phandle device = ofw_find_device(device_name);
239,3 → 258,24
return true;
}
 
 
int ofw_keyboard(keyboard_t *keyboard)
{
char device_name[BUF_SIZE];
if (ofw_get_property(ofw_aliases, "macio", device_name, sizeof(char) * BUF_SIZE) <= 0)
return false;
phandle device = ofw_find_device(device_name);
if (device == -1)
return false;
pci_reg_t macio;
if (ofw_get_property(device, "assigned-addresses", &macio, sizeof(macio)) <= 0)
return false;
keyboard->addr = (void *) macio.addr.addr_lo;
keyboard->size = macio.size_lo;
return true;
}