aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/malta/Makefile
Commit message (Expand)AuthorAgeFilesLines
* treewide: Remove self from MAINTAINER entriesFlorian Fainelli2019-12-231-1/+0
* malta: fix overlay support by updating to f2fs/ext4 based overlaysPetr Štetiar2019-06-251-2/+2
* treewide: kernel: bump some targets to 4.19Petr Štetiar2019-06-181-1/+1
* treewide: use wpad-basic for not small flash targetsMathias Kresin2018-10-161-1/+1
* malta: bump tp v4.14John Crispin2018-01-091-1/+1
* malta: upgrade to kernel 4.9Hauke Mehrtens2017-10-151-1/+1
* malta: restore "be" subtarget from being source-onlyYousong Zhou2017-03-051-1/+1
* malta: mark as source-only to avoid wasting build resourcesFelix Fietkau2017-01-241-1/+1
* malta: move FEATURES to the target makefileFelix Fietkau2017-01-241-0/+1
* malta: enable be64 and le64 subtargetsYousong Zhou2016-08-151-1/+1
* malta: move to 4.4 kernelFelix Fietkau2016-01-281-1/+1
* malta: use as a default type deviceFelix Fietkau2015-10-311-2/+0
* malta: set CPU_TYPE:=24kc.Felix Fietkau2015-10-311-0/+1
* malta: disable 64 builds as the userland has been broken for agesJohn Crispin2015-02-091-1/+1
* malta: add 3.18 supportJohn Crispin2015-02-091-1/+1
* malta: set 3.14 as defaultJohn Crispin2014-12-011-1/+1
* kernel: makefiles: make use of new var KERNEL_PATCHVERFelix Fietkau2014-10-241-1/+1
* kernel: update to 3.10.49 Signed-off-by: John Crispin <blogic@openwrt.org>John Crispin2014-07-201-1/+1
* kernel: update 3.10.36->3.10.44John Crispin2014-06-261-1/+1
* kernel: update 3.10 to 3.10.36Gabor Juhos2014-04-121-1/+1
* kernel: update 3.10 to 3.10.34Gabor Juhos2014-03-271-1/+1
* kernel: update 3.10 to 3.10.32Gabor Juhos2014-02-231-1/+1
* kernel: update 3.10 to 3.10.28Gabor Juhos2014-01-261-1/+1
* kernel: update 3.10 to 3.10.26Gabor Juhos2014-01-111-1/+1
* kernel: update kernel 3.10 to 3.10.24Hauke Mehrtens2013-12-151-1/+1
* kernel: update 3.10 to 3.10.21Gabor Juhos2013-12-011-1/+1
* kernel: update 3.10 to 3.10.18Gabor Juhos2013-11-051-1/+1
* kernel: update 3.10 to 3.10.17Gabor Juhos2013-10-231-1/+1
* kernel: update kernel to 3.10.15Hauke Mehrtens2013-10-131-1/+1
* kernel: update 3.10 to 3.10.13Gabor Juhos2013-09-271-1/+1
* kernel: update 3.10 to 3.10.12Gabor Juhos2013-09-151-1/+1
* kernel: update 3.10 to 3.10.10Gabor Juhos2013-09-021-1/+1
* kernel: update 3.10 to 3.10.9Gabor Juhos2013-08-231-1/+1
* kernel: update remaning platforms accidentally left out of r37617Felix Fietkau2013-07-301-1/+1
* kernel: update 3.10 to 3.10.3Gabor Juhos2013-07-261-1/+1
* kernel: update 3.10 to 3.10.2Gabor Juhos2013-07-221-1/+1
* malta: switch to 3.10Gabor Juhos2013-07-191-1/+1
* kernel: update linux 3.8 to 3.8.13Gabor Juhos2013-05-261-1/+1
* kernel: update linux 3.8 to 3.8.12Gabor Juhos2013-05-081-1/+1
* kernel: update linux 3.8 to 3.8.11Gabor Juhos2013-05-011-1/+1
* kernel: update linux 3.8 to 3.8.10Gabor Juhos2013-04-301-1/+1
* kernel: update linux 3.8 to 3.8.9Gabor Juhos2013-04-261-1/+1
* kernel: update linux 3.8 to 3.8.8Gabor Juhos2013-04-191-1/+1
* kernel: update linux 3.8 to 3.8.7Gabor Juhos2013-04-141-1/+1
* kernel: update linux 3.8 to 3.8.6Gabor Juhos2013-04-061-1/+1
* malta: add le64 and be64 sub targetsFlorian Fainelli2013-04-051-1/+1
* malta: move 32-bits options to subtarget configFlorian Fainelli2013-04-051-1/+0
* kernel: update linux 3.8 to 3.8.3Gabor Juhos2013-03-151-1/+1
* malta: switch to 3.8Gabor Juhos2013-03-101-1/+1
* kernel: update linux 3.7 to 3.7.10Gabor Juhos2013-03-031-1/+1
gt;thread_list) { th = minios_list_entry(it, struct thread, thread_list); printk(" Thread \"%s\", runnable=%d\n", th->name, is_runnable(th)); } printk("\n"); } void schedule(void) { struct thread *prev, *next, *thread; struct minios_list_head *iterator, *next_iterator; unsigned long flags; prev = current; local_irq_save(flags); if (in_callback) { printk("Must not call schedule() from a callback\n"); BUG(); } if (flags) { printk("Must not call schedule() with IRQs disabled\n"); BUG(); } do { /* Examine all threads. Find a runnable thread, but also wake up expired ones and find the time when the next timeout expires, else use 10 seconds. */ s_time_t now = NOW(); s_time_t min_wakeup_time = now + SECONDS(10); next = NULL; minios_list_for_each_safe(iterator, next_iterator, &idle_thread->thread_list) { thread = minios_list_entry(iterator, struct thread, thread_list); if (!is_runnable(thread) && thread->wakeup_time != 0LL) { if (thread->wakeup_time <= now) wake(thread); else if (thread->wakeup_time < min_wakeup_time) min_wakeup_time = thread->wakeup_time; } if(is_runnable(thread)) { next = thread; /* Put this thread on the end of the list */ minios_list_del(&thread->thread_list); minios_list_add_tail(&thread->thread_list, &idle_thread->thread_list); break; } } if (next) break; /* block until the next timeout expires, or for 10 secs, whichever comes first */ block_domain(min_wakeup_time); /* handle pending events if any */ force_evtchn_callback(); } while(1); local_irq_restore(flags); /* Interrupting the switch is equivalent to having the next thread inturrupted at the return instruction. And therefore at safe point. */ if(prev != next) switch_threads(prev, next); minios_list_for_each_safe(iterator, next_iterator, &exited_threads) { thread = minios_list_entry(iterator, struct thread, thread_list); if(thread != prev) { minios_list_del(&thread->thread_list); free_pages(thread->stack, STACK_SIZE_PAGE_ORDER); xfree(thread); } } } struct thread* create_thread(char *name, void (*function)(void *), void *data) { struct thread *thread; unsigned long flags; /* Call architecture specific setup. */ thread = arch_create_thread(name, function, data); /* Not runable, not exited, not sleeping */ thread->flags = 0; thread->wakeup_time = 0LL; #ifdef HAVE_LIBC _REENT_INIT_PTR((&thread->reent)) #endif set_runnable(thread); local_irq_save(flags); if(idle_thread != NULL) { minios_list_add_tail(&thread->thread_list, &idle_thread->thread_list); } else if(function != idle_thread_fn) { printk("BUG: Not allowed to create thread before initialising scheduler.\n"); BUG(); } local_irq_restore(flags); return thread; } #ifdef HAVE_LIBC static struct _reent callback_reent; struct _reent *__getreent(void) { struct _reent *_reent; if (!threads_started) _reent = _impure_ptr; else if (in_callback) _reent = &callback_reent; else _reent = &get_current()->reent; #ifndef NDEBUG #if defined(__x86_64__) || defined(__x86__) { #ifdef __x86_64__ register unsigned long sp asm ("rsp"); #else register unsigned long sp asm ("esp"); #endif if ((sp & (STACK_SIZE-1)) < STACK_SIZE / 16) { static int overflowing; if (!overflowing) { overflowing = 1; printk("stack overflow\n"); BUG(); } } } #endif #endif return _reent; } #endif void exit_thread(void) { unsigned long flags; struct thread *thread = current; printk("Thread \"%s\" exited.\n", thread->name); local_irq_save(flags); /* Remove from the thread list */ minios_list_del(&thread->thread_list); clear_runnable(thread); /* Put onto exited list */ minios_list_add(&thread->thread_list, &exited_threads); local_irq_restore(flags); /* Schedule will free the resources */ while(1) { schedule(); printk("schedule() returned! Trying again\n"); } } void block(struct thread *thread) { thread->wakeup_time = 0LL; clear_runnable(thread); } void msleep(u32 millisecs) { struct thread *thread = get_current(); thread->wakeup_time = NOW() + MILLISECS(millisecs); clear_runnable(thread); schedule(); } void wake(struct thread *thread) { thread->wakeup_time = 0LL; set_runnable(thread); } void idle_thread_fn(void *unused) { threads_started = 1; while (1) { block(current); schedule(); } } DECLARE_MUTEX(mutex); void th_f1(void *data) { struct timeval tv1, tv2; for(;;) { down(&mutex); printk("Thread \"%s\" got semaphore, runnable %d\n", current->name, is_runnable(current)); schedule(); printk("Thread \"%s\" releases the semaphore\n", current->name); up(&mutex); gettimeofday(&tv1, NULL); for(;;) { gettimeofday(&tv2, NULL); if(tv2.tv_sec - tv1.tv_sec > 2) break; } schedule(); } } void th_f2(void *data) { for(;;) { printk("Thread OTHER executing, data 0x%lx\n", data); schedule(); } } void init_sched(void) { printk("Initialising scheduler\n"); #ifdef HAVE_LIBC _REENT_INIT_PTR((&callback_reent)) #endif idle_thread = create_thread("Idle", idle_thread_fn, NULL); MINIOS_INIT_LIST_HEAD(&idle_thread->thread_list); }