Changeset 2e672fd in mainline for genarch/ofw.h


Ignore:
Timestamp:
2006-07-10T20:48:40Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
daab5145
Parents:
822b64e
Message:

Some 32-bit vs. 64-bit fixes.

Make the call to OpenFirmware client interface architecture dependent.
For instance and contrary to my previous experience, the sparc64 version of
'translate' method would not work reliably unless the Address Mask bit in the
PSTATE register is cleared during duration of the call.

sparc64 and ppc32 OpenFirmware seem to differ in details, for example, the above
mentioned method 'translate' signals success by setting the first return value
to -1 on sparc64 while on ppc32 the value is/stays (???) zero.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • genarch/ofw.h

    r822b64e r2e672fd  
    3737#define MEMMAP_MAX_RECORDS      32
    3838
     39#define MAX_OFW_ARGS            12
     40
     41typedef unsigned long ofw_arg_t;
     42typedef unsigned int ihandle;
     43typedef unsigned int phandle;
     44
     45/** OpenFirmware command structure
     46 *
     47 */
     48typedef 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 */
     53} ofw_args_t;
     54
    3955typedef struct {
    4056        void *start;
     
    4965
    5066typedef struct {
    51         void *addr;
     67        uint32_t addr;
    5268        unsigned int width;
    5369        unsigned int height;
     
    5773
    5874typedef struct {
    59         void *addr;
     75        uint32_t addr;
    6076        unsigned int size;
    6177} keyboard_t;
     
    7389} pci_reg_t;
    7490
    75 typedef unsigned long ofw_arg_t;
    76 typedef unsigned int ihandle;
    77 typedef unsigned int phandle;
     91extern uintptr_t ofw_cif;
    7892
    7993extern phandle ofw_aliases;
     
    8599extern phandle ofw_find_device(const char *name);
    86100
     101extern int ofw(ofw_args_t *arg);
    87102extern void *ofw_translate(const void *virt);
     103extern int ofw_translate_failed(ofw_arg_t flag);
     104extern void *ofw_claim(const void *virt, const int len);
    88105extern int ofw_map(const void *phys, const void *virt, const int size, const int mode);
    89106extern int ofw_memmap(memmap_t *map);
Note: See TracChangeset for help on using the changeset viewer.