Example #1
0
//=========================================================
// Copy the given page and all consecutive subsequent ones
//=========================================================
void CopyPages(long address, struct Task *task)
{
	address &= PageMask;
	// Get physical address of current PT

	struct PML4 *pml4 = (struct PML4 *) (task->cr3);
	struct PML4 *current_pml4 = (struct PML4 *) (currentTask->cr3);

	while (1)
	{
		struct PT *pt = GetPT(pml4, address, task->pid);
		struct PT *currentPT = GetPT(current_pml4, address, currentTask->pid);

		int i = GetPTIndex(address);
		if (!(VIRT(PT,currentPT) ->entries[i].value))
			break;

		// Copy the physical memory
		p_Address data = AllocPage(task->pid);
		//data += VAddr / 8;
		CreatePTEWithPT((struct PML4 *)task->cr3, data, address, task->pid,
				US | RW | P | 0x800);
		memcpy(
				(void *) PAGE(((VIRT(PT, pt)) ->entries[i].value)) + VAddr,
				(void *) PAGE(((VIRT(PT, currentPT)) ->entries[i].value)) + VAddr, PageSize);
		address += PageSize;
	}

}
Example #2
0
/*!
 * CAAM page allocation:
 * Allocates a partition from secure memory, with the id
 * equal to partion_num. This will de-allocate the page
 * if it is already allocated. The partition will have
 * full access permissions. The permissions are set before,
 * running a job descriptor. A memory page of secure RAM
 * is allocated for the partition.
 *
 * @param   page  Number of the page to allocate.
 * @param   partition  Number of the partition to allocate.
 * @return  0 on success, ERROR_IN_PAGE_ALLOC otherwise
 */
int caam_page_alloc(uint8_t page_num, uint8_t partition_num)
{
	uint32_t temp_reg;

	ccsr_sec_t *sec = (void *)CONFIG_SYS_FSL_SEC_ADDR;
	uint32_t sm_vid = SM_VERSION(sec_in32(&sec->smvid));
	uint32_t jr_id = 0;

	/*
	 * De-Allocate partition_num if already allocated to ARM core
	 */
	if (sec_in32(CAAM_SMPO_0) & PARTITION_OWNER(partition_num)) {
		temp_reg = secmem_set_cmd(PARTITION(partition_num) |
						CMD_PART_DEALLOC);
		if (temp_reg & SMCSJR_AERR) {
			printf("Error: De-allocation status 0x%X\n", temp_reg);
			return ERROR_IN_PAGE_ALLOC;
		}
	}

	/* set the access rights to allow full access */
	sec_out32(CAAM_SMAG1JR(sm_vid, jr_id, partition_num), 0xF);
	sec_out32(CAAM_SMAG2JR(sm_vid, jr_id, partition_num), 0xF);
	sec_out32(CAAM_SMAPJR(sm_vid, jr_id, partition_num), 0xFF);

	/* Now need to allocate partition_num of secure RAM. */
	/* De-Allocate page_num by starting with a page inquiry command */
	temp_reg = secmem_set_cmd(PAGE(page_num) | CMD_INQUIRY);

	/* if the page is owned, de-allocate it */
	if ((temp_reg & SMCSJR_PO) == PAGE_OWNED) {
		temp_reg = secmem_set_cmd(PAGE(page_num) | CMD_PAGE_DEALLOC);
		if (temp_reg & SMCSJR_AERR) {
			printf("Error: Allocation status 0x%X\n", temp_reg);
			return ERROR_IN_PAGE_ALLOC;
		}
	}

	/* Allocate page_num to partition_num */
	temp_reg = secmem_set_cmd(PAGE(page_num) | PARTITION(partition_num)
						| CMD_PAGE_ALLOC);
	if (temp_reg & SMCSJR_AERR) {
		printf("Error: Allocation status 0x%X\n", temp_reg);
		return ERROR_IN_PAGE_ALLOC;
	}
	/* page inquiry command to ensure that the page was allocated */
	temp_reg = secmem_set_cmd(PAGE(page_num) | CMD_INQUIRY);

	/* if the page is not owned => problem */
	if ((temp_reg & SMCSJR_PO) != PAGE_OWNED) {
		printf("Allocation of page %d in partition %d failed 0x%X\n",
		       temp_reg, page_num, partition_num);

		return ERROR_IN_PAGE_ALLOC;
	}

	return 0;
}
Example #3
0
void Hes_Core::write_mem( addr_t addr, int data )
{
	check( addr < 0x10000 );
	byte* out = write_pages [PAGE( addr )];
	if ( out )
		out [addr & (cpu.page_size - 1)] = data;
	else if ( cpu.mmr [PAGE( addr )] == 0xFF )
		write_mem_( addr, data );
}
Example #4
0
   // PD_TRACE_DECLARE_FUNCTION ( SDB__DPSRPCMGR__GETSTARTLSN, "_dpsReplicaLogMgr::_getStartLsn" )
   DPS_LSN _dpsReplicaLogMgr::_getStartLsn ()
   {
      PD_TRACE_ENTRY ( SDB__DPSRPCMGR__GETSTARTLSN );
      UINT32 begin = _begin ;
      DPS_LSN lsn ;

      for ( UINT32 count = 0 ; count < _pageNum; count++ )
      {
         lsn = PAGE(begin)->getBeginLSN () ;
         if ( !lsn.invalid() )
         {
            goto done ;
         }

         if ( begin == _work )
         {
            break ;
         }

         begin = _incPageID ( begin ) ;
      }
   done :
      PD_TRACE_EXIT ( SDB__DPSRPCMGR__GETSTARTLSN );
      return lsn ;
   }
