Commit Graph

240 Commits

Author SHA1 Message Date
Chris Copeland 245d75012a
remove _init functions 2024-05-16 22:21:57 -07:00
Chris Copeland 06cacd01ee
add thread-local storage support for arm 2024-04-27 01:23:37 -07:00
Chris Copeland 83223ffcd7
remove unused ... from RT_TASK_INIT 2024-04-22 23:30:43 -07:00
Chris Copeland 15a2acf2c9
add RT_QUEUE for non-static queues 2024-04-20 00:26:15 -07:00
Chris Copeland b0426a0d68
add rt_tick_elapse and use it in cond.c and rwlock.c 2024-04-19 06:32:46 -07:00
Chris Copeland b9957f0957
remove rt_mutex_holder, avoid priority donation to an interrupt 2024-03-31 22:42:54 -07:00
Chris Copeland 5d9816bd4a
simplify LOCK and TIMEDLOCK syscalls to not also call wake_mutex_waiter
make interrupts use a specific holder value when acquiring a mutex
2024-03-31 18:36:20 -07:00
Chris Copeland 3cbea40dbd
refactor mpu.h some more and rename RT_MPU_ENABLE to RT_MPU_TASK_REGIONS_ENABLE 2024-03-17 02:45:13 -07:00
Chris Copeland d4e2a50c73
refactor mpu.h so that rt/arch/mpu.h can be used directly 2024-03-17 02:35:13 -07:00
Chris Copeland 67d3ef07f2
remove sem.h include from mutex.h
add missing sem.h includes
2024-03-14 03:18:25 -07:00
Chris Copeland 7d0353b1d7
pass synchronous syscall arguments in registers
rt_syscall_op -> rt_syscall

split the syscall enum between synchronous and asynchronous syscalls

add explicit YIELD syscall enum

split blocking states by sem vs. mutex to simplify donation and timeouts
2024-03-08 00:28:27 -08:00
Chris Copeland bf6a52137c
fix ready list management on c28 2024-03-07 23:57:53 -08:00
Chris Copeland 2bf718b17e
remove PRE- and POST- TASK_CONSTRUCTOR_PRIORITY
these aren't needed internally anymore, and rust tasks don't use the
same constructor priorities as C tasks, so they may not be respected
anyway
2024-03-03 20:13:22 -08:00
Chris Copeland 82d9af898e
remove RT_SYSCALL_TASK_READY
have rust's task init add directly to ready lists, which themselves don't need a constructor anymore
2024-03-03 18:18:47 -08:00
Chris Copeland 5f7b12e0c3
add RT_PRE_TASK_CONSTRUCTOR 2024-02-24 12:29:17 -08:00
Chris Copeland 8845d8d1b6
refactor ready list management and make lower priority numbers higher priority 2024-02-24 03:37:52 -08:00
Chris Copeland dd5438f39c
split rt_syscall_run into rt_syscall_run and rt_syscall_run_pending
rt_syscall now triggers a single syscall synchronously, masking the
pending syscall handler

split the svc and syscall irq handlers on arch/arm/ar

split the svcall and pendsv handlers on arch/arm/m

add a user1 interrupt handler on arch/c28

invoke synchronous syscalls directly in the active thread in arch/pthread

move rt_pending_syscalls to privileged .bss now that tasks don't need
to modify it

add alignment attribute to arm/ar interrupt handler macros

provide CPACR_FPU_ENABLE to assembler and initialize task's cpacr to the
processor's default, fpu-disabled, value rather than 0

don't yield for empty rt_pending_syscalls (yield is synchronous only)

add missing sigemptyset to block_all_signals

