X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Flttv%2Fstate.h;h=c3bdf1385624b3235027f97c2b4f69cbf999e408;hb=67f729732d629426de5a04965a81f6f0848af053;hp=79b1f2f0393abde35fc38a1a3ce5b8f4668c6e04;hpb=1a9bb5b818e843c35c6dd222342f0af30668b3cb;p=lttv.git diff --git a/ltt/branches/poly/lttv/lttv/state.h b/ltt/branches/poly/lttv/lttv/state.h index 79b1f2f0..c3bdf138 100644 --- a/ltt/branches/poly/lttv/lttv/state.h +++ b/ltt/branches/poly/lttv/lttv/state.h @@ -411,6 +411,11 @@ static inline guint lttv_state_get_target_pid(LttvTracefileState *tfs) #define HDR_QUARKS 9 #define HDR_QUARK 10 -#define MKDEV(ma,mi) ((ma)<<8 | (mi)) +/* Device number manipulation macros from kernel source */ +#define MINORBITS 20 +#define MINORMASK ((1U << MINORBITS) - 1) +#define MAJOR(dev) ((unsigned int) ((dev) >> MINORBITS)) +#define MINOR(dev) ((unsigned int) ((dev) & MINORMASK)) +#define MKDEV(ma,mi) (((ma) << MINORBITS) | (mi)) #endif // STATE_H