X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=src%2Fcommon.h;h=a06dab21eb16ffc9a5a5ba8aad3304dcda457cb2;hb=0c272342a9bd9f15d2ea4bf003409fbd83c96c30;hp=d4d86c60d737da55c3a8bd632b9189c37102ecc8;hpb=87cb8e1dbc1d3e6e726944392fa52ae852746e82;p=satune.git diff --git a/src/common.h b/src/common.h index d4d86c6..a06dab2 100644 --- a/src/common.h +++ b/src/common.h @@ -17,6 +17,7 @@ #include #include "config.h" +/* extern int model_out; extern int model_err; extern int switch_alloc; @@ -27,7 +28,12 @@ extern int switch_alloc; #define model_print_err(fmt, ...) do { model_dprintf(model_err, fmt, ## __VA_ARGS__); } while (0) +*/ +#define model_print printf + +#define NEXTPOW2(x) ((x==1) ? 1 : (1<<(sizeof(uint)*8-__builtin_clz(x-1)))) +#define NUMBITS(x) ((x==0) ? 0 : 8*sizeof(x)-__builtin_clz(x)) #ifdef CONFIG_DEBUG #define DEBUG(fmt, ...) do { model_print("*** %15s:%-4d %25s() *** " fmt, __FILE__, __LINE__, __func__, ## __VA_ARGS__); } while (0)