Example #5
0
   // PD_TRACE_DECLARE_FUNCTION ( SDB__DPSRPCMGR__PSH2SNDQUEUE, "_dpsReplicaLogMgr::_push2SendQueue" )
   void _dpsReplicaLogMgr::_push2SendQueue( const dpsPageMeta &allocated )
   {
      PD_TRACE_ENTRY ( SDB__DPSRPCMGR__PSH2SNDQUEUE );

      SDB_ASSERT( allocated.valid(), "impossible" ) ;
      for ( UINT32 i = 0; i < allocated.pageNum; ++i )
      {
         _dpsLogPage *page = PAGE(allocated.beginSub + i) ;
         if ( 0 == page->getLastSize() )
         {
            if ( !_restoreFlag )
            {
               _queue.push ( page ) ;
               _queSize.inc() ;
            }
            else
            {
               _idleSize.add( page->getLength() );
               page->clear() ;
            }
         }
      }

      PD_TRACE_EXIT ( SDB__DPSRPCMGR__PSH2SNDQUEUE );
      return ;
   }
Example #6
0
   // PD_TRACE_DECLARE_FUNCTION ( SDB__DPSRPCMGR__MRGPAGE, "_dpsReplicaLogMgr::_mergePage" )
   void _dpsReplicaLogMgr::_mergePage( const CHAR *src,
                                       UINT32 len,
                                       UINT32 &workSub,
                                       UINT32 &offset )
   {
      PD_TRACE_ENTRY ( SDB__DPSRPCMGR__MRGPAGE ) ;
      UINT32 needcpy = len ;
      UINT32 srcOffset = 0 ;
      UINT32 pageIdle = 0 ;
      UINT32 cpylen = 0 ;

      while ( needcpy > 0 )
      {
         dpsLogPage *page = PAGE(workSub) ;
         pageIdle = page->getBufSize() - offset ;
         cpylen = pageIdle < needcpy ? pageIdle : needcpy ;
         page->fill( offset, src + srcOffset, cpylen ) ;

         needcpy -= cpylen ;
         srcOffset += cpylen ;
         offset += cpylen ;

         if ( offset == page->getBufSize() )
         {
            workSub++ ;
            offset = 0 ;
         }
      }

      PD_TRACE_EXIT ( SDB__DPSRPCMGR__MRGPAGE ) ;
      return;
   }
