Commit Graph

757 Commits

Author SHA1 Message Date
Bora Sahin
352cb2daaa The first step in creating a thread library.
The difference between this thread library and the existing ones like pthreads
is the necessity of informing the library about the address range of the stack
and the l4 specific utcb. Utcb has not been supported yet. As for stack, there
is also a drawback: library does not support mapping. In other words, the stack
area in question has to be already mapped-in. Thus, for now we only support
threads sharing their address spaces: TC_SHARE_SPACE. In this respect, it is
very similar to pthreads.
2009-11-05 13:50:48 +02:00
Bora Sahin
8585482bd0 THREAD_RESUME is an alias to THREAD_RUN. 2009-11-05 13:48:58 +02:00
Bora Sahin
ede050ad37 utcb handling helper routines for the thread library.
This is one of the steps we need in the process of providing a similar interface
for thread creation which can be found in the mainstream operating systems like
Linux.
2009-11-05 12:39:29 +02:00
Bora Sahin
4bfd339db5 libl4thread skeleton is introduced.
With this library, it is aimed at easing thread manipulation, utcb handling etc.
2009-11-05 12:37:19 +02:00
Bora Sahin
1f7711fa2a Automatic pager size calculation takes container name into account instead of
a fixed one.
2009-11-05 12:23:01 +02:00
Bora Sahin
050f537884 Bare container type is converted to Examples container type.
Examples container type is designed to keep applications using codezero
userspace libraries, which is aiming to help newcomers who would like to
develop programs on top of the l4 microkernel.

Now bare bone application is one of the examples. In the near future, lots of
new programs will be introduced to show the various aspects of codezero
eco-system.
2009-11-05 12:17:37 +02:00
Bahadir Balban
b7e575817d Merged setup of internal memory caps and container creation
The two had common data in their initialization so it only made
sense to merge the two.
2009-11-03 15:26:59 +02:00
Bahadir Balban
9248328dd3 Pager struct allocated from boot memory and never referenced after boot.
We still have to have the pager structs because they possess intermediate
data during boot up such as for transferring of capability lists to
boot stack one-by-one, and then to newly generated ktcbs.
2009-11-03 15:09:28 +02:00
Bahadir Balban
6c69f181db First step in detaching pager struct from tasks 2009-11-03 14:50:22 +02:00
Bahadir Balban
00a9f2e3c9 Linux example file with no MAPSIZE parameter 2009-11-03 13:38:55 +02:00
Bahadir Balban
606fe7f369 toolchain option is made clearer in cml menu 2009-11-03 11:54:36 +02:00
Bahadir Balban
a303445cf7 cml examples updated to have no PAGER_SIZE parameter 2009-11-03 11:32:37 +02:00
Bahadir Balban
390358f8a3 configure.py shuts down gracefully if configfile is not saved 2009-11-03 11:04:30 +02:00
Amit Mahajan
966ef7714e Added pager size calculation for test container. 2009-11-03 13:05:05 +05:30
Amit Mahajan
3be4cbc45c Tested compilation of various platforms. 2009-11-03 12:10:16 +05:30
Amit Mahajan
6e898151bc configuration_retrieve pending work done 2009-11-03 11:13:51 +05:30
Amit Mahajan
03b2751377 Asking user for type of toolchain to be used 2009-11-03 03:02:27 +05:30
Amit Mahajan
2b1adb059d Pager Mapsize updated in cinfo template only instead of cinfo.c 2009-11-03 01:34:51 +05:30
Amit Mahajan
a41a8e0d93 Some cleanup in uart fixes. 2009-11-02 21:52:33 +05:30
Amit Mahajan
55eb6260c3 Dynamic generation of pager size 2009-11-02 21:31:08 +05:30
Amit Mahajan
8d9f5f82d0 Patch for comments by bahadir 2009-11-02 21:31:07 +05:30
Amit Mahajan
52d346af40 Added function to extract cputype, this function was earlier rewritten
in build_linux
2009-11-02 21:31:07 +05:30
Amit Mahajan
f337257e4e Corrected the problem of wrong values in printascii.S 2009-11-02 21:31:07 +05:30
Amit Mahajan
9463d1f241 Changed the name of PAGER_SIZE symbol to PAGER_MAPSIZE, to keep in
harmony with linux symbol name
2009-11-02 21:29:55 +05:30
Amit Mahajan
d41cac75d1 Added offsets for MPCORE, EB and CORTEX-A8 2009-11-02 21:29:55 +05:30
Amit Mahajan
e120e7c552 Selecting UART0 base address based on platform selected 2009-11-02 21:29:55 +05:30
Amit Mahajan
a81574b899 Cleaning loader libc and uart 2009-11-02 21:29:55 +05:30
Amit Mahajan
b8829118e0 Cleaned the libc uart driver 2009-11-02 21:29:55 +05:30
Amit Mahajan
5b3d11ed55 Removed Unnecessary files from libc 2009-11-02 21:29:55 +05:30
Amit Mahajan
532b65fbd9 Added dependency on config.h, for src/ folders 2009-11-02 21:29:55 +05:30
Amit Mahajan
91c617d0b2 Removed hard coded values of toolchain and gcc cpu flags 2009-11-02 21:29:54 +05:30
Amit Mahajan
2b29170633 Added the default parameters needed by arm linux 2009-11-02 21:15:40 +05:30
Amit Mahajan
e9dba944e6 Pl011 uart driver made generic 2009-11-02 21:15:40 +05:30
Amit Mahajan
8a586860b3 Cleaned the timer driver to make it generic. 2009-11-02 21:15:40 +05:30
Amit Mahajan
24cbc8d441 Removed Driver Menu from main screen and made driver symbols derived 2009-11-02 21:15:40 +05:30
Amit Mahajan
dc57472538 Correcting the symbol pattern for finding start/end of various physical
regions in use by various containers
2009-11-02 21:15:40 +05:30
Bahadir Balban
5992b6435c Added a forgotten unlock on an error condition 2009-11-01 15:22:36 +02:00
Bahadir Balban
83a740f597 A better locking scheme for address spaces.
Same shall be done for the tcb list.
2009-11-01 14:32:55 +02:00
Bahadir Balban
003976e99e Comment formatting 2009-11-01 01:36:03 +02:00
Bahadir Balban
5fd0f12017 Added handling of task pending events from scheduler.
Previously all pending events were handled on return of exceptions
in process context. This was causing threads that run in userspace
and take no exceptions not handle their pending events indefinitely.
Now scheduler handles them in irq context as well.
2009-11-01 01:03:17 +02:00
Bahadir Balban
0f537ea1f5 Wait on working.
Multi-threaded apps can now wait on children to destroy.
WAIT_ON is useful when a child exists with an exit code and the pager
of the child does not want to take the hassle of destorying it via an
ipc. It provides an alternative method of synchronous thread destruction,
where the child destroys itself directly rather than the parent issuing
a destroy on it explicitly.
2009-10-31 23:28:54 +02:00
Bahadir Balban
850c645d77 Exiting tasks use EXITING signal and change states to TASK_DEAD 2009-10-31 23:13:19 +02:00
Bahadir Balban
5ed93b6563 Thread exiting
Pagers kill all children but suspend themselves.
Currently not straightforward for a pager to delete its own tcb and quit.
It should take all allocator locks without sleeping, remove itself from
scheduler queue and then delete itself and quit. This is not so easy now
as some allocation locks are mutexes. (Address space lock, ktcb/space
allocators etc.)

