Changeset a8844e0 in mainline


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)

Location:
arch
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • arch/ppc32/loader/Makefile

    r89343aac ra8844e0  
    4747endif
    4848
    49 CFLAGS = -nostdinc -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -mcpu=powerpc
     49CFLAGS = -nostdinc -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -mcpu=powerpc -m32
    5050DEFS =
    5151
  • arch/ppc32/loader/_link.ld

    r89343aac ra8844e0  
    44 */
    55
    6 OUTPUT_FORMAT(elf32-powerpc)
     6OUTPUT_FORMAT("elf32-powerpc")
     7OUTPUT_ARCH(powerpc:common)
    78ENTRY(start)
    89
  • arch/ppc32/loader/printf.h

    r89343aac ra8844e0  
    3939typedef unsigned char __u8;
    4040typedef unsigned short __u16;
    41 typedef unsigned long __u32;
    42 typedef long long __u64;
     41typedef unsigned int __u32;
     42typedef unsigned long long __u64;
    4343
    4444typedef __u32 __address;
  • arch/ppc64/loader/Makefile

    r89343aac ra8844e0  
    4747endif
    4848
    49 CFLAGS = -nostdinc -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -mcpu=powerpc64
     49CFLAGS = -nostdinc -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -mcpu=powerpc64 -m64
    5050DEFS =
    5151
  • arch/ppc64/loader/_link.ld

    r89343aac ra8844e0  
    44 */
    55
    6 OUTPUT_FORMAT(elf64-powerpc)
     6OUTPUT_FORMAT("elf64-powerpc")
     7OUTPUT_ARCH("powerpc:common64")
    78ENTRY(start)
    89
  • arch/ppc64/loader/asm.S

    r89343aac ra8844e0  
    115115        # jumps to real_mode
    116116       
    117         mfmsrd r31
     117        mfmsr r31
    118118        lis r30, ~0@h
    119119        ori r30, r30, ~(msr_ir | msr_dr)@l
     
    247247        mtspr srr0, r31
    248248       
    249         mfmsrd r31
     249        mfmsr r31
    250250        ori r31, r31, (msr_ir | msr_dr)@l
    251251        mtspr srr1, r31
  • arch/ppc64/loader/asm.h

    r89343aac ra8844e0  
    4545
    4646extern void halt();
    47 extern void jump_to_kernel(void *bootinfo, unsigned int bootinfo_size, void *trans, unsigned int kernel_size, void *framebuffer, void *real_mode) __attribute__((noreturn));
     47extern void jump_to_kernel(void *bootinfo, unsigned long bootinfo_size, void *trans, unsigned long kernel_size, void *framebuffer, void *real_mode) __attribute__((noreturn));
    4848extern void real_mode();
    4949
  • arch/ppc64/loader/main.c

    r89343aac ra8844e0  
    3333#define KERNEL_START ((void *) &_binary_____________kernel_kernel_bin_start)
    3434#define KERNEL_END ((void *) &_binary_____________kernel_kernel_bin_end)
    35 #define KERNEL_SIZE ((unsigned int) KERNEL_END - (unsigned int) KERNEL_START)
     35#define KERNEL_SIZE ((unsigned long) KERNEL_END - (unsigned long) KERNEL_START)
    3636
    3737#define HEAP_GAP 1024000
     
    4242static void check_align(const void *addr, const char *desc)
    4343{
    44         if ((unsigned int) addr % PAGE_SIZE != 0) {
     44        if ((unsigned long) addr % PAGE_SIZE != 0) {
    4545                printf("Error: %s not on page boundary, halting.\n", desc);
    4646                halt();
     
    4949
    5050
    51 static void fix_overlap(void *va, void **pa, const char *desc, unsigned int *top)
     51static void fix_overlap(void *va, void **pa, const char *desc, unsigned long *top)
    5252{
    53         if ((unsigned int) *pa + PAGE_SIZE < *top) {
     53        if ((unsigned long) *pa + PAGE_SIZE < *top) {
    5454                printf("Warning: %s overlaps kernel physical area\n", desc);
    5555               
    56                 void *new_va = (void *) (ALIGN_UP((unsigned int) KERNEL_END + HEAP_GAP, PAGE_SIZE) + *top);
     56                void *new_va = (void *) (ALIGN_UP((unsigned long) KERNEL_END + HEAP_GAP, PAGE_SIZE) + *top);
    5757                void *new_pa = (void *) (HEAP_GAP + *top);
    5858                *top += PAGE_SIZE;
     
    6363                }
    6464               
    65                 if ((unsigned int) new_pa + PAGE_SIZE < KERNEL_SIZE) {
     65                if ((unsigned long) new_pa + PAGE_SIZE < KERNEL_SIZE) {
    6666                        printf("Error: %s cannot be relocated, halting.\n", desc);
    6767                        halt();
     
    104104        void *trans_pa = ofw_translate(&trans);
    105105        void *bootinfo_pa = ofw_translate(&bootinfo);
    106         void *fb = (void *) (((unsigned int) bootinfo.screen.addr) & ((unsigned int) ~0 << 17));
     106        void *fb = (void *) (((unsigned long) bootinfo.screen.addr) & ((unsigned long) ~0 << 17));
    107107       
    108108        printf("\nMemory statistics (total %d MB)\n", bootinfo.memmap.total >> 20);
     
    112112        printf(" translation table    at %L (physical %L)\n", &trans, trans_pa);
    113113       
    114         unsigned int top = ALIGN_UP(KERNEL_SIZE, PAGE_SIZE);
    115         unsigned int addr;
     114        unsigned long top = ALIGN_UP(KERNEL_SIZE, PAGE_SIZE);
     115        unsigned long addr;
    116116        for (addr = 0; addr < KERNEL_SIZE; addr += PAGE_SIZE) {
    117117                void *pa = ofw_translate(KERNEL_START + addr);
  • arch/ppc64/loader/main.h

    r89343aac ra8844e0  
    4444} bootinfo_t;
    4545
    46 extern int _binary_____________kernel_kernel_bin_start;
    47 extern int _binary_____________kernel_kernel_bin_end;
     46extern long _binary_____________kernel_kernel_bin_start;
     47extern long _binary_____________kernel_kernel_bin_end;
    4848extern void start(void);
    4949extern void bootstrap(void);
  • 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];
  • arch/ppc64/loader/ofw.h

    r89343aac ra8844e0  
    4343typedef struct {
    4444        void *start;
    45         unsigned int size;
     45        unsigned long size;
    4646} memzone_t;
    4747
    4848typedef struct {
    49         unsigned int total;
    50         unsigned int count;
     49        unsigned long total;
     50        unsigned long count;
    5151        memzone_t zones[MEMMAP_MAX_RECORDS];
    5252} memmap_t;
     
    5454typedef struct {
    5555        void *addr;
    56         unsigned int width;
    57         unsigned int height;
    58         unsigned int bpp;
    59         unsigned int scanline;
     56        unsigned long width;
     57        unsigned long height;
     58        unsigned long bpp;
     59        unsigned long scanline;
    6060} screen_t;
    6161
    6262
    6363extern void init(void);
    64 extern void ofw_write(const char *str, const int len);
     64extern void ofw_write(const char *str, const long len);
    6565
    6666extern void *ofw_translate(const void *virt);
    67 extern int ofw_map(const void *phys, const void *virt, const int size, const int mode);
    68 extern int ofw_memmap(memmap_t *map);
    69 extern int ofw_screen(screen_t *screen);
     67extern long ofw_map(const void *phys, const void *virt, const long size, const long mode);
     68extern long ofw_memmap(memmap_t *map);
     69extern long ofw_screen(screen_t *screen);
    7070
    7171#endif
  • arch/ppc64/loader/printf.c

    r89343aac ra8844e0  
    3535void puts(const char *str)
    3636{
    37         int len = 0;
     37        long len = 0;
    3838       
    3939        while (str[len] != 0)
     
    146146void printf(const char *fmt, ...)
    147147{
    148         int i = 0;
     148        long i = 0;
    149149        va_list ap;
    150150        char c;
  • arch/ppc64/loader/printf.h

    r89343aac ra8844e0  
    3939typedef unsigned char __u8;
    4040typedef unsigned short __u16;
    41 typedef unsigned long __u32;
    42 typedef long long __u64;
     41typedef unsigned int __u32;
     42typedef unsigned long __u64;
    4343
    44 typedef __u32 __address;
    45 typedef __u32 __native;
     44typedef __u64 __address;
     45typedef __u64 __native;
    4646
    4747typedef char *char_ptr;
Note: See TracChangeset for help on using the changeset viewer.