Example #7
0
int Hes_Core::read_mem( addr_t addr )
{
	check( addr < 0x10000 );
	int result = *cpu.get_code( addr );
	if ( cpu.mmr [PAGE( addr )] == 0xFF )
		result = read_mem_( addr );
	return result;
}
Example #8
0
/* Allocation by pool (size <= PAGE_SIZE / 2) */
static void pool_descr_free (page_descr_t *cache_descr,
                             page_descr_t *pool_descr)
{
    page_put(PAGE(pool_descr->addr), 1);
    page_cache_remove_descr(cache_descr);
    pool_descr->next->prev = pool_descr->prev;
    pool_descr->prev->next = pool_descr->next;
    page_descr_put(pool_descr);
}
Example #9
0
/* create_task() is for execute a function in user mode */
void create_task(uint8_t *opcode, uint32_t size)
{

  struct process_s *proc;
  uint32_t *page, *page_dir;

  /* Todo: fixe that */
  if (size >= PAGE_SIZE)
    return;

  page = (uint32_t *)getPage();
  memcpy(page, (uint8_t*)opcode, size);

  page_dir = (uint32_t *)create_pagedir(page, size);
  proc = (struct process_s *)kmalloc(sizeof(struct process_s));
  if (!proc){
    kmm[PAGE((uint32_t)page)] = FREE;
    return ;
  }
  proc->pid = pid_g++;
  proc->uid = 0;                        /* TODO */
  proc->gid = 0;                        /* TODO */
  proc->name = NULL;                    /* TODO */
  proc->mm = page;
  proc->mem_size = size;
  proc->priority = 0;                   /* TODO */
  proc->regs.ss = 0x33;
  proc->regs.esp = USER_VADDR_STACK;
  proc->regs.cs = 0x23;
  proc->regs.eip = USER_VADDR;
  proc->regs.ds = 0x2B;
  proc->regs.es = 0x2B;
  proc->regs.fs = 0x2B;
  proc->regs.gs = 0x2B;
  proc->regs.cr3 = (uint32_t)page_dir;
  proc->regs.esp0 = 0x18;
  proc->regs.ss0 = (uint32_t)(getPage() + PAGE_SIZE - 1);
  proc->regs.eax = 0;
  proc->regs.ebx = 0;
  proc->regs.ecx = 0;
  proc->regs.edx = 0;
  proc->regs.esi = 0;
  proc->regs.edi = 0;
  proc->regs.ebp = 0;

  /* TODO: reinit first_proc and last_proc if sys_exit() in process */
  if (!first_proc)
    first_proc = proc;

  proc->next = first_proc;
  proc->back = last_proc;
  if (proc->back != proc)
    proc->back->next = proc;
  last_proc = proc;

  nb_proc++;
}
Example #10
0
unused static void pool_free (page_descr_t *cache_descr, void *area)
{
    page_descr_t *pool_head, *pool_descr, *pool_next, *free_pool;
    free_slot_t *first_free, *next_free;
    unsigned long size, pool_idx;
    
    pool_descr = page_cache_page_descr(cache_descr);
    first_free = area;
    next_free = pool_descr->addr;
    pool_idx = page_cache_pool_idx(cache_descr);
    size = 1 << (MIN_ELEM_BITS + pool_idx);
    first_free->next = next_free;
    pool_descr->addr = first_free;
    pool_descr->nb--;
    pool_head = pool_head_get(pool_idx);
    if (pool_descr->nb == 0) {
        if (pool_head->addr == pool_descr ||
            pool_head->addr == NULL ||
            pool_head->nb > 0)
            free_pool = descr_find_free(pool_head, pool_descr);
        else
            free_pool = pool_head->addr;
        if (free_pool != NULL) {
            /* Free page & descriptor */
            pool_descr_free(cache_descr, pool_descr);
            pool_head->addr = free_pool;
        } else {
            pool_head->addr = pool_descr;
            pool_head->nb++;
        }
    } else if (next_free == NULL) {
        free_pool = pool_descr;
        for (pool_descr = pool_head->next;
             pool_head->nb > 0 && pool_descr != pool_head;
             pool_descr = pool_next) {
            pool_next = pool_descr->next;
            if (pool_descr->nb == 0) {
                if (pool_head->addr == pool_descr)
                    pool_head->addr = NULL;
                cache_descr = page_cache_get_descr(PAGE(pool_descr->addr));
                if (cache_descr != NULL) {
                    pool_descr_free(cache_descr, pool_descr);
                    pool_head->nb--;
                } else {
                    /* Incoherency: what to do ? */
                }
            }
        }
        if (pool_head->addr == NULL)
            pool_head->addr = free_pool;
    }
}
Example #11
0
void *realloc (void *area, size_t new_size)
{
    void *new_area;
    page_descr_t *pool_descr, *cache_descr;
    size_t size;
    int pool_idx, new_pool_idx;

    if (malloc_base == NULL || new_size == 0) {
        free(area);
        return NULL;
    }
    if (area == NULL)
        return malloc(new_size);
    cache_descr = page_cache_get_descr(PAGE(area));
    if (cache_descr == NULL) {
        /* Given area is not valid */
        return NULL;
    }
    pool_idx = page_cache_pool_idx(cache_descr);
    if (new_size >= MAX_ELEM_SIZE) {
        new_pool_idx = POOL_MAX;
        if (pool_idx == POOL_MAX)
            return big_realloc(cache_descr, new_size);
    } else {
        if (new_size <= MIN_ELEM_SIZE)
            new_pool_idx = 0;
        else
            new_pool_idx = get_pool_idx(size);
        if (pool_idx == new_pool_idx)
            return area;
    }
    /* Common case: alloc, copy & free */
    if (new_pool_idx == POOL_MAX)
        new_area = big_malloc((new_size + PAGE_SIZE - 1) / PAGE_SIZE);
    else
        new_area = pool_malloc(new_pool_idx);
    if (new_area == NULL)
        return NULL;
    if (pool_idx == POOL_MAX) {
        pool_descr = page_cache_page_descr(cache_descr);
        size = pool_descr->nb * PAGE_SIZE;
    } else {
        size = MIN_ELEM_SIZE << pool_idx;
    }
    memcpy(new_area, area, size);
    if (pool_idx == POOL_MAX)
        big_free(cache_descr);
    else
        pool_free(cache_descr, area);
    
    return new_area;
}
Example #12
0
static void page_descr_put (page_descr_t *page_descr)
{
    page_descr_t *main_descr, *head_descr, *next_descr, *free_descr;
    free_slot_t *first_free, *next_free;
    
    head_descr = PAGE(page_descr);
    /* Mark this descriptor as free */
    next_free = head_descr->addr;
    first_free = (free_slot_t *)page_descr;
    first_free->next = next_free;
    /* Update page descriptor */
    head_descr->addr = first_free;
    head_descr->nb--;
    main_descr = main_descr_get();
    if (head_descr->nb == 0) {
        /* Try to free this page */
        if (main_descr->addr == head_descr ||
            main_descr->addr == NULL ||
            main_descr->nb > 0)
            free_descr = descr_find_free(main_descr, head_descr);
        else
            free_descr = main_descr->addr;
        if (free_descr != NULL) {
            /* Update main descriptor */
            page_descr_free(head_descr);
            main_descr->addr = free_descr;
        } else {
            main_descr->addr = head_descr;
            main_descr->nb++;
        }
    } else if (next_free == NULL) {
        free_descr = head_descr;
        for (head_descr = main_descr->next;
             main_descr->nb > 0 && head_descr != main_descr;
             head_descr = next_descr) {
            next_descr = head_descr->next;
            if (head_descr->nb == 0) {
                if (main_descr->addr == head_descr)
                    main_descr->addr = NULL;
                page_descr_free(head_descr);
                main_descr->nb--;
            }
        }
        if (main_descr->addr == NULL)
            main_descr->addr = free_descr;
    }
}
Example #13
0
//
// Caller supplies pointer to an array of page indices, and number of pages.
// This routine tries to load the corresponding pages from MSF file to the
//  memory and returns pointer to it.
// This is an internal routine.
//
static void* MsfLoadPages (MSF* msf, uint32_t *pdwPointers, size_t nPages)
{
        unsigned long i=0;
        void* Data = calloc(nPages * msf->hdr->dw_page_size, 1);
        if (Data != NULL)
        {
                for (i=0; i<nPages; i++)
                {
                        void* Page = PAGE(msf, pdwPointers[i]);
                        size_t Offset = msf->hdr->dw_page_size * i;

                        memcpy ((uint8_t*)Data + Offset, Page, msf->hdr->dw_page_size);
                }
        }

        return Data;
}
Example #14
0
   // PD_TRACE_DECLARE_FUNCTION ( SDB__DPSRPCMGR__PARSE, "_dpsReplicaLogMgr::_parse" )
   INT32 _dpsReplicaLogMgr::_parse( UINT32 sub, UINT32 offset,
                                    UINT32 len, CHAR *out )
   {
      INT32 rc            = SDB_OK ;
      PD_TRACE_ENTRY ( SDB__DPSRPCMGR__PARSE );
      UINT32 localSub     = sub;
      UINT32 localOffset  = offset;
      UINT32 needParseLen = len;
      UINT32 outOffset    = 0;
      SDB_ASSERT ( out, "out can't be NULL" ) ;
      if ( offset + len >= _pageNum*DPS_DEFAULT_PAGE_SIZE )
      {
         PD_LOG ( PDERROR, "offset + len is greater than buffer size, "
                  "offset = %d, len = %d", offset, len ) ;
         rc = SDB_DPS_CORRUPTED_LOG ;
         goto error ;
      }
      while ( needParseLen > 0 )
      {
         UINT32 parseLen = ( DPS_DEFAULT_PAGE_SIZE - localOffset ) <
                                 needParseLen ?
                           ( DPS_DEFAULT_PAGE_SIZE - localOffset ) :
                                 needParseLen;
         ossMemcpy( out + outOffset,
                    (PAGE( localSub )->mb())->offset( localOffset ), parseLen );

         localOffset += parseLen;
         outOffset += parseLen;
         needParseLen -= parseLen;

         if ( 0 == ( DPS_DEFAULT_PAGE_SIZE - localOffset ) )
         {
            localSub = _incPageID( localSub ) ;
            localOffset = 0 ;
         }
      }
   done :
      PD_TRACE_EXITRC ( SDB__DPSRPCMGR__PARSE, rc );
      return rc ;
   error :
      goto done ;
   }
