Rev 1822 | Rev 2071 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1822 | Rev 1888 | ||
---|---|---|---|
Line 103... | Line 103... | ||
103 | { |
103 | { |
104 | ipl_t ipl; |
104 | ipl_t ipl; |
105 | int rc; |
105 | int rc; |
106 | 106 | ||
107 | ASSERT(THREAD); |
107 | ASSERT(THREAD); |
108 | ASSERT(!THREAD->in_copy_from_uspace); |
108 | ASSERT(!THREAD->in_copy_to_uspace); |
109 | 109 | ||
110 | if (!KERNEL_ADDRESS_SPACE_SHADOWED) { |
110 | if (!KERNEL_ADDRESS_SPACE_SHADOWED) { |
111 | if (overlaps((uintptr_t) uspace_dst, size, |
111 | if (overlaps((uintptr_t) uspace_dst, size, |
112 | KERNEL_ADDRESS_SPACE_START, KERNEL_ADDRESS_SPACE_END-KERNEL_ADDRESS_SPACE_START)) { |
112 | KERNEL_ADDRESS_SPACE_START, KERNEL_ADDRESS_SPACE_END-KERNEL_ADDRESS_SPACE_START)) { |
113 | /* |
113 | /* |
Line 116... | Line 116... | ||
116 | return EPERM; |
116 | return EPERM; |
117 | } |
117 | } |
118 | } |
118 | } |
119 | 119 | ||
120 | ipl = interrupts_disable(); |
120 | ipl = interrupts_disable(); |
121 | THREAD->in_copy_from_uspace = true; |
121 | THREAD->in_copy_to_uspace = true; |
122 | 122 | ||
123 | rc = memcpy_to_uspace(uspace_dst, src, size); |
123 | rc = memcpy_to_uspace(uspace_dst, src, size); |
124 | 124 | ||
125 | THREAD->in_copy_from_uspace = false; |
125 | THREAD->in_copy_to_uspace = false; |
126 | 126 | ||
127 | interrupts_restore(ipl); |
127 | interrupts_restore(ipl); |
128 | return !rc ? EPERM : 0; |
128 | return !rc ? EPERM : 0; |
129 | } |
129 | } |
130 | 130 |