summaryrefslogtreecommitdiff
path: root/core/thread/start_thread.c
Commit message (Collapse)AuthorAgeFilesLines
* thread: Add magic number, debugging code, min stack sizeH. Peter Anvin2012-03-301-1/+8
| | | | | | | | | | | Add a magic number to the thread control block; this helps check for memory overwrites. Add dprintf()s to the scheduler. Force a minimum stack size. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* thread: make kill_thread() actually do its jobH. Peter Anvin2011-04-271-10/+0
| | | | | | | kill_thread() had been modifying errno(!) as if it had been the return value... in other words, it really did absolutely nothing. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* thread: free(NULL) is safe, lmalloc() always return para-alignedH. Peter Anvin2011-04-221-1/+1
| | | | | | | | | | free(NULL) is safe and permitted, no reason to conditionalize calling free(). lmalloc() will always return a paragraph-aligned memory block, so we don't have to play games with the offset. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* thread: thread-switch the real-mode stack, tooH. Peter Anvin2011-04-211-3/+16
| | | | | | | | | | | | When this code was originally written, we didn't have lmalloc(). Now when lmalloc() is implemented, let each real-mode task have its own stack. Note that this means we absolutely have to continue to support the SS != CS, DS model in the real-mode code, which should already be the case, but... Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* core thread: Make the code a little clearer.Eric W. Biederman2011-04-121-1/+1
| | | | Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
* core: thread: add a name fieldH. Peter Anvin2011-04-091-1/+2
| | | | | | Add a name field to struct thread, for debugging's sake. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
* core: thread: move most thread state to stack; task switch errnoH. Peter Anvin2011-04-091-8/+22
| | | | | | | Move most our thread state to the stack. Task switch the errno variable. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* core: thread: have start_thread() allocate memory dynamicallyH. Peter Anvin2011-04-081-3/+14
| | | | | | | | Have start_thread() allocate memory dynamically, using malloc(). XXX: should probably free that memory in __exit_thread()... could be "interesting". Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* core: simple thread libraryH. Peter Anvin2011-04-081-0/+33
Simple thread library with the intent of making lwIP easier to port. -- Modified to use milliseconds instead of jiffies, as lwIP expresses everything in milliseconds. EWB Signed-off-by: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>