Example #15
0
void free (void *area)
{
    page_descr_t *cache_descr;
    int pool_idx;

    if (malloc_base == NULL || area == NULL)
        return;
    cache_descr = page_cache_get_descr(PAGE(area));
    if (cache_descr != NULL) {
        pool_idx = page_cache_pool_idx(cache_descr);
        if (pool_idx == POOL_MAX) {
            big_free(cache_descr);
        } else {
            pool_free(cache_descr, area);
        }
    } else {
        /* Given area is not valid */
        MEMOPS_PRINTF("ERROR: area to free not found: %p\n", area);
    }
}
Example #16
0
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Dispatch command
//#pragma comment(lib, "ComCtl32.lib")
HRESULT Dispatch(PTSTR ptzCmd, CXT& XT)
{
	// Get command ID
	UINT uCmd;
	PTSTR p = ptzCmd;
	for (uCmd = 0; uCmd < _NumOf(c_tzCmd); uCmd++)
	{
		if (UStrMatchI(p, c_tzCmd[uCmd]) >= CC_LEN)
		{
			// skip white space
			for (p += CC_LEN; (*p == ' ') || (*p == '\t'); p++);
			break;
		}
	}

	switch (uCmd)
	{
	case CMD_LOAD:
		return LOAD(p);

	case CMD_BATC:
		return BATC(p, XT);

	case CMD_IFEX:
		if (*p)
		{
			if (PTSTR ptzArg = UStrChr(p, CC_SEP))
			{
				*ptzArg++ = 0;
				if (IFEX(p))
				{
					Dispatch(ptzArg, XT);
				}
				return XT.hXVar;
			}
			else if (!IFEX(p))
			{
				if (p = UStrStr(XT.ptzNext, TEXT("IFEX\r\n")))
				{
					XT.ptzNext = p + CC_LEN + 2;
					return S_OK;
				}
				else if (p = UStrStr(XT.ptzNext, TEXT("IFEX\n")))
				{
					XT.ptzNext = p + CC_LEN + 1;
					return S_OK;
				}
				else
				{
					XT.ptzNext = TEXT("");
					return S_FALSE;
				}
			}
		}
		return S_OK;

	case CMD_ELSE:
		if (!g_bResult) Dispatch(p, XT);
		return XT.hXVar;

	case CMD_EVAL:
		return EVAL(p);

	case CMD_LINK:
		return LINK(p);

	case CMD_FILE:
		return FILe(p);

	case CMD_REGX:
		return REGX(p);

	case CMD_ENVI:
		return (*p == '$') ? ENVI(p + 1, TRUE) : ENVI(p);

	case CMD_SEND:
		return SEND(p);

	case CMD_WAIT:
		Sleep(UStrToInt(p));
		return S_OK;

	case CMD_KILL:
		return KILL(p);

	case CMD_SHUT:
		return SHUT(p);

	case CMD_PLAY:
		return PLAY(p);

	case CMD_BEEP:
		return !MessageBeep(UStrToInt(p));

	case CMD_MSGX:
		return MSGX(p);

	case CMD_DLGX:
		return (HRESULT) DialogBoxParam(g_hInst, MAKEINTRESOURCE(IDD_Dialog), NULL, DLGX, (LPARAM) p);

	case CMD_EXEC:
		return EXEC(p);

	case CMD_CDLL:
		return CDLL(p);

	case CMD_CCUI:
		return (HRESULT) DialogBoxParam(g_hInst, MAKEINTRESOURCE(IDD_Main), NULL, MAIN, (LPARAM) XT.ptzFile);

	case CMD_CALL:
	case CMD_GOTO:
	case CMD_PROC:
		UMemCopy(ptzCmd, c_tzCmd[(uCmd == CMD_PROC) ? CMD_ENDP : CMD_PROC], CC_LEN * sizeof(TCHAR));
		if (p = UStrStr(XT.ptzNext, ptzCmd))
		{
			p += CC_LEN;
			while (*p && (*p++ != '\n'));
			if (uCmd == CMD_CALL)
			{
				return Process(p, XT.ptzFile);
			}
			else
			{
				XT.ptzNext = p;
			}
			return S_OK;
		}
		else if (uCmd == CMD_PROC)
		{
			XT.ptzNext = TEXT("");
		}
		return S_FALSE;

	case CMD_ENDP:
		XT.ptzNext = TEXT("");
		return S_OK;

	case CMD_ASOC:
		return ASOC(p);

	case CMD_DEVI:
		return SERV(p);
		
	case CMD_SERV:
		return SERV(p);

	case CMD_PAGE:
		return PAGE(p);

	case CMD_DISP:
		return DISP(p);

	default:
		PTSTR ptzFile;
		if (ptzFile = UStrRChr(p, '\\'))
		{
			*ptzFile++ = 0;
		}
		return (*p == '!') ? OPEN(p + 1, ptzFile, TRUE) : OPEN(p, ptzFile);
	}
}
#include "pages/summary/gis-summary-page.h"

