Ejemplo n.º 1
0
void
f_error(fcode_env_t *env)
{
#if 0
	env->interpretting = 0;
	log_message(MSG_ERROR, "Uniplemented FCODE token encountered %x\n",
	    env->last_fcode);
#else
	forth_abort(env, "Unimplemented FCODE token: 0x%x\n", env->last_fcode);
#endif
}
Ejemplo n.º 2
0
static void
fc_reg_write(fcode_env_t *env, char *service, fstack_t virt, fc_cell_t data,
             int *errp)
{
    fc_cell_t virtaddr;
    int error, nin;

    if (!is_mcookie(virt))
        forth_abort(env, "fc_reg_write: bad mcookie: 0x%x\n", virt);

    virtaddr = mcookie_to_addr(virt);

    /* Supress fc_run_priv error msgs on pokes */
    nin = ((errp == NULL) ? 2 : (2 | FCRP_NOERROR));

    error = fc_run_priv(env->private, service, nin, 0, virtaddr, data);
    if (errp)
        /* Don't report error on pokes */
        *errp = error;
    else if (error) {
        forth_abort(env, "fc_write_reg: ERROR: cookie: %llx"
                    " virt: %llx\n", (uint64_t)virt, (uint64_t)virtaddr);
    }
}
Ejemplo n.º 3
0
static fc_cell_t
fc_reg_read(fcode_env_t *env, char *service, fstack_t virt, int *errp)
{
    fc_cell_t virtaddr, data;
    int error, nin;

    if (!is_mcookie(virt))
        forth_abort(env, "fc_reg_read: bad mcookie: 0x%x\n", virt);

    virtaddr = mcookie_to_addr(virt);

    /* Supress fc_run_priv error msgs on peeks */
    nin = ((errp == NULL) ? 1 : (1 | FCRP_NOERROR));

    error = fc_run_priv(env->private, service, nin, 1, virtaddr, &data);
    if (errp)
        /* Don't report error on peeks */
        *errp = error;
    else if (error) {
        forth_abort(env, "fc_read_reg: ERROR: cookie: %llx"
                    " virt: %llx\n", (uint64_t)virt, (uint64_t)virtaddr);
    }
    return (data);
}