mirror of
https://github.com/urbit/shrub.git
synced 2024-12-24 11:24:21 +03:00
vere: adds args to set mars/urth looms by binary exponent
This commit is contained in:
parent
7ae6005f87
commit
12a7fae0b5
@ -166,6 +166,9 @@ _main_init(void)
|
||||
u3_Host.ops_u.puf_c = "jam";
|
||||
u3_Host.ops_u.hap_w = 50000;
|
||||
u3_Host.ops_u.kno_w = DefaultKernel;
|
||||
|
||||
u3_Host.ops_u.lut_y = u3a_bits + 2;
|
||||
u3_Host.ops_u.lom_y = u3a_bits + 2;
|
||||
}
|
||||
|
||||
/* _main_pier_run(): get pier from binary path (argv[0]), if appropriate
|
||||
@ -218,6 +221,7 @@ _main_getopt(c3_i argc, c3_c** argv)
|
||||
{ "json-trace", no_argument, NULL, 'j' },
|
||||
{ "kernel-stage", required_argument, NULL, 'K' },
|
||||
{ "key-file", required_argument, NULL, 'k' },
|
||||
{ "loom", required_argument, NULL, c3__loom },
|
||||
{ "local", no_argument, NULL, 'L' },
|
||||
{ "lite-boot", no_argument, NULL, 'l' },
|
||||
{ "replay-to", required_argument, NULL, 'n' },
|
||||
@ -240,6 +244,9 @@ _main_getopt(c3_i argc, c3_c** argv)
|
||||
{ "exit", no_argument, NULL, 'x' },
|
||||
{ "scry-into", required_argument, NULL, 'Y' },
|
||||
{ "scry-format", required_argument, NULL, 'Z' },
|
||||
//
|
||||
{ "urth-loom", required_argument, NULL, 5 },
|
||||
//
|
||||
{ NULL, 0, NULL, 0 },
|
||||
};
|
||||
|
||||
@ -248,6 +255,17 @@ _main_getopt(c3_i argc, c3_c** argv)
|
||||
lop_u, &lid_i)) )
|
||||
{
|
||||
switch ( ch_i ) {
|
||||
case 5: { // urth-loom
|
||||
c3_w lut_w;
|
||||
c3_o res_o = _main_readw(optarg, u3a_bits + 3, &lut_w);
|
||||
if ( (c3n == res_o) || (lut_w < 20) ) {
|
||||
fprintf(stderr, "error: --urth-loom must be >= 20 and <= %u\r\n", u3a_bits + 2);
|
||||
return c3n;
|
||||
}
|
||||
|
||||
u3_Host.ops_u.lut_y = lut_w;
|
||||
break;
|
||||
}
|
||||
case 'X': {
|
||||
u3_Host.ops_u.pek_c = strdup(optarg);
|
||||
break;
|
||||
@ -348,6 +366,16 @@ _main_getopt(c3_i argc, c3_c** argv)
|
||||
} else u3_Host.ops_u.pes_s = arg_w;
|
||||
break;
|
||||
}
|
||||
case c3__loom: {
|
||||
c3_w lom_w;
|
||||
c3_o res_o = _main_readw(optarg, u3a_bits + 3, &lom_w);
|
||||
if ( (c3n == res_o) || (lom_w < 20) ) {
|
||||
fprintf(stderr, "error: --loom must be >= 20 and <= %u\r\n", u3a_bits + 2);
|
||||
return c3n;
|
||||
}
|
||||
u3_Host.ops_u.lom_y = lom_w;
|
||||
break;
|
||||
}
|
||||
case c3__noco: {
|
||||
u3_Host.ops_u.con = c3n;
|
||||
break;
|
||||
@ -662,6 +690,7 @@ u3_ve_usage(c3_i argc, c3_c** argv)
|
||||
"-K, --kernel-stage STAGE Start at Hoon kernel version stage\n",
|
||||
"-k, --key-file KEYS Private key file (see also -G)\n",
|
||||
"-L, --local Local networking only\n",
|
||||
" --loom Set loom to binary exponent (31 == 2GB)\n"
|
||||
"-l, --lite-boot Most-minimal startup\n",
|
||||
"-n, --replay-to NUMBER Replay up to event\n",
|
||||
"-P, --profile Profiling\n",
|
||||
@ -999,9 +1028,9 @@ static void
|
||||
_cw_serf_commence(c3_i argc, c3_c* argv[])
|
||||
{
|
||||
#ifdef U3_OS_mingw
|
||||
if ( 8 > argc ) {
|
||||
if ( 9 > argc ) {
|
||||
#else
|
||||
if ( 7 > argc ) {
|
||||
if ( 8 > argc ) {
|
||||
#endif
|
||||
fprintf(stderr, "serf: missing args\n");
|
||||
exit(1);
|
||||
@ -1013,9 +1042,11 @@ _cw_serf_commence(c3_i argc, c3_c* argv[])
|
||||
c3_c* key_c = argv[3]; // XX use passkey
|
||||
c3_c* wag_c = argv[4];
|
||||
c3_c* hap_c = argv[5];
|
||||
c3_c* eve_c = argv[6];
|
||||
c3_c* lom_c = argv[6];
|
||||
c3_w lom_w;
|
||||
c3_c* eve_c = argv[7];
|
||||
#ifdef U3_OS_mingw
|
||||
c3_c* han_c = argv[7];
|
||||
c3_c* han_c = argv[8];
|
||||
_cw_intr_win(han_c);
|
||||
#endif
|
||||
|
||||
@ -1041,6 +1072,7 @@ _cw_serf_commence(c3_i argc, c3_c* argv[])
|
||||
{
|
||||
sscanf(wag_c, "%" SCNu32, &u3C.wag_w);
|
||||
sscanf(hap_c, "%" SCNu32, &u3_Host.ops_u.hap_w);
|
||||
sscanf(lom_c, "%" SCNu32, &lom_w);
|
||||
|
||||
if ( 1 != sscanf(eve_c, "%" PRIu64, &eve_d) ) {
|
||||
fprintf(stderr, "serf: rock: invalid number '%s'\r\n", argv[4]);
|
||||
@ -1064,7 +1096,7 @@ _cw_serf_commence(c3_i argc, c3_c* argv[])
|
||||
//
|
||||
{
|
||||
u3V.dir_c = strdup(dir_c);
|
||||
u3V.sen_d = u3V.dun_d = u3m_boot(dir_c, u3a_bytes);
|
||||
u3V.sen_d = u3V.dun_d = u3m_boot(dir_c, (size_t)1 << lom_w);
|
||||
|
||||
if ( eve_d ) {
|
||||
// XX need not be fatal, need a u3m_reboot equivalent
|
||||
@ -1746,8 +1778,10 @@ _cw_utils(c3_i argc, c3_c* argv[])
|
||||
// [?(%vere %fetch-vere) dir=@t] :: download vere
|
||||
// [%vile dir=@t] :: extract keys
|
||||
// :: :: ipc:
|
||||
// [%serf dir=@t key=@t wag=@t hap=@ud eve=@ud] :: compute
|
||||
// ==
|
||||
// $: %serf :: compute
|
||||
// dir=@t key=@t wag=@t hap=@ud ::
|
||||
// lom=@ud eve=@ud ::
|
||||
// == == ::
|
||||
//
|
||||
// NB: don't print to anything other than stderr;
|
||||
// other streams may be used for ipc.
|
||||
@ -1974,7 +2008,7 @@ main(c3_i argc,
|
||||
// starting u3m configures OpenSSL memory functions, so we must do it
|
||||
// before any OpenSSL allocations
|
||||
//
|
||||
u3m_boot_lite(u3a_bytes);
|
||||
u3m_boot_lite((size_t)1 << u3_Host.ops_u.lut_y);
|
||||
|
||||
// Initialize OpenSSL for client and server
|
||||
//
|
||||
|
@ -699,6 +699,7 @@
|
||||
# define c3__lond c3_s4('l','o','n','d')
|
||||
# define c3__lonk c3_s4('l','o','n','k')
|
||||
# define c3__look c3_s4('l','o','o','k')
|
||||
# define c3__loom c3_s4('l','o','o','m')
|
||||
# define c3__loop c3_s4('l','o','o','p')
|
||||
# define c3__lorb c3_s4('l','o','r','b')
|
||||
# define c3__lord c3_s4('l','o','r','d')
|
||||
|
@ -291,6 +291,8 @@
|
||||
c3_c* key_c; // -k, private key file
|
||||
c3_o net; // -L, local-only networking
|
||||
c3_o lit; // -l, lite mode
|
||||
c3_y lom_y; // loom bex
|
||||
c3_y lut_y; // urth-loom bex
|
||||
c3_c* til_c; // -n, play till eve_d
|
||||
c3_o pro; // -P, profile
|
||||
c3_s per_s; // http port
|
||||
|
@ -1157,11 +1157,12 @@ u3_lord_init(c3_c* pax_c, c3_w wag_w, c3_d key_d[4], u3_lord_cb cb_u)
|
||||
// spawn new process and connect to it
|
||||
//
|
||||
{
|
||||
c3_c* arg_c[8];
|
||||
c3_c* arg_c[10];
|
||||
c3_c key_c[256];
|
||||
c3_c wag_c[11];
|
||||
c3_c hap_c[11];
|
||||
c3_c cev_c[11];
|
||||
c3_c lom_c[11];
|
||||
c3_i err_i;
|
||||
|
||||
sprintf(key_c, "%" PRIx64 ":%" PRIx64 ":%" PRIx64 ":%" PRIx64 "",
|
||||
@ -1174,30 +1175,34 @@ u3_lord_init(c3_c* pax_c, c3_w wag_w, c3_d key_d[4], u3_lord_cb cb_u)
|
||||
|
||||
sprintf(hap_c, "%u", u3_Host.ops_u.hap_w);
|
||||
|
||||
sprintf(lom_c, "%u", u3_Host.ops_u.lom_y);
|
||||
|
||||
arg_c[0] = god_u->bin_c; // executable
|
||||
arg_c[1] = "serf"; // protocol
|
||||
arg_c[2] = god_u->pax_c; // path to checkpoint directory
|
||||
arg_c[3] = key_c; // disk key
|
||||
arg_c[4] = wag_c; // runtime config
|
||||
arg_c[5] = hap_c; // hash table size
|
||||
arg_c[6] = lom_c; // loom bex
|
||||
|
||||
if ( u3_Host.ops_u.roc_c ) {
|
||||
// XX validate
|
||||
//
|
||||
arg_c[6] = u3_Host.ops_u.roc_c;
|
||||
arg_c[7] = u3_Host.ops_u.roc_c;
|
||||
}
|
||||
else {
|
||||
arg_c[6] = "0";
|
||||
arg_c[7] = "0";
|
||||
}
|
||||
|
||||
#ifdef U3_OS_mingw
|
||||
sprintf(cev_c, "%" PRIu64, u3_Host.cev_u);
|
||||
arg_c[7] = cev_c;
|
||||
arg_c[8] = 0;
|
||||
arg_c[8] = cev_c;
|
||||
#else
|
||||
arg_c[7] = 0;
|
||||
arg_c[8] = 0;
|
||||
#endif
|
||||
|
||||
arg_c[9] = 0;
|
||||
|
||||
uv_pipe_init(u3L, &god_u->inn_u.pyp_u, 0);
|
||||
uv_timer_init(u3L, &god_u->out_u.tim_u);
|
||||
uv_pipe_init(u3L, &god_u->out_u.pyp_u, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user