Changeset d43d2f7 in mainline


Ignore:
Timestamp:
2005-12-06T19:42:04Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
090e7ea1
Parents:
795ff98
Message:

Cleanup and fixes.

Files:
11 edited

Legend:

Unmodified
Added
Removed
  • arch/amd64/src/mm/page.c

    r795ff98 rd43d2f7  
    4444
    4545        if (config.cpu_active == 1) {
    46                 dba = frame_alloc(FRAME_KA | FRAME_PANIC, 0);
     46                dba = frame_alloc(FRAME_KA | FRAME_PANIC, ONE_FRAME);
    4747                memsetb(dba, PAGE_SIZE, 0);
    4848
     
    6767                 */
    6868
    69                 dba = frame_alloc(FRAME_KA | FRAME_PANIC, 0);
     69                dba = frame_alloc(FRAME_KA | FRAME_PANIC, ONE_FRAME);
    7070                memcpy((void *)dba, (void *)bootstrap_dba , PAGE_SIZE);
    7171                write_cr3(KA2PA(dba));
  • arch/ia32/src/mm/page.c

    r795ff98 rd43d2f7  
    4949
    5050        if (config.cpu_active == 1) {
    51                 dba = frame_alloc(FRAME_KA | FRAME_PANIC, 0);
     51                dba = frame_alloc(FRAME_KA | FRAME_PANIC, ONE_FRAME);
    5252                memsetb(dba, PAGE_SIZE, 0);
    5353
     
    7171                 */
    7272
    73                 dba = frame_alloc(FRAME_KA | FRAME_PANIC, 0);
     73                dba = frame_alloc(FRAME_KA | FRAME_PANIC, ONE_FRAME);
    7474                memcpy((void *)dba, (void *)bootstrap_dba , PAGE_SIZE);
    7575                write_cr3(KA2PA(dba));
  • arch/mips32/src/mm/page.c

    r795ff98 rd43d2f7  
    4040        __address ptl0;
    4141       
    42         ptl0 = frame_alloc(FRAME_KA | FRAME_PANIC, 0);
     42        ptl0 = frame_alloc(FRAME_KA | FRAME_PANIC, ONE_FRAME);
    4343        memsetb(ptl0, FRAME_SIZE, 0);
    4444       
  • generic/include/mm/frame.h

    r795ff98 rd43d2f7  
    3636#include <synch/spinlock.h>
    3737#include <mm/buddy.h>
     38
     39#define ONE_FRAME       0
    3840
    3941#define FRAME_KA        1       /* skip frames conflicting with user address space */
  • generic/src/console/kconsole.c

    r795ff98 rd43d2f7  
    426426}
    427427
     428/** Print detailed description of 'describe' command. */
     429void desc_help(void)
     430{
     431        printf("Syntax: describe command_name\n");
     432}
     433
    428434/** Halt the kernel.
    429435 *
    430  * @param argv Argument vector.
    431  *
    432  * @return 0 on failure, 1 on success.
     436 * @param argv Argument vector (ignored).
     437 *
     438 * @return 0 on failure, 1 on success (never returns).
    433439 */
    434440int cmd_halt(cmd_arg_t *argv)
     
    437443        return 1;
    438444}
    439 
    440 /** Print detailed description of 'describe' command. */
    441 void desc_help(void)
    442 {
    443         printf("Syntax: describe command_name\n");
    444 }
  • generic/src/cpu/cpu.c

    r795ff98 rd43d2f7  
    6161
    6262                for (i=0; i < config.cpu_count; i++) {
    63                         cpus[i].stack = (__u8 *) frame_alloc(FRAME_KA | FRAME_PANIC,0);
     63                        cpus[i].stack = (__u8 *) frame_alloc(FRAME_KA | FRAME_PANIC, ONE_FRAME);
    6464                        if (!cpus[i].stack)
    6565                                panic("malloc/cpus[%d].stack\n", i);
  • generic/src/mm/page.c

    r795ff98 rd43d2f7  
    8080
    8181        if (GET_PTL1_FLAGS(ptl0, PTL0_INDEX(page)) & PAGE_NOT_PRESENT) {
    82                 newpt = frame_alloc(FRAME_KA, 0);
     82                newpt = frame_alloc(FRAME_KA, ONE_FRAME);
    8383                memsetb(newpt, PAGE_SIZE, 0);
    8484                SET_PTL1_ADDRESS(ptl0, PTL0_INDEX(page), KA2PA(newpt));
    85                 SET_PTL1_FLAGS(ptl0, PTL0_INDEX(page), PAGE_PRESENT | PAGE_USER | PAGE_EXEC);
     85                SET_PTL1_FLAGS(ptl0, PTL0_INDEX(page), PAGE_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE);
    8686        }
    8787
     
    8989
    9090        if (GET_PTL2_FLAGS(ptl1, PTL1_INDEX(page)) & PAGE_NOT_PRESENT) {
    91                 newpt = frame_alloc(FRAME_KA, 0);
     91                newpt = frame_alloc(FRAME_KA, ONE_FRAME);
    9292                memsetb(newpt, PAGE_SIZE, 0);
    9393                SET_PTL2_ADDRESS(ptl1, PTL1_INDEX(page), KA2PA(newpt));
    94                 SET_PTL2_FLAGS(ptl1, PTL1_INDEX(page), PAGE_PRESENT | PAGE_USER | PAGE_EXEC);
     94                SET_PTL2_FLAGS(ptl1, PTL1_INDEX(page), PAGE_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE);
    9595        }
    9696
     
    9898
    9999        if (GET_PTL3_FLAGS(ptl2, PTL2_INDEX(page)) & PAGE_NOT_PRESENT) {
    100                 newpt = frame_alloc(FRAME_KA, 0);
     100                newpt = frame_alloc(FRAME_KA, ONE_FRAME);
    101101                memsetb(newpt, PAGE_SIZE, 0);
    102102                SET_PTL3_ADDRESS(ptl2, PTL2_INDEX(page), KA2PA(newpt));
    103                 SET_PTL3_FLAGS(ptl2, PTL2_INDEX(page), PAGE_PRESENT | PAGE_USER | PAGE_EXEC);
     103                SET_PTL3_FLAGS(ptl2, PTL2_INDEX(page), PAGE_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE);
    104104        }
    105105
  • generic/src/mm/vm.c

    r795ff98 rd43d2f7  
    7070               
    7171                        src_ptl0 = (pte_t *) PA2KA((__address) GET_PTL0_ADDRESS());
    72                         dst_ptl0 = (pte_t *) frame_alloc(FRAME_KA | FRAME_PANIC, 0);
     72                        dst_ptl0 = (pte_t *) frame_alloc(FRAME_KA | FRAME_PANIC, ONE_FRAME);
    7373
    7474//                      memsetb((__address) dst_ptl0, PAGE_SIZE, 0);
     
    116116               
    117117                for (i=0; i<size; i++)
    118                         a->mapping[i] = frame_alloc(0,0);
     118                        a->mapping[i] = frame_alloc(0, ONE_FRAME);
    119119               
    120120                spinlock_initialize(&a->lock);
  • generic/src/proc/thread.c

    r795ff98 rd43d2f7  
    176176                spinlock_initialize(&t->lock);
    177177       
    178                 frame_ks = frame_alloc(FRAME_KA,0);
     178                frame_ks = frame_alloc(FRAME_KA, ONE_FRAME);
    179179                if (THREAD_USER_STACK & flags) {
    180                         frame_us = frame_alloc(FRAME_KA,0);
     180                        frame_us = frame_alloc(FRAME_KA, ONE_FRAME);
    181181                }
    182182
  • kernel.config

    r795ff98 rd43d2f7  
    3737@ "print/print1" Printf test 1
    3838@ "thread/trhead1" Thread test 1
    39 @ "mm/mapping" Mapping test 1
     39@ "mm/mapping1" Mapping test 1
    4040! CONFIG_TEST (choice)
  • test/mm/mapping1/test.c

    r795ff98 rd43d2f7  
    4747        printf("Memory management test mapping #1\n");
    4848
    49         frame0 = frame_alloc(FRAME_KA);
    50         frame1 = frame_alloc(FRAME_KA);
     49        frame0 = frame_alloc(FRAME_KA, ONE_FRAME);
     50        frame1 = frame_alloc(FRAME_KA, ONE_FRAME);     
    5151
    5252        printf("Writing %L to physical address %P.\n", VALUE0, KA2PA(frame0));
Note: See TracChangeset for help on using the changeset viewer.