Rev 1857 | Rev 2049 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1857 | Rev 1987 | ||
|---|---|---|---|
| Line 52... | Line 52... | ||
| 52 | if (t->arch.uspace_window_buffer) { |
52 | if (t->arch.uspace_window_buffer) { |
| 53 | /* |
53 | /* |
| 54 | * Mind the possible alignment of the userspace window buffer |
54 | * Mind the possible alignment of the userspace window buffer |
| 55 | * belonging to a killed thread. |
55 | * belonging to a killed thread. |
| 56 | */ |
56 | */ |
| 57 | frame_free(ALIGN_DOWN((uintptr_t) t->arch.uspace_window_buffer, PAGE_SIZE)); |
57 | frame_free(KA2PA(ALIGN_DOWN((uintptr_t) t->arch.uspace_window_buffer, PAGE_SIZE))); |
| 58 | } |
58 | } |
| 59 | } |
59 | } |
| 60 | 60 | ||
| 61 | void thread_create_arch(thread_t *t) |
61 | void thread_create_arch(thread_t *t) |
| 62 | { |
62 | { |
| 63 | if ((t->flags & THREAD_FLAG_USPACE) && (!t->arch.uspace_window_buffer)) { |
63 | if ((t->flags & THREAD_FLAG_USPACE) && (!t->arch.uspace_window_buffer)) { |
| 64 | /* |
64 | /* |
| 65 | * The thread needs userspace window buffer and the object |
65 | * The thread needs userspace window buffer and the object |
| 66 | * returned from the slab allocator doesn't have any. |
66 | * returned from the slab allocator doesn't have any. |
| 67 | */ |
67 | */ |
| 68 | t->arch.uspace_window_buffer = frame_alloc(ONE_FRAME, 0); |
68 | t->arch.uspace_window_buffer = frame_alloc(ONE_FRAME, FRAME_KA); |
| 69 | } else { |
69 | } else { |
| 70 | uintptr_t uw_buf = (uintptr_t) t->arch.uspace_window_buffer; |
70 | uintptr_t uw_buf = (uintptr_t) t->arch.uspace_window_buffer; |
| 71 | 71 | ||
| 72 | /* |
72 | /* |
| 73 | * Mind the possible alignment of the userspace window buffer |
73 | * Mind the possible alignment of the userspace window buffer |