Beispiel #1
0
exception_t performASIDControlInvocation(void* frame, cte_t* slot, cte_t* parent, asid_t asid_base)
{
    cap_untyped_cap_ptr_set_capFreeIndex(&(parent->cap),
                                         MAX_FREE_INDEX(cap_untyped_cap_get_capBlockSize(parent->cap)));

    memzero(frame, 1 << pageBitsForSize(X86_SmallPage));
    cteInsert(
        cap_asid_pool_cap_new(
            asid_base,          /* capASIDBase  */
            WORD_REF(frame)     /* capASIDPool  */
        ),
        parent,
        slot
    );
    /* Haskell error: "ASID pool's base must be aligned" */
    assert((asid_base & MASK(asidLowBits)) == 0);
    x86KSASIDTable[asid_base >> asidLowBits] = (asid_pool_t*)frame;

    return EXCEPTION_NONE;
}
Beispiel #2
0
g_error ez328_setmode(s16 xres,s16 yres,s16 bpp,u32 flags) {
  g_error e;
   
  /* bpp-specific setup. Load the appropriate VBL and set the controller's
   * LVPW and LPICF registers to reflect the bpp */
  switch (bpp) {
      
#ifdef CONFIG_VBL_LINEAR1
  case 1:
    setvbl_linear1(vid);
    LVPW = LXMAX / 16;
    LPICF &= 0xFC;
    break;
#endif
      
#ifdef CONFIG_VBL_LINEAR2
  case 2:
    /* disable display and lcd controller */
    PMDATA &= ~PM_DQML;       /* LCD_ON to low */
    usleep(40000);            /* delay 40ms (min is 20ms) */
    LCKCON &= ~LCKCON_LCDON;  /* LCKCON - LCD is off */

    setvbl_linear2(vid);
    LVPW = LXMAX / 8;
    LPICF &= 0xFC;
    LPICF |= 1;
# if defined(CONFIG_XCOPILOT)  || \
     defined(CONFIG_SOFT_CHIPSLICE)
    /* the xcopilot emulator is a MC68328, it has a 16-bit LGPMR */
    WORD_REF(0xfffffa32) = 0x10f2; /* default: 0x1073 */
# else
    /* the MC68{EZ,VZ}328 have a 8-bit LGPMR */
    LGPMR = 0xC4;        /* Set a default palette */
# endif

    /* re-enable lcd controller and display */
    LCKCON |= LCKCON_LCDON;   /* LCKCON - LCD is on */
    usleep(40000);            /* delay 40ms (min is 20ms) */
    PMDATA |= PM_DQML;        /* LCD_ON to high */

    break;
#endif

#ifdef CONFIG_VBL_LINEAR4
  case 4:
    setvbl_linear4(vid);
    LVPW = LXMAX / 4;
    LPICF &= 0xFC;
    LPICF |= 2;
    break;
#endif

  default:
    ez328_close();
    return mkerror(PG_ERRT_BADPARAM,101);   /* Unknown bpp */
  };
      
  vid->xres   = LXMAX;
  vid->yres   = LYMAX+1;
  vid->bpp    = bpp;
  FB_BPL = LVPW << 1;
   
   /* Allocate video memory */
  if (FB_MEM)
    g_free(FB_MEM);
  e = g_malloc((void **) &FB_MEM, vid->yres * FB_BPL);
  errorcheck;
  LSSA = (u32) FB_MEM;

  return success;
}