Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 1ea9c7cee8
Fetching contributors…

Cannot retrieve contributors at this time

file 98 lines (82 sloc) 1.784 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
/* f/wire.c
**
** This file is in the public domain.
*/
#include "all.h"

/* u2_wr_init():
**
** Install an empty wire within `hat_r` and `mat_r` in the loom,
** with memory model `hip`.
**
** Returns ray to wire, which always equalls the passed `mat_r`.
*/
u2_ray
u2_wr_init(c3_m hip_m,
           u2_ray hat_r,
           u2_ray mat_r)
{
  u2_ray wir_r;

  wir_r = u2_rl_init(hip_m, hat_r, mat_r);
  u2_rail_hat_r(wir_r) += (c3_wiseof(u2_loom_wire) - c3_wiseof(u2_loom_rail));

  u2_wire_bas_r(wir_r) = 0;
  u2_wire_kit_r(wir_r) = 0;

  u2_cs_init(u2_wire_des_r(wir_r));

  /* Trace stack.
*/
  {
    u2_wire_tax(wir_r) = u2_nul;
  }

#if 1
  /* Central memoization basket = 1/4 of address space.
*/
  {
    c3_w tip_w = (c3_wiseof(u2_loom_bask) - c3_wiseof(u2_loom_rail));
    u2_ray bas_r;

    bas_r = u2_rl_leap_part(wir_r, c3__sand, 1, 4, tip_w);
    u2_wire_bas_r(wir_r) = bas_r;
    u2_ba_init(wir_r, 0);
  }
#endif

#if 1
  /* Host control.
*/
  {
    u2_ho_push();
  }
#endif

  /* Basic performance tracking.
*/
  {
    u2_wire_bex_r(wir_r) = u2_rl_ralloc(wir_r, c3_wiseof(u2_loom_benx));

    u2_bx_boot(wir_r);
  }

  return wir_r;
}

        /* u2_wr_save():
**
** Save reactor noun to basket.
*/
          u2_noun
          u2_wr_save(u2_ray wir_r);

        /* u2_wr_nuke():
**
** Reinitialize the reactor partition.
*/
          u2_noun
          u2_wr_nuke(u2_ray wir_r);

/* u2_wr_ice(): u2_rl_ice(), with u2_bx_copy().
*/
u2_weak
u2_wr_ice(u2_ray wir_r,
          u2_noun fiz)
{
  u2_ray hat_r = u2_rail_hat_r(wir_r);
  u2_noun buz;
  c3_w cop_w;

  buz = u2_rl_ice(wir_r, fiz);

  cop_w = u2_rail_hat_r(wir_r) - hat_r;
  if ( cop_w ) {
    u2_bx_copy(wir_r, cop_w);
  }
  return buz;
}
Something went wrong with that request. Please try again.