Changeset a8844e0 in mainline for arch/ppc64/loader/ofw.c


Ignore:
Timestamp:
2006-04-09T16:37:14Z (19 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e3dd773
Parents:
89343aac
Message:

fix types, 64b arguments (breaks things yet)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • arch/ppc64/loader/ofw.c

    r89343aac ra8844e0  
    3434#define BUF_SIZE                1024
    3535
    36 typedef unsigned int ofw_arg_t;
    37 typedef unsigned int ihandle;
    38 typedef unsigned int phandle;
     36typedef unsigned long ofw_arg_t;
     37typedef unsigned long ihandle;
     38typedef unsigned long phandle;
    3939
    4040/** OpenFirmware command structure
     
    4343typedef struct {
    4444        const char *service;          /**< Command name */
    45         unsigned int nargs;           /**< Number of in arguments */
    46         unsigned int nret;            /**< Number of out arguments */
     45        unsigned long nargs;           /**< Number of in arguments */
     46        unsigned long nret;            /**< Number of out arguments */
    4747        ofw_arg_t args[MAX_OFW_ARGS]; /**< List of arguments */
    4848} ofw_args_t;
     
    6161
    6262
    63 static int ofw_call(const char *service, const int nargs, const int nret, ofw_arg_t *rets, ...)
     63static long ofw_call(const char *service, const long nargs, const long nret, ofw_arg_t *rets, ...)
    6464{
    6565        va_list list;
    6666        ofw_args_t args;
    67         int i;
     67        long i;
    6868       
    6969        args.service = service;
     
    9494
    9595
    96 static int ofw_get_property(const phandle device, const char *name, const void *buf, const int buflen)
     96static long ofw_get_property(const phandle device, const char *name, const void *buf, const long buflen)
    9797{
    9898        return ofw_call("getprop", 4, 1, NULL, device, name, buf, buflen);
     
    100100
    101101
    102 static unsigned int ofw_get_address_cells(const phandle device)
    103 {
    104         unsigned int ret;
     102static unsigned long ofw_get_address_cells(const phandle device)
     103{
     104        unsigned long ret;
    105105       
    106106        if (ofw_get_property(device, "#address-cells", &ret, sizeof(ret)) <= 0)
     
    112112
    113113
    114 static unsigned int ofw_get_size_cells(const phandle device)
    115 {
    116         unsigned int ret;
     114static unsigned long ofw_get_size_cells(const phandle device)
     115{
     116        unsigned long ret;
    117117       
    118118        if (ofw_get_property(device, "#size-cells", &ret, sizeof(ret)) <= 0)
     
    164164
    165165
    166 void ofw_write(const char *str, const int len)
     166void ofw_write(const char *str, const long len)
    167167{
    168168        if (ofw_stdout == 0)
     
    185185
    186186
    187 int ofw_map(const void *phys, const void *virt, const int size, const int mode)
     187long ofw_map(const void *phys, const void *virt, const long size, const long mode)
    188188{
    189189        return ofw_call("call-method", 6, 1, NULL, "map", ofw_mmu, mode, size, virt, phys);
     
    191191
    192192
    193 int ofw_memmap(memmap_t *map)
    194 {
    195         unsigned int buf[BUF_SIZE];
    196         int ret = ofw_get_property(ofw_memory, "reg", buf, sizeof(unsigned int) * BUF_SIZE);
     193long ofw_memmap(memmap_t *map)
     194{
     195        unsigned long buf[BUF_SIZE];
     196        long ret = ofw_get_property(ofw_memory, "reg", buf, sizeof(unsigned long) * BUF_SIZE);
    197197        if (ret <= 0)
    198198                return false;
    199199               
    200         unsigned int ac = ofw_get_address_cells(ofw_memory);
    201         unsigned int sc = ofw_get_size_cells(ofw_memory);
    202        
    203         int pos;
     200        unsigned long ac = ofw_get_address_cells(ofw_memory);
     201        unsigned long sc = ofw_get_size_cells(ofw_memory);
     202       
     203        long pos;
    204204        map->total = 0;
    205205        map->count = 0;
    206         for (pos = 0; (pos < ret / sizeof(unsigned int)) && (map->count < MEMMAP_MAX_RECORDS); pos += ac + sc) {
     206        for (pos = 0; (pos < ret / sizeof(unsigned long)) && (map->count < MEMMAP_MAX_RECORDS); pos += ac + sc) {
    207207                void * start = (void *) buf[pos + ac - 1];
    208                 unsigned int size = buf[pos + ac + sc - 1];
     208                unsigned long size = buf[pos + ac + sc - 1];
    209209               
    210210                if (size > 0) {
     
    218218
    219219
    220 int ofw_screen(screen_t *screen)
     220long ofw_screen(screen_t *screen)
    221221{
    222222        char device_name[BUF_SIZE];
Note: See TracChangeset for help on using the changeset viewer.