Ignore:
Timestamp:
2006-08-30T11:31:25Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ee454eb
Parents:
0fa6044
Message:

sparc64 work.

  • Modify before_thread_runs_arch() to store addresses of the kernel stack and

userspace window buffer, resp., to registers %g6 and %g7, resp, in the
alternate and interrupt global sets.

  • Modify after_thread_ran_arch() to sample %g7 from the alternate globals.
  • Implement trap handler for spilling register windows into userspace window buffer.
  • Implement assembly language functions to access %g6 and %g7 registers in the alternate sets.
  • Initialize the trap table so that there are now also spill_1_normal, spill_2_normal,

spill_0_other and fill_1_normal handlers. These handlers are used in different situations
and for different purposes.

File:
1 edited

Legend:

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

    r0fa6044 re11ae91  
    3737#include <arch.h>
    3838#include <arch/asm.h>
     39#include <arch/regdef.h>
     40#include <arch/stack.h>
    3941#include <arch/mm/tlb.h>
    4042#include <arch/mm/page.h>
     
    5254 * Ensure that thread's kernel stack, as well as userspace window
    5355 * buffer for userspace threads, are locked in DTLB.
     56 * For userspace threads, initialize reserved global registers
     57 * in the alternate and interrupt sets.
    5458 */
    5559void before_thread_runs_arch(void)
     
    8387                        dtlb_insert_mapping(uw_buf, KA2PA(uw_buf), PAGESIZE_8K, true, true);
    8488                }
     89               
     90                /*
     91                 * Write kernel stack address to %g6 and a pointer to the last item
     92                 * in the userspace window buffer to %g7 in the alternate and interrupt sets.
     93                 */
     94                write_to_ig_g6((uintptr_t) THREAD->kstack + STACK_SIZE - STACK_BIAS);
     95                write_to_ag_g6((uintptr_t) THREAD->kstack + STACK_SIZE - STACK_BIAS);
     96                write_to_ag_g7((uintptr_t) THREAD->arch.uspace_window_buffer);
    8597        }
    8698}
     
    124136                        dtlb_demap(TLB_DEMAP_PAGE, TLB_DEMAP_NUCLEUS, (uintptr_t) uw_buf);
    125137                }
     138       
     139                /* sample the state of the userspace window buffer */   
     140                THREAD->arch.uspace_window_buffer = (uint8_t *) read_from_ag_g7();
    126141        }
    127142}
Note: See TracChangeset for help on using the changeset viewer.