Changeset 127c957b in mainline


Ignore:
Timestamp:
2006-05-27T20:02:27Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
00b595b
Parents:
0ee077ee
Message:

Make address space backend data a union.

Location:
generic
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • generic/include/elf.h

    r0ee077ee r127c957b  
    3232#include <arch/elf.h>
    3333#include <arch/types.h>
    34 #include <mm/as.h>
     34#include <typedefs.h>
    3535
    3636/**
  • generic/include/mm/as.h

    r0ee077ee r127c957b  
    4747#include <adt/list.h>
    4848#include <adt/btree.h>
     49#include <elf.h>
    4950
    5051/** Defined to be true if user address space and kernel address space shadow each other. */
     
    119120
    120121/** Backend data stored in address space area. */
    121 typedef struct backend_data {
    122         __native d1;
    123         __native d2;
     122typedef union {
     123        struct {        /**< elf_backend members */
     124                elf_header_t *elf;
     125                elf_segment_header_t *segment;
     126        };
     127        struct {        /**< phys_backend members */
     128                __address base;
     129                count_t frames;
     130        };
    124131} mem_backend_data_t;
    125132
  • generic/src/ddi/ddi.c

    r0ee077ee r127c957b  
    6666        task_t *t;
    6767        int flags;
    68         mem_backend_data_t backend_data = { .d1 = (__native) pf, .d2 = (__native) pages };
     68        mem_backend_data_t backend_data;
     69
     70        backend_data.base = pf;
     71        backend_data.frames = pages;
    6972       
    7073        /*
  • generic/src/lib/elf.c

    r0ee077ee r127c957b  
    163163        as_area_t *a;
    164164        int flags = 0;
    165         mem_backend_data_t backend_data = { .d1 = (__native) elf, .d2 = (__native) entry };
     165        mem_backend_data_t backend_data;
     166       
     167        backend_data.elf = elf;
     168        backend_data.segment = entry;
    166169
    167170        if (entry->p_align > 1) {
  • generic/src/mm/backend_anon.c

    r0ee077ee r127c957b  
    5252static void anon_share(as_area_t *area);
    5353
    54 /*
    55  * Anonymous memory backend.
    56  */
    5754mem_backend_t anon_backend = {
    5855        .page_fault = anon_page_fault,
  • generic/src/mm/backend_elf.c

    r0ee077ee r127c957b  
    6565int elf_page_fault(as_area_t *area, __address addr, pf_access_t access)
    6666{
    67         elf_header_t *elf = (elf_header_t *) area->backend_data.d1;
    68         elf_segment_header_t *entry = (elf_segment_header_t *) area->backend_data.d2;
     67        elf_header_t *elf = area->backend_data.elf;
     68        elf_segment_header_t *entry = area->backend_data.segment;
    6969        __address base, frame;
    7070        index_t i;
     
    133133void elf_frame_free(as_area_t *area, __address page, __address frame)
    134134{
    135         elf_header_t *elf = (elf_header_t *) area->backend_data.d1;
    136         elf_segment_header_t *entry = (elf_segment_header_t *) area->backend_data.d2;
     135        elf_header_t *elf = area->backend_data.elf;
     136        elf_segment_header_t *entry = area->backend_data.segment;
    137137        __address base;
    138138        index_t i;
  • generic/src/mm/backend_phys.c

    r0ee077ee r127c957b  
    6464int phys_page_fault(as_area_t *area, __address addr, pf_access_t access)
    6565{
    66         __address base = (__address) area->backend_data.d1;
    67         count_t frames = (count_t) area->backend_data.d2;
     66        __address base = area->backend_data.base;
     67        count_t frames = area->backend_data.frames;
    6868
    6969        if (!as_area_check_access(area, access))
Note: See TracChangeset for help on using the changeset viewer.