Esempio n. 1
0
void
dae_print(u_int *f)
{
    struct trapframe *eframe = (void *)f;

    if (!ISSET(eframe->tf_dmt0, DMT_VALID))
        return;

    dae_print_one(0, eframe->tf_dma0, eframe->tf_dmd0, eframe->tf_dmt0);
    dae_print_one(1, eframe->tf_dma1, eframe->tf_dmd1, eframe->tf_dmt1);
    dae_print_one(2, eframe->tf_dma2, eframe->tf_dmd2, eframe->tf_dmt2);
}
Esempio n. 2
0
void
dae_process(struct trapframe *eframe, u_int x,
    u_int dmax, u_int dmdx, u_int dmtx)
{
	u_int v, reg, enbits;

	if (!ISSET(dmtx, DMT_VALID))
		return;

	DAE_DEBUG(dae_print_one(x, dmax, dmdx, dmtx));

	enbits = DMT_ENBITS(dmtx);
	dmax += dmt_en_info[enbits].offset;
	reg = DMT_DREGBITS(dmtx);

	if (!ISSET(dmtx, DMT_LOCKBAR)) {
		/* the fault is not during an XMEM */

		if (x == 2 && ISSET(dmtx, DMT_DOUB1)) {
			/* pipeline 2 (earliest stage) for a double */

			if (ISSET(dmtx, DMT_WRITE)) {
				/*
				 * STORE DOUBLE WILL BE REINITIATED BY rte
				 */
			} else {
				/* EMULATE ld.d INSTRUCTION */
				v = do_load_word(dmax, dmtx & DMT_DAS);
				if (reg != 0)
					eframe->tf_r[reg] = v;
				v = do_load_word(dmax ^ 4, dmtx & DMT_DAS);
				if (reg != 31)
					eframe->tf_r[reg + 1] = v;
			}
		} else {
			/* not pipeline #2 with a double */
			if (dmtx & DMT_WRITE) {
				switch (dmt_en_info[enbits].size) {
				case DMT_BYTE:
				DAE_DEBUG(
					printf("[byte %x -> %08x(%c)]\n",
					    dmdx & 0xff, dmax,
					    ISSET(dmtx, DMT_DAS) ? 's' : 'u')
				);
					do_store_byte(dmax, dmdx,
					    dmtx & DMT_DAS);
					break;
				case DMT_HALF:
				DAE_DEBUG(
					printf("[half %x -> %08x(%c)]\n",
					    dmdx & 0xffff, dmax,
					    ISSET(dmtx, DMT_DAS) ? 's' : 'u')
				);
					do_store_half(dmax, dmdx,
					    dmtx & DMT_DAS);
					break;
				case DMT_WORD:
				DAE_DEBUG(
					printf("[word %x -> %08x(%c)]\n",
					    dmdx, dmax,
					    ISSET(dmtx, DMT_DAS) ? 's' : 'u')
				);
					do_store_word(dmax, dmdx,
					    dmtx & DMT_DAS);
					break;
				}
			} else {
				/* else it's a read */
				switch (dmt_en_info[enbits].size) {
				case DMT_BYTE:
					v = do_load_byte(dmax, dmtx & DMT_DAS);
					if (!ISSET(dmtx, DMT_SIGNED))
						v &= 0x000000ff;
					break;
				case DMT_HALF:
					v = do_load_half(dmax, dmtx & DMT_DAS);
					if (!ISSET(dmtx, DMT_SIGNED))
						v &= 0x0000ffff;
					break;
				case DMT_WORD:
					v = do_load_word(dmax, dmtx & DMT_DAS);
					break;
				}
				DAE_DEBUG(
					if (reg == 0)
						printf("[no write to r0 done]\n");
					else
						printf("[r%d <- %08x]\n", reg, v);
				);
				if (reg != 0)
					eframe->tf_r[reg] = v;
			}
		}
	} else {