Changeset 94d614e in mainline for boot


Ignore:
Timestamp:
2006-07-13T17:32:38Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a5f76758
Parents:
63cda71
Message:

Remove OpenFirmware calls from kernel/ entirely.

Switch the sparc64 port to use bootinfo.

Copy memcpy from boot/ to sparc64 kernel/ and
adjust it for memcpy_from/to_uspace.

Location:
boot
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/sparc64/loader/asm.S

    r63cda71 r94d614e  
    9999
    100100jump_to_kernel:
    101         set ofw_cif, %l0
    102         jmp %o0                         ! jump to kernel
    103         ldx [%l0], %o4                  ! pass OpenFirmware address in %o4
     101        mov %o0, %l1
     102        mov %o1, %o0
     103        mov %o2, %o1
     104        jmp %l1                         ! jump to kernel
     105        nop
    104106
    105107.global ofw
  • boot/arch/sparc64/loader/main.c

    r63cda71 r94d614e  
    8181        printf("\nCopying components\n");
    8282        unsigned int top = 0;
    83         bootinfo.cnt = 0;
     83        bootinfo.taskmap.count = 0;
    8484        for (i = 0; i < COMPONENTS; i++) {
     85                void * base = (void *) KERNEL_VIRTUAL_ADDRESS;
     86       
    8587                printf(" %s...", components[i].name);
    8688                top = ALIGN_UP(top, PAGE_SIZE);
    87                 memcpy(((void *) KERNEL_VIRTUAL_ADDRESS) + top, components[i].start, components[i].size);
     89                memcpy(base + top, components[i].start, components[i].size);
    8890                if (i > 0) {
    89                         bootinfo.tasks[bootinfo.cnt].addr = ((void *) KERNEL_VIRTUAL_ADDRESS) + top;
    90                         bootinfo.tasks[bootinfo.cnt].size = components[i].size;
    91                         bootinfo.cnt++;
     91                        bootinfo.taskmap.tasks[bootinfo.taskmap.count].addr = base + top;
     92                        bootinfo.taskmap.tasks[bootinfo.taskmap.count].size = components[i].size;
     93                        bootinfo.taskmap.count++;
    9294                }
    9395                top += components[i].size;
  • boot/arch/sparc64/loader/main.h

    r63cda71 r94d614e  
    3131
    3232#include <ofw.h>
     33#include <types.h>
    3334
    3435#define TASKMAP_MAX_RECORDS 32
     
    3637typedef struct {
    3738        void *addr;
    38         unsigned int size;
     39        uint32_t size;
    3940} task_t;
    4041
    4142typedef struct {
    42         unsigned int cnt;
     43        uint32_t count;
    4344        task_t tasks[TASKMAP_MAX_RECORDS];
     45} taskmap_t;
     46
     47typedef struct {
     48        taskmap_t taskmap;
    4449        memmap_t memmap;
    4550        screen_t screen;
  • boot/genarch/ofw.c

    r63cda71 r94d614e  
    7575}
    7676
    77 
     77/** Perform a call to OpenFirmware client interface.
     78 *
     79 * @param service String identifying the service requested.
     80 * @param nargs Number of input arguments.
     81 * @param nret Number of output arguments. This includes the return value.
     82 * @param rets Buffer for output arguments or NULL. The buffer must accommodate nret - 1 items.
     83 *
     84 * @return Return value returned by the client interface.
     85 */
    7886static unsigned long ofw_call(const char *service, const int nargs, const int nret, ofw_arg_t *rets, ...)
    7987{
     
    8290        int i;
    8391       
    84         args.service = service;
     92        args.service = (ofw_arg_t) service;
    8593        args.nargs = nargs;
    8694        args.nret = nret;
  • boot/genarch/ofw.h

    r63cda71 r94d614e  
    4747 */
    4848typedef struct {
    49         const char *service;            /**< Command name */
    50         unsigned long nargs;            /**< Number of in arguments */
    51         unsigned long nret;             /**< Number of out arguments */
    52         ofw_arg_t args[MAX_OFW_ARGS];   /**< List of arguments */
     49        ofw_arg_t service;              /**< Command name. */
     50        ofw_arg_t nargs;                /**< Number of in arguments. */
     51        ofw_arg_t nret;                 /**< Number of out arguments. */
     52        ofw_arg_t args[MAX_OFW_ARGS];   /**< List of arguments. */
    5353} ofw_args_t;
    5454
    5555typedef struct {
    5656        void *start;
    57         unsigned int size;
     57        uint32_t size;
    5858} memzone_t;
    5959
    6060typedef struct {
    61         unsigned int total;
    62         unsigned int count;
     61        uint32_t total;
     62        uint32_t count;
    6363        memzone_t zones[MEMMAP_MAX_RECORDS];
    6464} memmap_t;
     
    6666typedef struct {
    6767        void *addr;
    68         unsigned int width;
    69         unsigned int height;
    70         unsigned int bpp;
    71         unsigned int scanline;
     68        uint32_t width;
     69        uint32_t height;
     70        uint32_t bpp;
     71        uint32_t scanline;
    7272} screen_t;
    7373
    7474typedef struct {
    7575        void *addr;
    76         unsigned int size;
     76        uint32_t size;
    7777} keyboard_t;
    7878
    7979typedef struct {
    80         unsigned int info;
    81         unsigned int addr_hi;
    82         unsigned int addr_lo;
     80        uint32_t info;
     81        uint32_t addr_hi;
     82        uint32_t addr_lo;
    8383} pci_addr_t;
    8484
    8585typedef struct {
    8686        pci_addr_t addr;
    87         unsigned int size_hi;
    88         unsigned int size_lo;
     87        uint32_t size_hi;
     88        uint32_t size_lo;
    8989} pci_reg_t;
    9090
Note: See TracChangeset for help on using the changeset viewer.