Changeset 6212095 in mainline


Ignore:
Timestamp:
2006-05-28T10:01:08Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c93e805
Parents:
46fc2f9
Message:

Make ddi_physmem_map() accept address space area flags instead of writable switch.
Thus even these types of address space areas can turn caching on, if it is desired.

Location:
generic
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • generic/include/ddi/ddi_arg.h

    r46fc2f9 r6212095  
    3636        void *virt_base;                /** Virtual address of starting page. */
    3737        unsigned long pages;            /** Number of pages to map. */
    38         int writable;                   /** True if the mapping should be writable. */
     38        int flags;                      /** Address space area flags for the mapping. */
    3939} ddi_memarg_t;
    4040
  • generic/src/ddi/ddi.c

    r46fc2f9 r6212095  
    5454 * @param vp Virtual page address of the starting page.
    5555 * @param pages Number of pages to map.
    56  * @param writable If true, the mapping will be created writable.
     56 * @param flags Address space area flags for the mapping.
    5757 *
    5858 * @return 0 on success, EPERM if the caller lacks capabilities to use this syscall,
     
    6060 *         there was a problem in creating address space area.
    6161 */
    62 static int ddi_physmem_map(task_id_t id, __address pf, __address vp, count_t pages, bool writable)
     62static int ddi_physmem_map(task_id_t id, __address pf, __address vp, count_t pages, int flags)
    6363{
    6464        ipl_t ipl;
    6565        cap_t caps;
    6666        task_t *t;
    67         int flags;
    6867        mem_backend_data_t backend_data;
    6968
     
    102101        spinlock_unlock(&tasks_lock);
    103102       
    104         flags = AS_AREA_READ;
    105         if (writable)
    106                 flags |= AS_AREA_WRITE;
    107103        if (!as_area_create(t->as, flags, pages * PAGE_SIZE, vp, AS_AREA_ATTR_NONE,
    108104                &phys_backend, &backend_data)) {
     
    196192        return (__native) ddi_physmem_map((task_id_t) arg.task_id, ALIGN_DOWN((__address) arg.phys_base, FRAME_SIZE),
    197193                                          ALIGN_DOWN((__address) arg.virt_base, PAGE_SIZE), (count_t) arg.pages,
    198                                           (bool) arg.writable);
     194                                          (int) arg.flags);
    199195}
    200196
Note: See TracChangeset for help on using the changeset viewer.