aboutsummaryrefslogtreecommitdiffstats
path: root/extras/mini-os/sched.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix emacs local variable block to use correct C style variable.David Vrabel2013-02-211-1/+1
| | | | | | | The emacs variable to set the C style from a local variable block is c-file-style, not c-set-style. Signed-off-by: David Vrabel <david.vrabel@citrix.com
* mini-os: use BSD sys/queue.h instead of Linux list.hIan Campbell2012-01-311-24/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The latter is GPL which makes the whole of mini-os GPL rather than BSD as intended. In tree users are all GPL or GPL-compatible but we should fix this so that mini-os is BSD. Do so by using the same BSD sys/queue.h as we use in libxl. Tested with the builtin mini-os test app and qemu stubdomain, both of which appear to still function as expected. Move tools/libxl/external and the associated sed script to tools/include/xen-external to allow more sensible access from mini-os. Also add s/NULL/0/ in the sed script due to NULL not always being defined in stubdom code when mini-os/wait.h is included. As well as the obvious ABI changes there are a few API updates associated with the change: - struct rw_semaphore.wait_list is unused - remove_waiter needs to take the wait_queue_head The latter requires a qemu update, so there is also a QEMU_TAG update in this changeset. I sprinkled some extra-emacs local variables around the files I edited which didn't have them. I think this should be backported to the stable branches since external users of mini-os may have been mislead into thinking they could safely link mini-os against GPL-incompatible code. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* stubdom/minios: re-structure headersKeir Fraser2009-10-011-10/+10
| | | | | | | | | As part of making stubdom usable on NetBSD, it is necessary to restructure the minios headers to avoid conflicts with NetBSD's crossbuild toolchain. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
* minios: switch to C99 integer typesKeir Fraser2009-07-151-1/+1
| | | | | | This is a necessary step to make minios build on NetBSD. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
* prefix mini-os lists with minios_, drop QEMU_ prefix from QEMU_LIST_*Keir Fraser2008-08-081-16/+16
| | | | | | That permits to reduce the amount of difference with upstream. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* stubdom: use host's gccKeir Fraser2008-07-041-3/+3
| | | | | | | | This makes stubdom use the host's gcc instead of downloading/compiling binutils+gcc. That requires a bunch of changes and even uncovered a few bugs, but saves a lot of time. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* stubdom: Save main_thread value by moving it out from app_bss whichKeir Fraser2008-05-281-0/+2
| | | | | | gets cleared. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* minios: simplify schedule()Keir Fraser2008-04-161-91/+43
| | | | | | | | - Merge the search, wakeup, and timeout loops. - Avoid unnecessarily switching to the idle thread. - Perform stack release _after_ we get out of it. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* Add stubdomain support. See stubdom/README for usage details.Keir Fraser2008-02-121-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Move PAGE_SIZE and STACK_SIZE into __PAGE_SIZE and __STACK_SIZE in arch_limits.h so as to permit getting them from there without pulling all the internal Mini-OS defines. - Setup a xen-elf cross-compilation environment in stubdom/cross-root - Add a POSIX layer on top of Mini-OS by linking against the newlib C library and lwIP, and implementing the Unixish part in mini-os/lib/sys.c - Cross-compile zlib and libpci too. - Add an xs.h-compatible layer on top of Mini-OS' xenbus. - Cross-compile libxc with an additional xc_minios.c and a few things disabled. - Cross-compile ioemu with an additional block-vbd, but without sound, tpm and other details. A few hacks are needed: - Align ide and scsi buffers at least on sector size to permit direct transmission to the block backend. While we are at it, just page-align it to possibly save a segment. Also, limit the scsi buffer size because of limitations of the block paravirtualization protocol. - Allocate big tables dynamically rather that letting them go to bss: when Mini-OS gets installed in memory, bss is not lazily allocated, and doing so during Mini-OS is unnecessarily trick while we can simply use malloc. - Had to change the Mini-OS compilation somehow, so as to export Mini-OS compilation flags to the Makefiles of libxc and ioemu. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* minios: POSIX fixesKeir Fraser2008-01-221-1/+1
| | | | | | Fixes some functions which are POSIX. Also make them ifndef HAVE_LIBC. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* minios: make time interface POSIXKeir Fraser2008-01-211-2/+2
| | | | | | | timespec uses tv_sec and tv_nsec too. gettimeofday takes a tz argument. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* minios: make stack size configurableKeir Fraser2008-01-171-1/+1
| | | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com> Signed-off-by: Grzegorz Milos <gm281@cam.ac.uk>
* minios: Add exit_thread prototype. Make sure exit_thread doesn'tKeir Fraser2008-01-171-1/+5
| | | | | | return by accident. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* [Mini-OS] Fix domain blocking raceKeir Fraser2007-11-241-3/+20
| | | | | | | | | | A callback which wakes a thread may happen between the moment schedule() gives hand to the idle thread and the latter blocks the domain. Idle hence needs to atomically check that no thread is running and block, else awoken threads may have to wait up to 10 seconds. Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
* [Mini-OS] Make sure schedule() is called safelyKeir Fraser2007-11-241-0/+8
| | | | | | | If a thread tries to sleep from a callback or with callbacks disabled, Mini-OS will completely lock, so make sure this never happens. Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
* [MINIOS] More cleanups for the ia64 port.kfraser@localhost.localdomain2007-01-191-5/+21
| | | | Signed-off-by: Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
* [MINIOS] Refactored mm.c and sched.c. x86 arch specific code got moved tokfraser@localhost.localdomain2006-11-221-137/+0
| | | | | | | | | arch/x86/mm.c and arch/x86/sched.c. Header files were also refactored: arch specific code got moved to include/x86/arch_mm.h and include/x86/sched_mm.h. Signed-off-by: Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com> Signed-off-by: Grzegorz Milos <gm281@cam.ac.uk>
* [MINIOS] Add timer support.kfraser@localhost.localdomain2006-11-151-4/+67
| | | | | | Based on an original patch by Robert Kaiser. Signed-off-by: Grzegorz Milos <gm281@cam.ac.uk>
* Fix fault handler for both 32 and 64 bit architecture. Clean up unused code.kaf24@firebug.cl.cam.ac.uk2006-05-041-1/+1
| | | | | | | Signed-off-by: Grzegorz Milos <gm281@cam.ac.uk> Signed-off-by: Aravindh Puthiyaparambil <aravindh.puthiyaparambil@unisys.com>
* Fix x86/64 version of Mini-OS. It encompasses the following:kaf24@firebug.cl.cam.ac.uk2006-05-021-24/+59
| | | | | | | | | | a) 64-bit switch_to scheduler macro (by Aravindh Puthiyaparambil) b) implements 64-bit hypervisor_callback c) fixes thread creation issues (thread_starter used to perform initialisation) Signed-off-by: Grzegorz Milos <gm281@cam.ac.uk>
* Fix mini-os xenbus.kaf24@firebug.cl.cam.ac.uk2006-03-241-14/+11
| | | | | | | From: Grzegorz Milos <gm281@cam.ac.uk> Signed-off-by: Keir Fraser <keir@xensource.com>
* Implement console for Mini-os and also fix 2 bugs:kaf24@firebug.cl.cam.ac.uk2006-03-151-2/+2
| | | | | | | | | a) in initialising new page table frames b) in initialising idle thread. Signed-off-by: Grzegorz Milos <gm281@cam.ac.uk>
* Xenbus implementation ported from Linux to Mini-os, simple thread support ↵kaf24@firebug.cl.cam.ac.uk2005-09-091-0/+300
introduced to simplify the porting. 64 bit version of Mini-os now compiles, but does not work because of the pagetables and some bits of scheduler not being written. Signed-off-by: Grzegorz Milos <gm281@cam.ac.uk>