Changeset 39cb79a in mainline


Ignore:
Timestamp:
2005-10-29T13:37:52Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2cd0485d
Parents:
b9b103d3
Message:

sparc64 work.
Link kernel with load address 0x4000.
Add fragment of Linux image header to force SILO to always load the kernel at 0x4000.
Adjust ofw.h and ofw.c to work also on sparc64.

Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • arch/sparc64/Makefile.inc

    rb9b103d3 r39cb79a  
    2020arch_sources= \
    2121        src/arch/dummy.s \
    22         src/arch/start.S
     22        src/arch/start.S \
     23        src/arch/sparc64.c
     24
  • arch/sparc64/_link.ld

    rb9b103d3 r39cb79a  
    1212
    1313SECTIONS {
    14         .image 0x80000000: AT (0x80000000) {
     14        .image 0x4000: AT (0x4000) {
    1515                ktext_start = .;
    1616                *(K_TEXT_START)
     
    3131                LONG(kdata_end - kdata_start);
    3232                hardcoded_load_address = .;
    33                 LONG(0x80000000);
     33                LONG(0x4000);
    3434                *(.bss);                /* uninitialized static variables */   
    3535                *(COMMON);              /* global variables */
  • arch/sparc64/src/dummy.s

    rb9b103d3 r39cb79a  
    2929.text
    3030
    31 .global arch_late_init
    32 .global arch_post_mm_init
    33 .global arch_pre_mm_init
    3431.global asm_delay_loop
    3532.global before_thread_runs_arch
    36 .global calibrate_delay_loop
    3733.global context_restore_arch
    3834.global context_save_arch
     
    6056.global dummy
    6157
    62 arch_late_init:
    63 arch_post_mm_init:
    64 arch_pre_mm_init:
    6558asm_delay_loop:
    6659before_thread_runs_arch:
    67 calibrate_delay_loop:
    6860context_restore_arch:
    6961context_save_arch:
  • arch/sparc64/src/start.S

    rb9b103d3 r39cb79a  
    3232kernel_image_start:
    33330:
    34         b 0b
     34        b 1f
    3535        nop
     36
     37#
     38# This header forces SILO to load the kernel at 0x4000.
     39# More precisely, SILO will think this is an old version of Linux.
     40#
     41.ascii "HdrS"
     42.word 0
     43.half 0
     44
     45.align 8
     46
     471:
     48        set ofw, %l0
     49        stx %o4, [%l0]
     50
     51        call ofw_init
     52        nop
     53
     542:
     55        b 2b
     56        nop
     57
  • genarch/include/firmware/ofw/ofw.h

    rb9b103d3 r39cb79a  
    3434#define MAX_OFW_ARGS    10
    3535
    36 typedef __u32 ofw_arg_t;
    37 typedef __u32 ihandle;
    38 typedef __u32 phandle;
     36typedef __native ofw_arg_t;
     37typedef int ihandle;
     38typedef int phandle;
    3939
    4040/** OpenFirmware command structure
     
    4343typedef struct {
    4444        const char *service;          /**< Command name */
    45         __u32 nargs;                  /**< Number of in arguments */
    46         __u32 nret;                   /**< Number of out arguments */
     45        __native nargs;               /**< Number of in arguments */
     46        __native nret;                /**< Number of out arguments */
    4747        ofw_arg_t args[MAX_OFW_ARGS]; /**< List of arguments */
    4848} ofw_args_t;
     
    5454extern void ofw_init(void);
    5555extern void ofw_done(void);
    56 extern __address ofw_call(const char *service, const int nargs, const int nret, ...);
     56extern __native ofw_call(const char *service, const int nargs, const int nret, ...);
    5757extern void ofw_putchar(const char ch);
    5858extern phandle ofw_find_device(const char *name);
  • genarch/src/firmware/ofw/ofw.c

    rb9b103d3 r39cb79a  
    5050void ofw_done(void)
    5151{
    52         ofw_call("exit", 0, 0);
     52        (void) ofw_call("exit", 0, 0);
    5353        cpu_halt();
    5454}
    5555
    56 __address ofw_call(const char *service, const int nargs, const int nret, ...)
     56__native ofw_call(const char *service, const int nargs, const int nret, ...)
    5757{
    5858        va_list list;
     
    8282                return;
    8383       
    84         ofw_call("write", 3, 1, ofw_stdout, &ch, 1);
     84        (void) ofw_call("write", 3, 1, ofw_stdout, &ch, 1);
    8585}
    8686
    8787phandle ofw_find_device(const char *name)
    8888{
    89         return ofw_call("finddevice", 1, 1, name);
     89        return (phandle) ofw_call("finddevice", 1, 1, name);
    9090}
    9191
    9292int ofw_get_property(const phandle device, const char *name, void *buf, const int buflen)
    9393{
    94         return ofw_call("getprop", 4, 1, device, name, buf, buflen);
     94        return (int) ofw_call("getprop", 4, 1, device, name, buf, buflen);
    9595}
    9696
Note: See TracChangeset for help on using the changeset viewer.