Ruby: expose a simple mod function in slicc interface.

This commit is contained in:
Lisa Hsu 2011-03-17 17:01:41 -07:00
parent 3a44307e94
commit 556b5c5488
2 changed files with 7 additions and 1 deletions

View file

@ -55,4 +55,4 @@ bool distributedPersistentEnabled();
Address setOffset(Address addr, int offset); Address setOffset(Address addr, int offset);
Address makeLineAddress(Address addr); Address makeLineAddress(Address addr);
int addressOffset(Address addr); int addressOffset(Address addr);
int mod(int val, int mod);

View file

@ -182,4 +182,10 @@ addressOffset(Address addr)
return addr.getOffset(); return addr.getOffset();
} }
inline int
mod(int val, int mod)
{
return val % mod;
}
#endif // __MEM_RUBY_SLICC_INTERFACE_RUBYSLICCUTIL_HH__ #endif // __MEM_RUBY_SLICC_INTERFACE_RUBYSLICCUTIL_HH__