Exemplo n.º 1
0
void *ppc_exc_vector_address(unsigned vector)
{
  uintptr_t vector_base = 0xfff00000;
  uintptr_t vector_offset = vector << 8;

  if (ppc_cpu_has_altivec()) {
    if (vector == ASM_60X_VEC_VECTOR) {
      vector_offset = ASM_60X_VEC_VECTOR_OFFSET;
    }
  }

  if (ppc_cpu_is(PPC_405)) {
    switch (vector) {
      case ASM_BOOKE_FIT_VECTOR:
        vector_offset = ASM_PPC405_FIT_VECTOR_OFFSET;
        break;
      case ASM_BOOKE_WDOG_VECTOR:
        vector_offset = ASM_PPC405_WDOG_VECTOR_OFFSET;
        break;
      case ASM_TRACE_VECTOR:
        vector_offset = ASM_PPC405_TRACE_VECTOR_OFFSET;
        break;
      case ASM_PPC405_APU_UNAVAIL_VECTOR:
        vector_offset = ASM_60X_VEC_VECTOR_OFFSET;
      default:
        break;
    }
  }

  if (
    ppc_cpu_is_bookE() == PPC_BOOKE_STD
      || ppc_cpu_is_bookE() == PPC_BOOKE_E500
  ) {
    if (vector < sizeof(ivor_values) / sizeof(ivor_values [0])) {
      vector_offset = ((uintptr_t) ivor_values [vector]) << 4;
    } else {
      vector_offset = 0;
    }
  }

  if (bsp_exceptions_in_RAM) {
    vector_base = ppc_exc_vector_base;
  }

  return (void *) (vector_base + vector_offset);
}
Exemplo n.º 2
0
const ppc_exc_categories *ppc_exc_categories_for_cpu(ppc_cpu_id_t cpu)
{
  if (ppc_cpu_has_altivec()) {
    switch (cpu) {
      case PPC_7400:
        return &mpc_750_altivec_category_table;
      case PPC_7455:
      case PPC_7457:
        return &mpc_604_altivec_category_table;
      default:
        break;
    }
  }

  switch (cpu) {
    case PPC_7400:
    case PPC_750:
      return &mpc_750_category_table;
    case PPC_7455:
    case PPC_7457:
    case PPC_604:
    case PPC_604e:
    case PPC_604r:
      return &mpc_604_category_table;
    case PPC_603:
    case PPC_603e:
    case PPC_603le:
    case PPC_603ev:
    /* case PPC_8240: same value as 8260 */
    case PPC_8260:
    case PPC_8245:
      return &mpc_603_category_table;
    case PPC_e300c1:
    case PPC_e300c2:
    case PPC_e300c3:
      return &e300_category_table;
    case PPC_PSIM:
      return &psim_category_table;
    case PPC_8540:
    case PPC_e500v2:
    case PPC_e6500:
      return &e500_category_table;
    case PPC_e200z0:
    case PPC_e200z1:
    case PPC_e200z4:
    case PPC_e200z6:
    case PPC_e200z7:
      return &e200_category_table;
    case PPC_5XX:
      return &mpc_5xx_category_table;
    case PPC_860:
      return &mpc_860_category_table;
    case PPC_405:
    case PPC_405GP:
    case PPC_405EX:
      return &ppc_405_category_table;
    case PPC_440:
      return &ppc_booke_category_table;
    default:
      break;
  }

  return NULL;
}