An easier approach would be to have a kernel thread or a superior thread
that would delete the pager
2009-10-31 22:46:29 +02:00
Bahadir Balban
c763679aaa Fixed a nasty spinlock issue with wake_up_all that didn't get caught. 2009-10-31 20:47:20 +02:00
Bahadir Balban
638df9e238 Simultaneous exit/thread_destroy working
Reiterating again to simplify:

Working:
 - Pager issues destroy, client also issues exit
   they work in sync.

Missing
 - Pager killing itself
 - Pager killing all children while killing itself
 - Pager waiting on children
2009-10-31 18:45:22 +02:00
Bahadir Balban
09197d1fb1 Removed THREAD_WAIT call completely.
Simply reverse this patch to add THREAD_WAIT
2009-10-31 17:12:03 +02:00
Bahadir Balban
dd5e05380c Typo fix 2009-10-31 16:39:13 +02:00
Bahadir Balban
53589ada01 Amendments to scheduler timeslice management 2009-10-31 15:25:29 +02:00
Bora Sahin
2571dabc18 Fixes to the scheduler timeslice management.
One is related to the time distribution when a new child is created.
If the parent has one tick left, then both child and parent received
zero tick. When combined with
	current_irq_nest_count = 1
	voluntary_preempt = 0
values, this caused the scheduler from being invoked.

Second is related to the overall time distribution. When a thread
runs out of time, its new time slice is calculated by the below
formula:
	new_timeslice = (thread_prio * SCHED_TICKS) / total_prio
If we consider total_prio is equal to the sum of the priorities of
all the threads in the system, it imposes a problem of getting
zero tick. In the new scenario, total_prio is equal to the priority
types in the system so it is fixed. Every thread gets a timeslice
in proportion of their priorities. Thus, there is no risk of taking
zero tick.
2009-10-31 15:08:53 +02:00
Bora Sahin
90cfaca7a2 libmem/lib{mm,mc,malloc} are added to the libraries of bare containers
againist which they are linked.
(cherry picked from commit 9d90ee4c57f07dbbe984251023fc3fa684dd492c)
2009-10-31 14:31:32 +02:00