Subversion Repositories HelenOS-historic

Rev

Rev 689 | Rev 756 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 689 Rev 755
Line 27... Line 27...
27
 */
27
 */
28
#include <print.h>
28
#include <print.h>
29
#include <test.h>
29
#include <test.h>
30
#include <mm/page.h>
30
#include <mm/page.h>
31
#include <mm/frame.h>
31
#include <mm/frame.h>
32
#include <mm/asid.h>
32
#include <mm/as.h>
33
#include <arch/mm/page.h>
33
#include <arch/mm/page.h>
34
#include <arch/types.h>
34
#include <arch/types.h>
35
#include <debug.h>
35
#include <debug.h>
36
 
36
 
37
#define PAGE0   0x10000000
37
#define PAGE0   0x10000000
Line 54... Line 54...
54
    *((__u32 *) frame0) = VALUE0;
54
    *((__u32 *) frame0) = VALUE0;
55
    printf("Writing %L to physical address %P.\n", VALUE1, KA2PA(frame1));
55
    printf("Writing %L to physical address %P.\n", VALUE1, KA2PA(frame1));
56
    *((__u32 *) frame1) = VALUE1;
56
    *((__u32 *) frame1) = VALUE1;
57
   
57
   
58
    printf("Mapping virtual address %P to physical address %P.\n", PAGE0, KA2PA(frame0));
58
    printf("Mapping virtual address %P to physical address %P.\n", PAGE0, KA2PA(frame0));
59
    page_mapping_insert(PAGE0, ASID_KERNEL, KA2PA(frame0), PAGE_PRESENT | PAGE_WRITE, 0);
59
    page_mapping_insert(AS_KERNEL, PAGE0, KA2PA(frame0), PAGE_PRESENT | PAGE_WRITE, 0);
60
    printf("Mapping virtual address %P to physical address %P.\n", PAGE1, KA2PA(frame1));  
60
    printf("Mapping virtual address %P to physical address %P.\n", PAGE1, KA2PA(frame1));  
61
    page_mapping_insert(PAGE1, ASID_KERNEL, KA2PA(frame1), PAGE_PRESENT | PAGE_WRITE, 0);
61
    page_mapping_insert(AS_KERNEL, PAGE1, KA2PA(frame1), PAGE_PRESENT | PAGE_WRITE, 0);
62
   
62
   
63
    printf("Value at virtual address %P is %L.\n", PAGE0, v0 = *((__u32 *) PAGE0));
63
    printf("Value at virtual address %P is %L.\n", PAGE0, v0 = *((__u32 *) PAGE0));
64
    printf("Value at virtual address %P is %L.\n", PAGE1, v1 = *((__u32 *) PAGE1));
64
    printf("Value at virtual address %P is %L.\n", PAGE1, v1 = *((__u32 *) PAGE1));
65
   
65
   
66
    ASSERT(v0 == VALUE0);
66
    ASSERT(v0 == VALUE0);