diff options
Diffstat (limited to 'bsps/sparc64/include/boot')
-rw-r--r-- | bsps/sparc64/include/boot/align.h | 48 | ||||
-rw-r--r-- | bsps/sparc64/include/boot/balloc.h | 52 | ||||
-rw-r--r-- | bsps/sparc64/include/boot/gentypes.h | 47 | ||||
-rw-r--r-- | bsps/sparc64/include/boot/main.h | 75 | ||||
-rw-r--r-- | bsps/sparc64/include/boot/ofw.h | 117 | ||||
-rw-r--r-- | bsps/sparc64/include/boot/ofw_tree.h | 61 | ||||
-rw-r--r-- | bsps/sparc64/include/boot/ofwarch.h | 41 | ||||
-rw-r--r-- | bsps/sparc64/include/boot/register.h | 39 | ||||
-rw-r--r-- | bsps/sparc64/include/boot/stack.h | 36 | ||||
-rw-r--r-- | bsps/sparc64/include/boot/types.h | 44 |
10 files changed, 560 insertions, 0 deletions
diff --git a/bsps/sparc64/include/boot/align.h b/bsps/sparc64/include/boot/align.h new file mode 100644 index 0000000000..96229101ed --- /dev/null +++ b/bsps/sparc64/include/boot/align.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2006 Jakub Jermar + * 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. + */ + +/** @addtogroup generic + * @{ + */ +/** @file + */ + +#ifndef BOOT_ALIGN_H_ +#define BOOT_ALIGN_H_ + +/** Align to the nearest higher address. + * + * @param addr Address or size to be aligned. + * @param align Size of alignment, must be power of 2. + */ +#define ALIGN_UP(addr, align) (((addr) + ((align) - 1)) & ~((align) - 1)) + +#endif + +/** @} + */ diff --git a/bsps/sparc64/include/boot/balloc.h b/bsps/sparc64/include/boot/balloc.h new file mode 100644 index 0000000000..8e502c0c58 --- /dev/null +++ b/bsps/sparc64/include/boot/balloc.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2006 Jakub Jermar + * 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. + */ + +/* + * Modifications are made to compile for RTEMS. Move BALLOC_MAX_SIZE from + * asm.h to here. + * + */ + + +#ifndef BOOT_BALLOC_H_ +#define BOOT_BALLOC_H_ + +#include <boot/types.h> + +#define BALLOC_MAX_SIZE (128 * 1024) + +typedef struct { + uintptr_t base; + size_t size; +} ballocs_t; + +extern void balloc_init(ballocs_t *ball, uintptr_t base, uintptr_t kernel_base); +extern void *balloc(size_t size, size_t alignment); +extern void *balloc_rebase(void *ptr); + +#endif diff --git a/bsps/sparc64/include/boot/gentypes.h b/bsps/sparc64/include/boot/gentypes.h new file mode 100644 index 0000000000..a3e82d6eef --- /dev/null +++ b/bsps/sparc64/include/boot/gentypes.h @@ -0,0 +1,47 @@ +/* + * 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. + */ + +/** @addtogroup generic + * @{ + */ +/** @file + */ + +#ifndef BOOT_GENTYPES_H_ +#define BOOT_GENTYPES_H_ + +#define NULL 0 +#define false 0 +#define true 1 + +typedef unsigned long size_t; + +#endif + +/** @} + */ diff --git a/bsps/sparc64/include/boot/main.h b/bsps/sparc64/include/boot/main.h new file mode 100644 index 0000000000..5ddc814ac8 --- /dev/null +++ b/bsps/sparc64/include/boot/main.h @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2005 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. + */ + +#ifndef BOOT_sparc64_MAIN_H_ +#define BOOT_sparc64_MAIN_H_ + +#include <boot/ofw.h> +#include <boot/ofw_tree.h> +#include <boot/balloc.h> +#include <boot/types.h> + +#define KERNEL_VIRTUAL_ADDRESS 0x400000 + +#define TASKMAP_MAX_RECORDS 32 + +/** Size of buffer for storing task name in task_t. */ +#define BOOTINFO_TASK_NAME_BUFLEN 32 + +#define BSP_PROCESSOR 1 +#define AP_PROCESSOR 0 + +#define SUBARCH_US 1 +#define SUBARCH_US3 3 + +typedef struct { + void *addr; + uint32_t size; + char name[BOOTINFO_TASK_NAME_BUFLEN]; +} task_t; + +typedef struct { + uint32_t count; + task_t tasks[TASKMAP_MAX_RECORDS]; +} taskmap_t; + +typedef struct { + uintptr_t physmem_start; + taskmap_t taskmap; + memmap_t memmap; + ballocs_t ballocs; + ofw_tree_node_t *ofw_root; +} bootinfo_t; + +extern uint32_t silo_ramdisk_image; +extern uint32_t silo_ramdisk_size; + +extern void start(void); +extern void bootstrap(void); + +#endif diff --git a/bsps/sparc64/include/boot/ofw.h b/bsps/sparc64/include/boot/ofw.h new file mode 100644 index 0000000000..c562b675a2 --- /dev/null +++ b/bsps/sparc64/include/boot/ofw.h @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2005 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. + */ + +#ifndef BOOT_OFW_H_ +#define BOOT_OFW_H_ + +#include <boot/types.h> +#include <stdarg.h> + +#define MEMMAP_MAX_RECORDS 32 +#define MAX_OFW_ARGS 12 + +#define OFW_TREE_PATH_MAX_LEN 256 +#define OFW_TREE_PROPERTY_MAX_NAMELEN 32 +#define OFW_TREE_PROPERTY_MAX_VALUELEN 64 + +typedef unative_t ofw_arg_t; +typedef unsigned int ihandle; +typedef unsigned int phandle; + +/** OpenFirmware command structure + * + */ +typedef struct { + ofw_arg_t service; /**< Command name. */ + ofw_arg_t nargs; /**< Number of in arguments. */ + ofw_arg_t nret; /**< Number of out arguments. */ + ofw_arg_t args[MAX_OFW_ARGS]; /**< List of arguments. */ +} ofw_args_t; + +typedef struct { + void *start; + uint32_t size; +} memzone_t; + +typedef struct { + uint32_t total; + uint32_t count; + memzone_t zones[MEMMAP_MAX_RECORDS]; +} memmap_t; + +typedef struct { + uint32_t info; + uint32_t addr_hi; + uint32_t addr_lo; +} pci_addr_t; + +typedef struct { + pci_addr_t addr; + uint32_t size_hi; + uint32_t size_lo; +} pci_reg_t; + +extern uintptr_t ofw_cif; + +extern phandle ofw_chosen; +extern ihandle ofw_stdout; +extern phandle ofw_root; +extern ihandle ofw_mmu; +extern phandle ofw_memory; + +extern void ofw_init(void); + +extern void ofw_write(const char *str, const int len); + +extern int ofw_get_property(const phandle device, const char *name, void *buf, const int buflen); +extern int ofw_get_proplen(const phandle device, const char *name); +extern int ofw_next_property(const phandle device, char *previous, char *buf); + +extern phandle ofw_get_child_node(const phandle node); +extern phandle ofw_get_peer_node(const phandle node); +extern phandle ofw_find_device(const char *name); + +extern int ofw_package_to_path(const phandle device, char *buf, const int buflen); + +extern int ofw(ofw_args_t *arg); +extern unsigned long ofw_call(const char *service, const int nargs, const int nret, ofw_arg_t *rets, ...); +extern void ofw_write(const char *str, const int len); +extern void ofw_read(void *str, const int len); +extern unsigned int ofw_get_address_cells(const phandle device); +extern unsigned int ofw_get_size_cells(const phandle device); +extern void *ofw_translate(const void *virt); +extern int ofw_translate_failed(ofw_arg_t flag); +extern void *ofw_claim_virt(const void *virt, const unsigned int len); +extern void *ofw_claim_phys(const void *virt, const unsigned int len); +extern void *ofw_claim_phys_any(const unsigned int len, const unsigned int alignment); +extern int ofw_map(const void *phys, const void *virt, const unsigned int size, const int mode); +extern int ofw_memmap(memmap_t *map); +extern void ofw_setup_screens(void); +extern void ofw_quiesce(void); + +#endif diff --git a/bsps/sparc64/include/boot/ofw_tree.h b/bsps/sparc64/include/boot/ofw_tree.h new file mode 100644 index 0000000000..5872ade261 --- /dev/null +++ b/bsps/sparc64/include/boot/ofw_tree.h @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2006 Jakub Jermar + * 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. + */ + +#ifndef BOOT_OFW_TREE_H_ +#define BOOT_OFW_TREE_H_ + +#include <boot/types.h> +#include <boot/ofw.h> + + +/** Memory representation of OpenFirmware device tree node property. */ +typedef struct { + char name[OFW_TREE_PROPERTY_MAX_NAMELEN]; + size_t size; + void *value; +} ofw_tree_property_t; + +/** Memory representation of OpenFirmware device tree node. */ +typedef struct ofw_tree_node { + struct ofw_tree_node *parent; + struct ofw_tree_node *peer; + struct ofw_tree_node *child; + + uint32_t node_handle; /**< Old OpenFirmware node handle. */ + + char *da_name; /**< Disambigued name. */ + + unsigned int properties; /**< Number of properties. */ + ofw_tree_property_t *property; + + void *device; /**< Member used solely by the kernel. */ +} ofw_tree_node_t; + +extern ofw_tree_node_t *ofw_tree_build(void); + +#endif diff --git a/bsps/sparc64/include/boot/ofwarch.h b/bsps/sparc64/include/boot/ofwarch.h new file mode 100644 index 0000000000..2d4f7643c0 --- /dev/null +++ b/bsps/sparc64/include/boot/ofwarch.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2006 Jakub Jermar + * 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. + */ + +#ifndef BOOT_sparc64_OFWARCH_H_ +#define BOOT_sparc64_OFWARCH_H_ + +#include "main.h" +#include "types.h" + +#define OFW_ADDRESS_CELLS 2 +#define OFW_SIZE_CELLS 2 + +extern int ofw_cpu(uint16_t mid_mask, uintptr_t physmem_start); +extern int ofw_get_physmem_start(uintptr_t *start); + +#endif diff --git a/bsps/sparc64/include/boot/register.h b/bsps/sparc64/include/boot/register.h new file mode 100644 index 0000000000..61bf34ac66 --- /dev/null +++ b/bsps/sparc64/include/boot/register.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2006 Jakub Jermar + * 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. + */ + +#ifndef BOOT_sparc64_REGISTER_H_ +#define BOOT_sparc64_REGISTER_H_ + +#define PSTATE_IE_BIT 2 +#define PSTATE_PRIV_BIT 4 +#define PSTATE_AM_BIT 8 + +#define ASI_ICBUS_CONFIG 0x4a +#define ICBUS_CONFIG_MID_SHIFT 17 + +#endif diff --git a/bsps/sparc64/include/boot/stack.h b/bsps/sparc64/include/boot/stack.h new file mode 100644 index 0000000000..1486dd21b4 --- /dev/null +++ b/bsps/sparc64/include/boot/stack.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2006 Jakub Jermar + * 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. + */ + +#ifndef BOOT_sparc64_STACK_H_ +#define BOOT_sparc64_STACK_H_ + +#define STACK_ALIGNMENT 16 +#define STACK_BIAS 2047 +#define STACK_WINDOW_SAVE_AREA_SIZE (16 * 8) + +#endif diff --git a/bsps/sparc64/include/boot/types.h b/bsps/sparc64/include/boot/types.h new file mode 100644 index 0000000000..095e25233d --- /dev/null +++ b/bsps/sparc64/include/boot/types.h @@ -0,0 +1,44 @@ +/* + * 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. + */ + +#ifndef BOOT_sparc64_TYPES_H_ +#define BOOT_sparc64_TYPES_H_ + +#include <boot/gentypes.h> + +typedef signed char int8_t; + +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +typedef unsigned long uint64_t; + +typedef uint64_t uintptr_t; +typedef uint64_t unative_t; + +#endif |