Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/systm.h
Show First 20 Lines • Show All 150 Lines • ▼ Show 20 Lines | |||||
} while (0) | } while (0) | ||||
#else /* !INVARIANTS && !_STANDALONE */ | #else /* !INVARIANTS && !_STANDALONE */ | ||||
#define KASSERT(exp,msg) do { \ | #define KASSERT(exp,msg) do { \ | ||||
} while (0) | } while (0) | ||||
#endif /* INVARIANTS || _STANDALONE */ | #endif /* INVARIANTS || _STANDALONE */ | ||||
/* | /* | ||||
* Helpful macros for quickly coming up with assertions with informative | * Helpful macros for quickly coming up with assertions with informative | ||||
* panic messages. | * panic messages. | ||||
kib: Are there uses for 'x' or is x always CACHE_LINE_SIZE, for practical purposes ? | |||||
*/ | */ | ||||
#define MPASS(ex) MPASS4(ex, #ex, __FILE__, __LINE__) | #define MPASS(ex) MPASS4(ex, #ex, __FILE__, __LINE__) | ||||
#define MPASS2(ex, what) MPASS4(ex, what, __FILE__, __LINE__) | #define MPASS2(ex, what) MPASS4(ex, what, __FILE__, __LINE__) | ||||
#define MPASS3(ex, file, line) MPASS4(ex, #ex, file, line) | #define MPASS3(ex, file, line) MPASS4(ex, #ex, file, line) | ||||
#define MPASS4(ex, what, file, line) \ | #define MPASS4(ex, what, file, line) \ | ||||
KASSERT((ex), ("Assertion %s failed at %s:%d", what, file, line)) | KASSERT((ex), ("Assertion %s failed at %s:%d", what, file, line)) | ||||
/* | /* | ||||
* Align variables. | * Align variables. | ||||
*/ | */ | ||||
#define __read_mostly __section(".data.read_mostly") | #define __read_mostly __section(".data.read_mostly") | ||||
#define __read_frequently __section(".data.read_frequently") | #define __read_frequently __section(".data.read_frequently") | ||||
#define __exclusive_cache_line __aligned(CACHE_LINE_SIZE) \ | #define __exclusive_cache_line __aligned_if_not_compact(CACHE_LINE_SIZE) \ | ||||
__section(".data.exclusive_cache_line") | __section(".data.exclusive_cache_line") | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
#include <sys/param.h> /* MAXCPU */ | #include <sys/param.h> /* MAXCPU */ | ||||
#include <sys/pcpu.h> /* curthread */ | #include <sys/pcpu.h> /* curthread */ | ||||
#include <sys/kpilite.h> | #include <sys/kpilite.h> | ||||
/* | /* | ||||
* Assert that a pointer can be loaded from memory atomically. | * Assert that a pointer can be loaded from memory atomically. | ||||
▲ Show 20 Lines • Show All 456 Lines • Show Last 20 Lines |
Are there uses for 'x' or is x always CACHE_LINE_SIZE, for practical purposes ?