Пример #1
0
/*-------------------------------------------------------------------------
 * xmmap - xmmap
 *-------------------------------------------------------------------------
 */
SYSCALL xmmap(int virtpage, bsd_t source, int npages)
{
  /* sanity check ! */
  STATWORD        ps;
  if ((virtpage < 4096) || ( source < 0 ) || ( source > TOTAL_BS) ||(npages < 1) || ( npages > 128) || bsm_tab[source].is_private == YES)
  {
	kprintf("xmmap call error: parameter error! \n");
	return SYSERR;
  }

  disable(ps);
  return bsm_map(currpid, virtpage, source, npages);
  restore(ps);
}
Пример #2
0
/*-------------------------------------------------------------------------
 * xmmap - xmmap
 *-------------------------------------------------------------------------
 */
SYSCALL xmmap(int virtpage, bsd_t source, int npages)
{
  /* sanity check ! */
  STATWORD ps;
  if ( (virtpage < 4096) || INVALID_BSID(source) ||(npages < 1) || ( npages > 128)){
    kprintf("xmmap call error: parameter error! \n");
    return SYSERR;
  }
  if(bsm_tab[source].bs_status == BSM_MAPPED_PR){
    kprintf("Error: Trying to map private heap\n");
    return SYSERR;
  }
  disable(ps);
  ERROR_CHECK2( bsm_map(currpid, virtpage, source, npages), ps );
  
  restore(ps);
  return OK;
}
Пример #3
0
/*-------------------------------------------------------------------------
 * xmmap - xmmap
 *-------------------------------------------------------------------------
 */
SYSCALL xmmap(int virtpage, bsd_t source, int npages)
{
	STATWORD ps;
	bs_map_t* main_bs;
	int   getReturnValue;

  /* sanity check ! */


  if ( (virtpage < 4096) || ( source < 0 ) || ( source > MAX_ID) ||(npages < 1) || ( npages >128)){
	//kprintf("xmmap call error: parameter error! \n");
	return SYSERR;
  }


	disable(ps);
	//kprintf("\nInside xmap()..bsd req :%d and npages %d", source, npages);
  //kprintf("xmmap - to be implemented!\n");
  
  main_bs = &bsm_tab[source];
  
    
  getReturnValue = check_bs_used_xmmap(source);
  if( getReturnValue == SYSERR )
  {
  		//kprintf("\nInside xmap()..error in bs");	
  		restore(ps);
  		return(SYSERR);
  }
  
  
  getReturnValue = bsm_map(currpid, virtpage, source, npages);
  
  if( getReturnValue == SYSERR )
  {	
  		//kprintf("\nInside xmap()..error in mapping");	
  		restore(ps);
  		return(SYSERR);
  }
  
  restore(ps);
  return(OK);
  
}