division operation
"Edgar A. Leon" <[email protected]>
| Newsgroups | gmane.network.myrinet.general |
|---|---|
| Message-ID | <[email protected]> |
Considering that there's no division in the LANai instruction set, I
find interesting that in the file gmcp.c, part of the mcp code uses
divisions. Anybody knows why is that?
In particular, here's part of the code:
static inline void
gm_ethernet_addr_table_set (unsigned int node_id, gm_u8_t *addr)
{
gm_dp_t entry_logical_addr;
gm_dp_t piece;
/* compute logical address of addr table entry, aborting if not possible. */
piece = gm.ethernet.addr_table_piece[node_id / (GM_PAGE_LEN / 8)];
/* Catch case where MCP supports ethernet, but host does not */
if (!piece)
return;
entry_logical_addr = piece + 8 * (node_id % (GM_PAGE_LEN / 8));
/* Copy the ethernet address to a known 8-byte aligned buffer with
the last two bytes cleared. */
ether_addr_copy (addr, gm.ethernet.addr_stage);
gm.ethernet.addr_stage[6] = gm.ethernet.addr_stage[7] = 0;
/* wait for DMA engine to be free */
await_free_DMA_engine ();
/* DMA the address to the host. */
start_RDMA (&gm.ethernet.addr_stage,
entry_logical_addr,
8);
}
Any comments are appreciated.
Thanks.
--
Edgar A. León
(:)-) likes to scuba dive