update arch/arm/README.md
2024-02-21 00:39:55 -08:00
Chris Copeland f188ad2d82
add RT_POST_TASK_CONSTRUCTOR 2024-02-11 14:55:22 -08:00
Chris Copeland 39478d4d5d
rename RT_MPU_{STACK,PERIPHERAL}_ATTR to RT_MPU_ATTR_{STACK,PERIPHERAL} 2024-01-23 22:49:12 -08:00
Chris Copeland 3df912ca2c
remove a compound conditional from sched by adding one to the next task's priority when yielding 2024-01-17 01:28:40 -08:00
Chris Copeland b277bd976b
MAX_PRIORITY -> PRIORITY_MAX, add PRIORITY_MIN 2024-01-04 00:39:14 -08:00
Chris Copeland 1626522df8
remove unused includes in task.h 2024-01-04 00:38:28 -08:00
Chris Copeland 8e38fc67e7
remove rt_list_for_each 2023-12-18 01:39:36 -08:00
Chris Copeland fe61771778
use a normal binary semaphore for cond to allow a signal that happens before a cond_wait but after a condition check to be received 2023-12-10 22:28:29 -08:00
Chris Copeland 2cc9ed9605
don't track control in v6-m with MPU 2023-11-26 01:19:19 -08:00
Chris Copeland 74f76b300e
arch/c28 2023-11-05 22:46:40 -08:00
Chris Copeland 9824c9bc80
remove rt_context_start declaration 2023-11-03 22:09:56 -07:00
Chris Copeland 28eb29e099
add src/assert.c, fix rt_atomic macro and use it for pointers also 2023-11-02 07:00:32 -07:00
Chris Copeland 8ce7957629
use static_assert instead of _Static_assert in C23 2023-11-01 01:16:57 -07:00
Chris Copeland 2321d43661
move rt_once_call to once.c and remove rt_once_call_slow 2023-10-31 23:03:34 -07:00
Chris Copeland 7c691e5423
fix up includes 2023-10-31 23:03:34 -07:00
Chris Copeland 313bda2380
rework rwlock and add {try,timed}{rd,wr}lock add {rd,wr}unlock 2023-10-29 07:04:51 -07:00
Chris Copeland 4192c24579
rwlock.m -> rwlock.mutex 2023-10-28 12:30:10 -07:00
Chris Copeland 65f051ca3b
add rt_mutex_holder function 2023-10-24 00:53:37 -07:00
Chris Copeland 812117ff49
add recursive mutexes 2023-10-17 23:03:54 -07:00
Chris Copeland d8182e4f1c
clean up comments, use #pragma once everywhere 2023-10-14 13:50:37 -07:00
Chris Copeland c4abb96de1
refactor MPU interface, simplify start and unify creation of idle task 2023-10-10 23:09:58 -07:00
Chris Copeland 0b2ba56d57
use rt_task_ready in task constructors, and use __COUNTER__ for the constructor priority 2023-10-06 00:14:27 -07:00
Chris Copeland 598d9759c7
implement lazy enable fp for cortex r 2023-09-22 09:05:42 -07:00
Chris Copeland 778399d0d3
refactor rt_syscall and rt_syscall_pend
make rt_syscall_pend work from interrupts and rt_syscall work from tasks
remove old rt_syscall_pend that works from both

rename enum rt_syscall to enum rt_syscall_op
2023-09-19 23:19:33 -07:00
Chris Copeland b606cf06c7
move syscall records out of the task and put tasks in privileged memory 2023-09-17 21:47:58 -07:00
Chris Copeland 16253d7ca6
automatically use clz when available on arm and always on x86_64 2023-09-02 08:30:55 -07:00
Chris Copeland 5540f06f44
use a bit vector and multiple lists for ready tasks 2023-09-01 09:41:13 -07:00
Chris Copeland 28d2834a57
don't evaluate rt_logf arguments when it's not enabled 2023-08-27 13:59:53 -07:00
Chris Copeland 7685882036
provide RT_LOG_ENABLE in rt/log.h 2023-08-27 13:48:39 -07:00
Chris Copeland 03319a1c89
RT_TASK_STATIC* -> RT_TASK* 2023-08-24 08:46:43 -07:00
Chris Copeland 373c0bfb35
add rt_syscall_pend_from_task 2023-08-22 23:30:34 -07:00
Chris Copeland fe677a7f43
remove main from examples and use constructors for task creation 2023-08-21 20:50:16 -07:00
Chris Copeland aa4705fd96
add RT_TASK_STATIC* and use it in examples 2023-08-19 16:32:19 -07:00
Chris Copeland 11f7652c58
move sleep functions into task.h and rename them to rt_task_sleep* 2023-07-26 23:40:58 -07:00