This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
kernel tests memvar1 and kmemvar1
- To: ecos-discuss at sourceware dot cygnus dot com
- Subject: [ECOS] kernel tests memvar1 and kmemvar1
- From: Chris Morrow <cmorrow at YottaYotta dot com>
- Date: Wed, 08 Nov 2000 15:17:48 -0700
- Organization: YottaYotta Inc.
- References: <B1F6452C89AFD411AE0800A0CC734C23014FFD@EMAIL1>
Both of the kernel tests memvar1 and kmemvar1 have a routine
static void check_in_mp0(cyg_uint8 *p, cyg_int32 size)
{
CYG_TEST_CHECK(NULL != p,
"Allocation failed");
CYG_TEST_CHECK(mem[0] <= p && p+size < mem[1],
"Block outside memory pool");
}
I believe the second test should be
CYG_TEST_CHECK(mem[0] <= p && p+size <= mem[1],
"Block outside memory pool");
The upper bound should allow the equal case, or
perhaps even better
CYG_TEST_CHECK(mem[0] <= p && p[size - 1] < mem[1],
"Block outside memory pool");
--
Chris Morrow YottaYotta Inc.
email: cmorrow@yottayotta.com
phone: (780) 439 9000 ext 227
web: http://www.yottayotta.com