mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
added function to get system cache line size
This commit is contained in:
parent
90ae32058a
commit
ac61a8498e
2 changed files with 7 additions and 0 deletions
|
@ -48,4 +48,7 @@ int kernel_module_load(const char *module);
|
|||
/** Set parameter of loaded kernel module */
|
||||
int kernel_module_set_param(const char *module, const char *param, const char *value);
|
||||
|
||||
/** Get cacheline size in bytes */
|
||||
int kernel_get_cacheline_size();
|
||||
|
||||
#endif /* _LINUX_H_ */
|
||||
|
|
|
@ -123,4 +123,8 @@ int kernel_has_cmdline(const char *substr)
|
|||
return -1;
|
||||
|
||||
return strstr(cmd, substr) ? 0 : -1;
|
||||
}
|
||||
int kernel_get_cacheline_size()
|
||||
{
|
||||
return sysconf(_SC_LEVEL1_ICACHE_LINESIZE);
|
||||
}
|
Loading…
Add table
Reference in a new issue