コード例 #1
0
ファイル: memalloc.c プロジェクト: NanXiao/illumos-joyent
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);
}
コード例 #2
0
ファイル: init.c プロジェクト: NanXiao/illumos-joyent
static void
_init(void)
{
	int i;
	acf_t f_error_addr;
	fcode_env_t *env;

	NOTICE;

	fcode_impl_count = 0;
	env = MALLOC(sizeof (fcode_env_t));
	env->table = MALLOC((MAX_FCODE + 1) * sizeof (fcode_token));
	env->base = MALLOC(dict_size);
	env->here = env->base;
	env->ds = env->ds0 = MALLOC(stack_size * sizeof (fstack_t));
	env->rs = env->rs0 = MALLOC(stack_size * sizeof (fstack_t));
	env->order = MALLOC(MAX_ORDER * sizeof (token_t));
	env->input = MALLOC(sizeof (input_typ));
	env->num_base = 0x10;

	/* Setup the initial forth environment */
	do_forth(env);
	do_definitions(env);
	install_handlers(env);

	initial_env = env;

	/*
	 * Need to define this early because it is the default for
	 * all unimpl, FCODE functions
	 */
	P1275(0x0fc, IMMEDIATE,	"ferror",		f_error);
	f_error_addr = LINK_TO_ACF(env->lastlink);
	for (i = 0; i <= MAX_FCODE; i++) {
		DEBUGF(ANY, env->table[i].usage = 0);
		SET_TOKEN(i, IMMEDIATE, "ferror", f_error_addr);
	}
	fcode_impl_count = 0;
}
コード例 #3
0
ファイル: fcode.c プロジェクト: andreiw/polaris
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);
}
コード例 #4
0
ファイル: misc.c プロジェクト: mikess/illumos-gate
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);
}