Ignore:
Timestamp:
2008-10-02T20:24:01Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1d132ae
Parents:
c2ad500
Message:

Do not allocate full page for the uspace window buffer.
Instead, allocate only the bare minimum to fit NWINDOWS - 1
uspace windows and to satisfy alignment requirements.

File:
1 edited

Legend:

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

    rc2ad500 rd364e94  
    3535#include <proc/thread.h>
    3636#include <arch/proc/thread.h>
    37 #include <mm/frame.h>
    38 #include <mm/page.h>
    39 #include <arch/mm/page.h>
     37#include <mm/slab.h>
     38#include <arch/trap/regwin.h>
    4039#include <align.h>
    4140
     
    5150{
    5251        if (t->arch.uspace_window_buffer) {
     52                uintptr_t uw_buf = (uintptr_t) t->arch.uspace_window_buffer;
    5353                /*
    5454                 * Mind the possible alignment of the userspace window buffer
    5555                 * belonging to a killed thread.
    5656                 */
    57                 frame_free(KA2PA(ALIGN_DOWN((uintptr_t)
    58                     t->arch.uspace_window_buffer, PAGE_SIZE)));
     57                free((uint8_t *) ALIGN_DOWN(uw_buf, UWB_ALIGNMENT));
    5958        }
    6059}
     
    6867                 * returned from the slab allocator doesn't have any.
    6968                 */
    70                 t->arch.uspace_window_buffer = frame_alloc(ONE_FRAME, FRAME_KA);
     69                t->arch.uspace_window_buffer = malloc(UWB_ASIZE, 0);
    7170        } else {
    7271                uintptr_t uw_buf = (uintptr_t) t->arch.uspace_window_buffer;
     
    7776                 */
    7877                t->arch.uspace_window_buffer = (uint8_t *) ALIGN_DOWN(uw_buf,
    79                     PAGE_SIZE);
     78                    UWB_ASIZE);
    8079        }
    8180}
Note: See TracChangeset for help on using the changeset viewer.