static void _init(void) { fcode_env_t *env = initial_env; ASSERT(env); NOTICE; FORTH(0, ".error-buffer", dot_error_buffer); FORTH(0, "set-error-log", set_error_log); }
static void _init(void) { fcode_env_t *env = initial_env; NOTICE; ASSERT(env); FORTH(0, "propbufs", propbufs); FORTH(0, "dump-resource", dump_resources); }
static void _init(void) { fcode_env_t *env = initial_env; ASSERT(env); NOTICE; FORTH(0, "install-openprom-nodes", install_openprom_nodes); FORTH(0, "claim", claim); FORTH(0, "release", release); P1275(0x106, 0, ">physical", fc_vtop); }
static void _init(void) { fcode_env_t *env = initial_env; int i; ASSERT(env); NOTICE; for (i = 0; i < NUM_DEFAULT_ACTIONS; i++) { define_actions(env, 3, value_defines[i]); value_actions[i] = env->action_ptr; } #if defined(DEBUG) FORTH(0, "get", do_get); FORTH(0, "set", do_set); FORTH(0, "addr", do_addr); FORTH(0, "dump-actions", dump_actions); FORTH(IMMEDIATE, "actions", actions); FORTH(IMMEDIATE, "use-actions", use_actions); FORTH(IMMEDIATE, "action:", action_colon); FORTH(0, "perform-action", perform_action); #endif /* DEBUG */ }
void install_openprom_nodes(fcode_env_t *env) { MYSELF = open_instance_chain(env, env->root_node, 0); if (MYSELF != NULL) { make_a_node(env, "openprom", 0); make_a_node(env, "client-services", 0); FORTH(0, "claim", claim); FORTH(0, "release", release); finish_device(env); finish_device(env); close_instance_chain(env, MYSELF, 0); device_end(env); MYSELF = 0; } }
static void _init(void) { fcode_env_t *env = initial_env; mac_addr = MALLOC(MAC_ADDR_SIZE); ASSERT(env); NOTICE; ANSI(0x06e, 0, "l@", fcd_lfetch); ANSI(0x06f, 0, "w@", fcd_wfetch); ANSI(0x071, 0, "c@", fcd_cfetch); ANSI(0x073, 0, "l!", fcd_lstore); ANSI(0x074, 0, "w!", fcd_wstore); ANSI(0x075, 0, "c!", fcd_cstore); ANSI(0x078, 0, "move", fcd_move); ANSI(0x07a, 0, "comp", fcd_comp); ANSI(0x120, 0, "diagnostic-mode?", diagnostic_mode); ANSI(0x1a4, 0, "mac-address", mac_address); P1275(0x220, 0, "cpeek", cpeek); P1275(0x221, 0, "wpeek", wpeek); P1275(0x222, 0, "lpeek", lpeek); P1275(0x223, 0, "cpoke", cpoke); P1275(0x224, 0, "wpoke", wpoke); P1275(0x225, 0, "lpoke", lpoke); P1275(0x230, 0, "rb@", rbfetch); P1275(0x231, 0, "rb!", rbstore); P1275(0x232, 0, "rw@", rwfetch); P1275(0x233, 0, "rw!", rwstore); P1275(0x234, 0, "rl@", rlfetch); P1275(0x235, 0, "rl!", rlstore); P1275(0x246, 0, "x@", fcd_xfetch); P1275(0x247, 0, "x!", fcd_xstore); P1275(0x22e, 0, "rx@", rxfetch); P1275(0x22f, 0, "rx!", rxstore); FORTH(0, "set-diagnostic-mode", set_diagnostic_mode); FORTH(0, "local-mac-address?", local_mac_address); FORTH(0, "local-ether-addr", local_ether_addr); }
std::string convert(const std::string& src){ std::string result; unsigned long long hash = 0; for(int i=0;i<3;i++){ hash *= 256; hash += (unsigned long long)(src[i]); } result += table.table[FIRST(hash)]; result += table.table[SECOND(hash)]; result += table.table[THIRD(hash)]; result += table.table[FORTH(hash)]; return std::move(result); }
static void _init(void) { fcode_env_t *env = initial_env; ASSERT(env); NOTICE; P1275(0x000, DEFINER, "end0", end0); P1275(0x010, DEFINER, "b(lit)", blit); P1275(0x011, DEFINER, "b(')", btick); P1275(0x012, DEFINER, "b(\")", bquote); P1275(0x013, DEFINER, "bbranch", bbranch); P1275(0x014, DEFINER, "b?branch", bqbranch); P1275(0x015, DEFINER, "b(loop)", bloop); P1275(0x016, DEFINER, "b(+loop)", bplusloop); P1275(0x017, DEFINER, "b(do)", bdo); P1275(0x018, DEFINER, "b(?do)", bqdo); P1275(0x01b, DEFINER, "b(leave)", bleave); P1275(0x01c, DEFINER, "b(of)", bof); P1275(0x087, 0, "fcode-revision", fcode_revision); P1275(0x08b, 0, "alloc-mem", alloc_mem); P1275(0x08c, 0, "free-mem", free_mem); P1275(0x0a4, 0, "-1", minus_one); P1275(0x0a5, 0, "0", zero); P1275(0x0a6, 0, "1", one); P1275(0x0a7, 0, "2", two); P1275(0x0a8, 0, "3", three); P1275(0x0ae, 0, "aligned", aligned); P1275(0x0b1, DEFINER, "b(<mark)", bmark); P1275(0x0b2, DEFINER, "b(>resolve)", bresolve); FCODE(0x0b3, 0, "set-token-table", fc_historical); FCODE(0x0b4, 0, "set-table", fc_historical); P1275(0x0b5, 0, "new-token", new_token); P1275(0x0b6, 0, "named-token", named_token); P1275(0x0b7, DEFINER, "b(:)", bcolon); P1275(0x0b8, DEFINER, "b(value)", bvalue); P1275(0x0b9, DEFINER, "b(variable)", bvariable); P1275(0x0ba, DEFINER, "b(constant)", bconstant); P1275(0x0bb, DEFINER, "b(create)", bcreate); P1275(0x0bc, DEFINER, "b(defer)", bdefer); P1275(0x0bd, 0, "b(buffer:)", bbuffer_colon); P1275(0x0be, 0, "b(field)", bfield); FCODE(0x0bf, 0, "b(code)", fc_historical); P1275(0x0c0, IMMEDIATE, "instance", instance); P1275(0x0c2, DEFINER, "b(;)", semi); P1275(0x0c3, DEFINER, "b(to)", bto); P1275(0x0c4, DEFINER, "b(case)", bcase); P1275(0x0c5, DEFINER, "b(endcase)", bendcase); P1275(0x0c6, DEFINER, "b(endof)", bendof); P1275(0x0ca, 0, "external-token", external_token); P1275(0x0cc, 0, "offset16", offset16); P1275(0x0cd, 0, "evaluate", evaluate); P1275(0x0da, 0, "get-token", get_token); P1275(0x0db, 0, "set-token", set_token); P1275(0x0f0, 0, "start0", start0); P1275(0x0f1, 0, "start1", start1); P1275(0x0f2, 0, "start2", start2); P1275(0x0f3, 0, "start4", start4); P1275(0x0fd, 0, "version1", version1); FCODE(0x0fe, 0, "4-byte-id", fc_historical); P1275(0x0ff, 0, "end1", end1); /* Call it "old-dma-alloc" so no one gets confused */ FCODE(0x101, 0, "old-dma-alloc", fc_historical); FCODE(0x104, 0, "memmap", fc_historical); FCODE(0x105, 0, "free-virtual", fc_unimplemented); FCODE(0x106, 0, ">physical", fc_historical); FCODE(0x10f, 0, "my-params", fc_historical); P1275(0x11b, 0, "parse-2int", parse_two_int); FCODE(0x122, 0, "memory-test-suite", fc_unimplemented); FCODE(0x123, 0, "group-code", fc_historical); FCODE(0x124, 0, "mask", fc_unimplemented); FCODE(0x130, 0, "map-low", fc_unimplemented); FCODE(0x131, 0, "sbus-intr>cpu", fc_unimplemented); FCODE(0x170, 0, "fb1-draw-character", fc_historical); FCODE(0x171, 0, "fb1-reset-screen", fc_historical); FCODE(0x172, 0, "fb1-toggle-cursor", fc_historical); FCODE(0x173, 0, "fb1-erase-screen", fc_historical); FCODE(0x174, 0, "fb1-blink-screen", fc_historical); FCODE(0x175, 0, "fb1-invert-screen", fc_historical); FCODE(0x176, 0, "fb1-insert-characters", fc_historical); FCODE(0x177, 0, "fb1-delete-characters", fc_historical); FCODE(0x178, 0, "fb1-insert-lines", fc_historical); FCODE(0x179, 0, "fb1-delete-lines", fc_historical); FCODE(0x17a, 0, "fb1-draw-logo", fc_historical); FCODE(0x17b, 0, "fb1-install", fc_historical); FCODE(0x17c, 0, "fb1-slide-up", fc_historical); FCODE(0x190, 0, "VME-bus Support", fc_obsolete); FCODE(0x191, 0, "VME-bus Support", fc_obsolete); FCODE(0x192, 0, "VME-bus Support", fc_obsolete); FCODE(0x193, 0, "VME-bus Support", fc_obsolete); FCODE(0x194, 0, "VME-bus Support", fc_obsolete); FCODE(0x195, 0, "VME-bus Support", fc_obsolete); FCODE(0x196, 0, "VME-bus Support", fc_obsolete); FCODE(0x1a0, 0, "return-buffer", fc_historical); FCODE(0x1a1, 0, "xmit-packet", fc_historical); FCODE(0x1a2, 0, "poll-packet", fc_historical); FCODE(0x210, 0, "processor-type", fc_historical); FCODE(0x211, 0, "firmware-version", fc_historical); FCODE(0x212, 0, "fcode-version", fc_historical); FCODE(0x214, 0, "(is-user-word)", is_user_word); FCODE(0x215, 0, "suspend-fcode", fc_unimplemented); FCODE(0x229, 0, "adr-mask", fc_historical); FCODE(0x238, 0, "probe", fc_historical); FCODE(0x239, 0, "probe-virtual", fc_historical); P1275(0x23e, 0, "byte-load", byte_load); P1275(0x240, 0, "left-parse-string", left_parse_string); FORTH(0, "fcode-buffer", fcode_buffer_addr); }
static void _init(void) { fcode_env_t *env = initial_env; ASSERT(env); ASSERT(env->current_device); NOTICE; create_int_prop(env, "#address-cells", 2); FORTH(0, "map-in", do_map_in); FORTH(0, "map-out", do_map_out); FORTH(0, "get-portid", do_get_io_portid); FORTH(0, "decode-unit", do_decode_unit); FORTH(0, "encode-unit", do_encode_unit); FORTH(0, "device-id", do_device_id); FORTH(0, "get-hwd-va", do_get_hwd_va); FORTH(0, "get-fcinterp-name", do_get_intrp_name); FORTH(0, "master-interrupt", do_master_interrupt); FORTH(0, "register-vector-entry", do_register_vector_entry); FORTH(0, "get-interrupt-target", do_get_interrupt_target); }