Beispiel #1
0
void ndmda_fh_flush(struct ndm_session* sess)
{
  struct ndm_data_agent* da = sess->data_acb;
  struct ndmfhheap* fhh = &da->fhh;
  int rc;
  int fhtype;
  void* table;
  unsigned n_entry;

  rc = ndmfhh_get_table(fhh, &fhtype, &table, &n_entry);
  if (rc == NDMFHH_RET_OK && n_entry > 0) {
    struct ndmp_xa_buf xa;
    struct ndmfhh_generic_table* request;

    request = (void*)&xa.request.body;
    NDMOS_MACRO_ZEROFILL(&xa);

    xa.request.protocol_version = fhtype >> 16;
    xa.request.header.message = fhtype & 0xFFFF;

    request->table_len = n_entry;
    request->table_val = table;

    ndma_send_to_control(sess, &xa, sess->plumb.data);
  }

  ndmfhh_reset(fhh);
}
Beispiel #2
0
int
ndmfhh_commission (struct ndmfhheap *fhh, void *heap, unsigned size)
{
	fhh->heap_base = heap;
	fhh->heap_size = size;
	fhh->heap_end = (char*)heap + size;

	/* Align everything */
	fhh->heap_top = (void*) (((long)heap + (NDMOS_CONST_ALIGN-1))
						&~ (NDMOS_CONST_ALIGN-1));
	fhh->heap_bot = (void*)
		((long)((char*)heap+size) &~ (NDMOS_CONST_ALIGN-1));

	ndmfhh_reset (fhh);

	return NDMFHH_RET_OK;
}