static gboolean force_existing_user_mode;

typedef void (*PreparePage) (GisDriver *driver);

typedef struct {
  const gchar *page_id;
  PreparePage prepare_page_func;
  gboolean new_user_only;
} PageData;

#define PAGE(name, new_user_only) { #name, gis_prepare_ ## name ## _page, new_user_only }

static PageData page_table[] = {
  PAGE (language, FALSE),
  /* PAGE (region,   FALSE), */
  PAGE (keyboard, FALSE),
  PAGE (eula,     FALSE),
  PAGE (network,  FALSE),
  PAGE (privacy,  FALSE),
  PAGE (timezone, TRUE),
  PAGE (goa,      FALSE),
  PAGE (account,  TRUE),
  PAGE (password, TRUE),
  PAGE (summary,  FALSE),
  { NULL },
};

#undef PAGE
Example #18
0
void memory_dump (void)
{
#if defined (DEBUG_MEMOPS)
    page_descr_t *main_descr, *page_descr;
    page_descr_t *pool_head, *pool_descr, *cache_head, *cache_descr;
    int i, n;

    main_descr = main_descr_get();
    /* Dump descriptor pages */
    printf("Descriptor pages dump: %p max=%d %d pages with no alloc descrs\n",
           main_descr, (int)(PAGE_SIZE / sizeof(page_descr_t)), (int)main_descr->nb);
    n = 0;
    for (page_descr = main_descr->next;
         page_descr != main_descr; page_descr = page_descr->next) {
        printf("Descr %d : %p %p used: %d\n",
               n, page_descr, page_descr->addr, (int)page_descr->nb);
        n++;
    }
    /* Dump pool areas pages */
    for (i = 0; i < POOL_MAX; i++) {
        n = 0;
        pool_head = pool_head_get(i);
        printf("Pool %d %p\n", i, pool_head);
        for (pool_descr = pool_head->next;
             pool_descr != pool_head; pool_descr = pool_descr->next) {
            printf("Pool %d descr %d : %p %p used: %d size %d free: %p %p\n",
                   i, n, pool_descr, PAGE(pool_descr->addr), (int)pool_descr->nb,
                   1 << (MIN_ELEM_BITS + i), pool_descr->addr,
                   ((free_slot_t *)pool_descr->addr)->next);
            n++;
        }
        printf(" => %d pages allocated\n", n);
    }
#if 0
    /* Dump big area pages */
    printf("Pool %d\n", POOL_MAX);
    n = 0;
    pool_head = pool_head_get(POOL_MAX);
    for (pool_descr = pool_head->next;
         pool_descr != pool_head; pool_descr = pool_descr->next) {
        printf("Pool %d descr %d : %p nb pages: %d\n",
               POOL_MAX, n, pool_descr->addr, (int)pool_descr->nb);
        n++;
    }
    printf(" => %d pages allocated\n", n);
    /* Dump page cache */
    for (i = 0; i < CACHE_MAX; i++) {
        printf("Page cache 0x____%x___\n", i);
        n = 0;
        cache_head = cache_head_get(i);
        for (cache_descr = cache_head->next;
             cache_descr != cache_head; cache_descr = cache_descr->next) {
            pool_descr = page_cache_page_descr(cache_descr);
            printf("Cache %d descr %d : %p pool: %d descr: %p %p %d\n",
                   i, n, cache_descr->addr,
                   (int)page_cache_pool_idx(cache_descr),
                   pool_descr, pool_descr->addr, (int)pool_descr->nb);
            n++;
        }
        printf(" => %d pages allocated\n", n);
    }
#endif
#endif
}