NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

re: port-arm/50563: pool allocator corruption due to __MUTEX_PRIVATE

On Dec 16,  8:34pm, (matthew green) wrote:
-- Subject: re: port-arm/50563: pool allocator corruption due to __MUTEX_PRIV

| > Yes, if the types of ipl_cookie_t or __cpu_simple_lock_t are not defined
| > to be 8 bits. Is that the case? We should add a:
| > 
| > CTASSERT(sizeof(uintptr_t) == sizeof(struct kmutex));
| > 
| > in the header file to enforce that.
| that doesn't seem sane to me.  or even valid.  alpha has a uint32 and
| a uintprt_t.
| struct kmutex is MD-defined.  i don't know of a good way to check
| this without a helper.  we have to compile machine/mutex.h with and
| without __MUTEX_PRIVATE defined, and compare their sizes.  it seems
| way to ugly to try to do this in a single C file (you'd have to
| #undef all the sys/arch/foo/include/mutex.h's #ifdef _FOO_MUTEX_H,
| but it would work i think...)

That CTASSERT goes in the MD file.


Home | Main Index | Thread Index | Old Index