Changeset 42744880 in mainline


Ignore:
Timestamp:
2006-02-08T22:29:20Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
85dc2e7
Parents:
89298e3
Message:

Convert size_t, count_t and index_t to 64-bits on 64-bit architectures.
Change some pfn_t usages to count_t, size_t and index_t.

Files:
12 edited

Legend:

Unmodified
Added
Removed
  • arch/amd64/_link.ld.in

    r89298e3 r42744880  
    3939                QUAD(kdata_end - kdata_start + (unmapped_kdata_end - unmapped_kdata_start));
    4040                hardcoded_unmapped_ktext_size = .;
    41                 LONG(unmapped_ktext_end - unmapped_ktext_start);
     41                QUAD(unmapped_ktext_end - unmapped_ktext_start);
    4242                hardcoded_unmapped_kdata_size = .;
    43                 LONG(unmapped_kdata_end - unmapped_kdata_start);
     43                QUAD(unmapped_kdata_end - unmapped_kdata_start);
    4444                *(COMMON);              /* global variables */
    4545
  • arch/amd64/src/asm_utils.S

    r89298e3 r42744880  
    219219.global interrupt_handler_size
    220220
    221 interrupt_handler_size: .long (h_end-h_start)/IDT_ITEMS
     221interrupt_handler_size: .quad (h_end-h_start)/IDT_ITEMS
  • arch/amd64/src/boot/boot.S

    r89298e3 r42744880  
    165165               
    166166                xorq %rdx, %rdx
     167                movq %rdx, %rcx
    167168                movl 24(%ebx), %esi                                             # mbi->mods_addr
    168169                movl 0(%esi), %edx                                              # mods->mod_start
     
    172173               
    173174                mods_invalid:
    174                 movl %ecx, init_size
     175                movq %rcx, init_size
    175176                movq %rdx, init_addr
    176177               
  • arch/ia32/src/mm/frame.c

    r89298e3 r42744880  
    4242#include <console/kconsole.h>
    4343
    44 
    4544size_t hardcoded_unmapped_ktext_size = 0;
    4645size_t hardcoded_unmapped_kdata_size = 0;
     
    5150{
    5251        int i;
    53         pfn_t start, size,conf;
     52        pfn_t start, conf;
     53        size_t size;
    5454
    5555        for (i = 0; i < e820counter; i++) {
     
    5757                        start = ADDR2PFN(ALIGN_UP(e820table[i].base_address,
    5858                                                  FRAME_SIZE));
    59                         size = SIZE2PFN(ALIGN_DOWN(e820table[i].size,
     59                        size = SIZE2FRAMES(ALIGN_DOWN(e820table[i].size,
    6060                                                   FRAME_SIZE));
    6161                        if (minconf < start || minconf >= start+size)
     
    6363                        else
    6464                                conf = minconf;
    65                         zone_create(start,size, conf, 0);
     65                        zone_create(start, size, conf, 0);
    6666                        if (last_frame < ALIGN_UP(e820table[i].base_address + e820table[i].size, FRAME_SIZE))
    6767                                last_frame = ALIGN_UP(e820table[i].base_address + e820table[i].size, FRAME_SIZE);
  • arch/mips32/src/drivers/arc.c

    r89298e3 r42744880  
    306306                       
    307307                        zone_create(ADDR2PFN(base),
    308                                     SIZE2PFN(ALIGN_DOWN(basesize,FRAME_SIZE)),
     308                                    SIZE2FRAMES(ALIGN_DOWN(basesize,FRAME_SIZE)),
    309309                                    ADDR2PFN(base),0);
    310310                }
  • arch/sparc64/_link.ld.in

    r89298e3 r42744880  
    2727                *(.sbss);
    2828                hardcoded_ktext_size = .;
    29                 LONG(ktext_end - ktext_start); 
     29                QUAD(ktext_end - ktext_start); 
    3030                hardcoded_kdata_size = .;
    31                 LONG(kdata_end - kdata_start);
     31                QUAD(kdata_end - kdata_start);
    3232                hardcoded_load_address = .;
    3333                QUAD(0x4000);
  • arch/sparc64/src/mm/frame.c

    r89298e3 r42744880  
    3030#include <mm/frame.h>
    3131#include <config.h>
     32#include <align.h>
    3233
    3334void frame_arch_init(void)
    3435{
    35         zone_create(0, config.memory_size >> FRAME_WIDTH, 1, 0);
     36        zone_create(0, config.memory_size >> FRAME_WIDTH, ADDR2PFN(ALIGN_UP(config.base + config.kernel_size + CONFIG_STACK_SIZE, FRAME_SIZE)), 0);
    3637
    3738        /*
  • generic/include/config.h

    r89298e3 r42744880  
    3737
    3838#define CONFIG_MEMORY_SIZE      (8*1024*1024)
    39 #define CONFIG_HEAP_SIZE        (300*1024)
    4039#define CONFIG_STACK_SIZE       STACK_SIZE
    4140
     
    5049        size_t init_size;
    5150       
    52         __address heap_addr;
    53         size_t heap_size;
    54         size_t heap_delta;            /**< Extra space between heap and stack (enforced by alignment requirements) */
    55        
    56         size_t kernel_size;           /**< Size of memory in bytes taken by kernel, heap and stack */
     51        size_t kernel_size;           /**< Size of memory in bytes taken by kernel and stack */
    5752};
    5853
  • generic/include/mm/frame.h

    r89298e3 r42744880  
    7575}
    7676
    77 static inline pfn_t SIZE2PFN(__address size)
     77static inline count_t SIZE2FRAMES(size_t size)
    7878{
    7979        if (!size)
    8080                return 0;
    81         return (pfn_t)((size-1) >> FRAME_WIDTH)+1;
     81        return (count_t)((size-1) >> FRAME_WIDTH)+1;
    8282}
    8383
     
    9696extern void frame_free(__address addr);
    9797
    98 extern void zone_create(pfn_t start, pfn_t count, pfn_t confframe, int flags);
     98extern void zone_create(pfn_t start, count_t count, pfn_t confframe, int flags);
    9999
    100100void * frame_get_parent(pfn_t frame, int hint);
    101101void frame_set_parent(pfn_t frame, void *data, int hint);
    102 void frame_mark_unavailable(pfn_t start, pfn_t count);
    103 __address zone_conf_size(pfn_t start, pfn_t count);
     102void frame_mark_unavailable(pfn_t start, count_t count);
     103__address zone_conf_size(pfn_t start, count_t count);
    104104
    105105/*
  • generic/include/typedefs.h

    r89298e3 r42744880  
    3535typedef short bool;
    3636
    37 typedef unsigned int size_t;
    38 typedef unsigned int count_t;
    39 typedef unsigned int index_t;
     37typedef unsigned long size_t;
     38typedef unsigned long count_t;
     39typedef unsigned long index_t;
    4040
    4141typedef struct config config_t;
  • generic/src/main/kinit.c

    r89298e3 r42744880  
    7373        as_area_t *a;
    7474        __address frame;
    75         pfn_t frames;
     75        count_t frames;
    7676        int i;
    7777        task_t *u;
     
    166166                        frame = KA2PA(frame);
    167167
    168                 frames = SIZE2PFN(config.init_size);
     168                frames = SIZE2FRAMES(config.init_size);
    169169               
    170170                a = as_area_create(as, AS_AREA_TEXT, frames, UTEXT_ADDRESS);
  • generic/src/mm/frame.c

    r89298e3 r42744880  
    6262        SPINLOCK_DECLARE(lock); /**< this lock protects everything below */
    6363        pfn_t base;     /**< frame_no of the first frame in the frames array */
    64         pfn_t count;          /**< Size of zone */
     64        count_t count;          /**< Size of zone */
    6565
    6666        frame_t *frames;        /**< array of frame_t structures in this zone */
     
    100100
    101101/** Compute pfn_t from frame_t pointer & zone pointer */
    102 static pfn_t make_frame_index(zone_t *zone, frame_t *frame)
     102static index_t make_frame_index(zone_t *zone, frame_t *frame)
    103103{
    104104        return frame - zone->frames;
     
    424424 * Assume zone is locked
    425425 */
    426 static void zone_frame_free(zone_t *zone, pfn_t frame_idx)
     426static void zone_frame_free(zone_t *zone, index_t frame_idx)
    427427{
    428428        frame_t *frame;
     
    446446
    447447/** Return frame from zone */
    448 static frame_t * zone_get_frame(zone_t *zone, pfn_t frame_idx)
     448static frame_t * zone_get_frame(zone_t *zone, index_t frame_idx)
    449449{
    450450        ASSERT(frame_idx < zone->count);
     
    453453
    454454/** Mark frame in zone unavailable to allocation */
    455 static void zone_mark_unavailable(zone_t *zone, pfn_t frame_idx)
     455static void zone_mark_unavailable(zone_t *zone, index_t frame_idx)
    456456{
    457457        frame_t *frame;
     
    476476 * @return Initialized zone.
    477477 */
    478 static zone_t * zone_construct(pfn_t start, pfn_t count,
     478static zone_t * zone_construct(pfn_t start, count_t count,
    479479                               zone_t *z, int flags)
    480480{
     
    517517
    518518/** Compute configuration data size for zone */
    519 __address zone_conf_size(pfn_t start, pfn_t count)
     519__address zone_conf_size(pfn_t start, count_t count)
    520520{
    521521        int size = sizeof(zone_t) + count*sizeof(frame_t);
     
    531531 *
    532532 * @param confframe Where configuration frame is supposed to be.
    533  *                  Always check, that we will not disturb kernel pages
    534  *                  the kernel and possibly init.
     533 *                  Always check, that we will not disturb the kernel and possibly init.
    535534 *                  If confframe is given _outside_ this zone, it is expected,
    536535 *                  that the area is already marked BUSY and big enough
    537536 *                  to contain zone_conf_size() amount of data
    538537 */
    539 void zone_create(pfn_t start, pfn_t count, pfn_t confframe, int flags)
     538void zone_create(pfn_t start, count_t count, pfn_t confframe, int flags)
    540539{
    541540        zone_t *z;
    542541        __address addr,endaddr;
    543         pfn_t confcount;
     542        count_t confcount;
    544543        int i;
    545544
     
    552551         * it does not span kernel & init
    553552         */
    554         confcount = SIZE2PFN(zone_conf_size(start,count));
     553        confcount = SIZE2FRAMES(zone_conf_size(start,count));
    555554        if (confframe >= start && confframe < start+count) {
    556555                for (;confframe < start+count;confframe++) {
     
    700699
    701700/** Mark given range unavailable in frame zones */
    702 void frame_mark_unavailable(pfn_t start, pfn_t count)
     701void frame_mark_unavailable(pfn_t start, count_t count)
    703702{
    704703        int i;
     
    730729        if (config.cpu_active == 1) {
    731730                frame_mark_unavailable(ADDR2PFN(KA2PA(config.base)),
    732                                        SIZE2PFN(config.kernel_size));
     731                                       SIZE2FRAMES(config.kernel_size));
    733732                if (config.init_size > 0)
    734733                        frame_mark_unavailable(ADDR2PFN(KA2PA(config.init_addr)),
    735                                                SIZE2PFN(config.init_size));
     734                                               SIZE2FRAMES(config.init_size));
    736735        }
    737736}
Note: See TracChangeset for help on using the changeset viewer.