Changeset 396


Ignore:
Timestamp:
Aug 12, 2014, 10:43:18 AM (10 years ago)
Author:
alain
Message:

Housekeeping

Location:
soft/giet_vm/giet_kernel
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_kernel/ctx_handler.h

    r391 r396  
    7979
    8080#define IDLE_TASK_INDEX        13
    81 #define IDLE_TASK_STACK        0x1000
    8281
    8382/////////////////////////////////////////////////////////////////////////////////
  • soft/giet_vm/giet_kernel/kernel_init.c

    r391 r396  
    103103#endif
    104104
    105 #if !defined(IDLE_TASK_STACK)
    106 # error: You must define IDLE_TASK_STACK in the ctx_handler.h file
    107 #endif
    108 
    109105#if !defined(GIET_TICK_VALUE)
    110106# error: You must define GIET_TICK_VALUE in the giet_config.h file
  • soft/giet_vm/giet_kernel/sys_handler.c

    r322 r396  
    2020#include <fat32.h>
    2121#include <utils.h>
     22#include <vmem.h>
    2223#include <hard_config.h>
    2324#include <giet_config.h>
     
    6263    &_context_switch,      /* 0x19 */
    6364    &_vobj_get_vbase,      /* 0x1A */
    64     &_sys_ukn,             /* 0x1B */
     65    &_get_xy_from_ptr,     /* 0x1B */
    6566    &_nic_cma_start,       /* 0x1C */
    6667    &_nic_cma_stop,        /* 0x1D */
     
    257258}
    258259
     260/////////////////////////////////////////////////////////////////////////////
     261// This function returns in the (x,y) arguments the coordinates of the
     262// where is mapped the ptr virtual address. It use the _get_context_slot()
     263// function to get the calling task page table, and uses the _v2p_translate()
     264// function to obtain the physical address.
     265// returns 0 if success, > 0 if ptr not mapped in the calling task vspace.
     266/////////////////////////////////////////////////////////////////////////////
     267
     268unsigned int _get_xy_from_ptr( void*         ptr,
     269                               unsigned int* px,
     270                               unsigned int* py )
     271{
     272    unsigned int ret;
     273    unsigned int ppn;
     274    unsigned int flags;
     275    unsigned int vpn  = (((unsigned int)ptr)>>12);
     276   
     277    // get the page table pointer
     278    page_table_t* pt = (page_table_t*)_get_context_slot( CTX_PTAB_ID );
     279
     280    // compute the physical address
     281    if ( (ret = _v2p_translate( pt, vpn, &ppn, &flags )) )
     282    {
     283        return ret;
     284    }
     285
     286    *px = (ppn>>24) & 0xF;
     287    *py = (ppn>>20) & 0xF;
     288    return 0;
     289}
     290
    259291////////////////////////////////////////////////////////////////////////////
    260292// This sysrem function deschedule the requestint task.
  • soft/giet_vm/giet_kernel/sys_handler.h

    r294 r396  
    4242                               unsigned int* vobj_length );
    4343
     44unsigned int _get_xy_from_ptr( void*          ptr,
     45                               unsigned int*  x,
     46                               unsigned int*  y );
     47
     48
    4449#endif
    4550
Note: See TracChangeset for help on using the changeset viewer.