Ignore:
Timestamp:
2006-08-30T15:50:29Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
beb3926a
Parents:
e11ae91
Message:

sparc64 work.
More bits needed to reach the userspace milestone were added.
The preemptible_handler(), still a prototype, now contains all functionality it needs.
Some sanitation was added to functions expecting page-aligned pointers to
userspace window buffer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/src/proc/thread.c

    re11ae91 ree454eb  
    3636#include <arch/proc/thread.h>
    3737#include <mm/frame.h>
     38#include <mm/page.h>
     39#include <arch/mm/page.h>
     40#include <align.h>
    3841
    3942void thr_constructor_arch(thread_t *t)
     
    4750void thr_destructor_arch(thread_t *t)
    4851{
    49         if (t->arch.uspace_window_buffer)
    50                 frame_free((uintptr_t) t->arch.uspace_window_buffer);
     52        if (t->arch.uspace_window_buffer) {
     53                /*
     54                 * Mind the possible alignment of the userspace window buffer
     55                 * belonging to a killed thread.
     56                 */
     57                frame_free(ALIGN_DOWN((uintptr_t) t->arch.uspace_window_buffer, PAGE_SIZE));
     58        }
    5159}
    5260
     
    5967                 */
    6068                t->arch.uspace_window_buffer = frame_alloc(ONE_FRAME, 0);
     69        } else {
     70                uintptr_t uw_buf = (uintptr_t) t->arch.uspace_window_buffer;
     71
     72                /*
     73                 * Mind the possible alignment of the userspace window buffer
     74                 * belonging to a killed thread.
     75                 */
     76                 t->arch.uspace_window_buffer = (uint8_t *) ALIGN_DOWN(uw_buf, PAGE_SIZE);
    6177        }
    6278}
Note: See TracChangeset for help on using the changeset viewer.