|
From: | Kang Tin LAI |
Subject: | [avr-gcc-list] avr-gcc runtime lib, avr-libc, and multi-thread |
Date: | Mon, 19 Jan 2004 22:44:41 +0800 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 |
Hi,I want to switch to the lib functions in avr-libc from my own, since malloc in avr-libc, for example, is better than mine, and other such as stdio functions are here and ready for use. But the avr-libc is lake of common resource locking facility.
In avr-libc: #define MALLOC 123 void *malloc(size_t n){ lock(MALLOC); /* add a common resource access control */ /* do malloc */ unlock(MALLOC); /* add a common resource access control */ return p; }In simple kernel, lock() and unlock() may be just a simple interrupt disable and enable operation, for sophisticate kernel, it may be a spin lock and spin unlock mechanism. Whatever, keep the changes as little as possible, any comment?
For avr-gcc runtime lib, is there any special or need to take care for multi-tasking? I use avr-gcc for compiling my kernel since day one and found nothing wrong, so avr-gcc runtime should be re-enter-able and multi-thread safe, is it?
-- --- Kang Tin LAI <address@hidden> -----
[Prev in Thread] | Current Thread | [Next in Thread] |