Line data Source code
1 : #include "fd_event_report.h" 2 : 3 : static FD_TL fd_event_reporter_t fd_event_tl_storage[1]; 4 : 5 : fd_event_reporter_t * 6 : fd_event_reporter_join( fd_event_reporter_t * r, 7 : fd_topo_t const * topo, 8 0 : ulong link_id ) { 9 0 : fd_topo_link_t const * link = &topo->links[ link_id ]; 10 0 : FD_TEST( link->mcache ); 11 0 : FD_TEST( link->dcache ); 12 : 13 0 : r->mcache = link->mcache; 14 0 : r->depth = fd_mcache_depth( link->mcache ); 15 0 : r->seq = 0UL; 16 0 : r->seq_store = fd_mcache_seq_laddr( link->mcache ); 17 0 : r->mem = fd_wksp_containing( link->dcache ); 18 0 : FD_TEST( r->mem ); 19 0 : r->chunk0 = fd_dcache_compact_chunk0( r->mem, link->dcache ); 20 0 : r->wmark = fd_dcache_compact_wmark ( r->mem, link->dcache, link->mtu ); 21 0 : r->chunk = r->chunk0; 22 0 : r->mtu = link->mtu; 23 : 24 0 : r->sleep = NULL; 25 0 : r->link_id = link->id; 26 0 : r->wake_cnt = 0UL; 27 0 : if( FD_UNLIKELY( topo->sleep_obj_id!=ULONG_MAX ) ) { 28 0 : r->sleep = fd_sleep_join( fd_topo_obj_laddr( topo, topo->sleep_obj_id ) ); 29 0 : FD_TEST( r->sleep ); 30 0 : r->wake_cnt = fd_sleep_wake_table( r->wake, topo, link->id ); 31 0 : } 32 0 : return r; 33 0 : } 34 : 35 : void 36 : fd_event_register( fd_topo_t const * topo, 37 0 : fd_topo_tile_t const * tile ) { 38 0 : fd_event_tl = NULL; 39 : 40 0 : if( FD_LIKELY( tile->event_link_id==ULONG_MAX ) ) return; /* no event link */ 41 : 42 0 : fd_event_tl = fd_event_reporter_join( fd_event_tl_storage, topo, tile->event_link_id ); 43 0 : }