Subversion Repositories HelenOS

Rev

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

Rev 2116 Rev 2141
Line 97... Line 97...
97
 * @param flags Address space area flags for the mapping.
97
 * @param flags Address space area flags for the mapping.
98
 *
98
 *
99
 * @return 0 on success, EPERM if the caller lacks capabilities to use this
99
 * @return 0 on success, EPERM if the caller lacks capabilities to use this
100
 *  syscall, ENOENT if there is no task matching the specified ID or the
100
 *  syscall, ENOENT if there is no task matching the specified ID or the
101
 *  physical address space is not enabled for mapping and ENOMEM if there
101
 *  physical address space is not enabled for mapping and ENOMEM if there
102
 *  was a problem in creating address space area. ENOTSUP is returned when
102
 *  was a problem in creating address space area.
103
 *  an attempt to create an illegal address alias is detected.
-
 
104
 */
103
 */
105
static int ddi_physmem_map(uintptr_t pf, uintptr_t vp, count_t pages, int flags)
104
static int ddi_physmem_map(uintptr_t pf, uintptr_t vp, count_t pages, int flags)
106
{
105
{
107
    ipl_t ipl;
106
    ipl_t ipl;
108
    cap_t caps;
107
    cap_t caps;
Line 137... Line 136...
137
         */
136
         */
138
        spinlock_unlock(&parea_lock);
137
        spinlock_unlock(&parea_lock);
139
        interrupts_restore(ipl);
138
        interrupts_restore(ipl);
140
        return ENOENT;
139
        return ENOENT;
141
    }
140
    }
142
 
-
 
143
#ifdef CONFIG_VIRT_IDX_DCACHE
-
 
144
    if (PAGE_COLOR(parea->vbase) != PAGE_COLOR(vp)) {
-
 
145
        /*
-
 
146
         * Refuse to create an illegal address alias.
-
 
147
         */
-
 
148
        spinlock_unlock(&parea_lock);
-
 
149
        interrupts_restore(ipl);
-
 
150
        return ENOTSUP;
-
 
151
    }
-
 
152
#endif /* CONFIG_VIRT_IDX_DCACHE */
-
 
153
 
-
 
154
    spinlock_unlock(&parea_lock);
141
    spinlock_unlock(&parea_lock);
155
 
142
 
156
    spinlock_lock(&TASK->lock);
143
    spinlock_lock(&TASK->lock);
157
   
144
   
158
    if (!as_area_create(TASK->as, flags, pages * PAGE_SIZE, vp, AS_AREA_ATTR_NONE,
145
    if (!as_area_create(TASK->as, flags, pages * PAGE_SIZE, vp, AS_AREA_ATTR_NONE,