Add AKAROS_TOOLCHAINS (XCC)
[akaros.git] / kern / include / cpu_feat.h
1 /* Copyright (c) 2016 Google Inc.
2  * Barret Rhoden <brho@cs.berkeley.edu>
3  * See LICENSE for details.
4  *
5  * Set and query the existence of cpu features.
6  *
7  * Note that I didn't provide a "cpu_clr_feat()" yet.  These are intended to be
8  * write-once, read-many. */
9
10 #pragma once
11
12 #include <ros/procinfo.h>
13 #include <bitops.h>
14
15 static inline bool cpu_has_feat(int feature)
16 {
17         return test_bit(feature, __proc_global_info.cpu_feats);
18 }
19
20 static inline void cpu_set_feat(int feature)
21 {
22         __set_bit(feature, __proc_global_info.cpu_feats);
23 }