Commit graph

19 commits

Author SHA1 Message Date
Daniel Kochmański
1cdaf35d54 nucleus: introduce a table with early symbols ecl_symbols
This table contains symbols that are essential to the core runtime: ECL_T,
ECL_UNBOUND, ECL_SIGNAL_HANDLERS, ECL_RESTART_CLUSTERs, ECL_INTERRUPTS_ENABLED,
ECL_ALLOW_OTHER_KEYS and ECL_UNBOUND.

The table is initialized with constexpr, so it is possible to use its elements
in static elements. We also add ecl_def_function to ecl-inl to allow
appropriating C functions into Lisp world at top level.
2026-03-11 08:42:05 +01:00
Daniel Kochmański
be01170689 process: move process initialization to the process module hooks 2026-03-11 08:42:05 +01:00
Daniel Kochmański
7a7e14d0ef process: abstract away create thread, exit thread and sigmask
Previously we've opencoded calls to these functions, although they may be nicely
abstracted with static inline functions. This change improves code readibility
and portability.
2026-03-11 08:42:05 +01:00
Daniel Kochmański
4ece70632d modules: [9/n] introduce ecl_module_thread 2026-03-11 08:42:05 +01:00
Daniel Kochmański
4b67426ef9 modules: [4/n] introduce ecl_module_bignum 2026-03-11 08:42:05 +01:00
Daniel Kochmański
99921d340b modules: [1/n] introduce ecl_module_gc
We also remove conditionalization for garbage collector inclusion in autotools.
When we propose an alternative gc, then we may decide to put them back, or to
add necessary ifdef statements directly in files.

Moreover untangle c-stack from the gc code and assign the stack base with a
rough guess only when it is not initialized yet (GC will always fill it).

Finally remove a kludge from ecl_adopt_cpu and disable colleciton until the cpu
is fully initialized.
2026-03-11 08:42:05 +01:00
Daniel Kochmański
e5357950a6 modules: [0/n] introduce a new structure ecl_module in the system
This will allow us to decouple forward system initialization from the early
process code.
2026-03-11 08:42:05 +01:00
Daniel Kochmański
9835c2fbec nucleus: [2/n] move processing unit managament to nucleus 2026-03-11 08:42:05 +01:00
Daniel Kochmański
5d188c61bd nucleus: [1/n] move processing unit managament to nucleus 2026-03-11 08:42:05 +01:00
Daniel Kochmański
9d0573fbb5 exceptions: introduce the concept of an exception
Exceptions, unlike conditions, are stack allocated and can't be captured.
2026-03-11 08:42:05 +01:00
Daniel Kochmański
aa7e890e3d core: split cl_core_struct in two structure cl_core and ecl_core
ecl_core contains early global environment that is meant to be shared by all
runtimes, while cl_core contains an environment relevant to common lisp.
2026-03-11 08:42:04 +01:00
Daniel Kochmański
ad2e7a6e4b core: move defacto constants from cl_core structure to global space 2026-03-11 08:42:04 +01:00
Daniel Kochmański
7db0a89f42 stacks: use a manual allocator for stacks
Objects have a well defind extent so there is no need to rely on GC for
them. This change allows us to move stack initialization before garbage
collector is introduced into the system (or even without any GC).
2025-05-26 08:37:06 +02:00
Daniel Kochmański
1b058f0e3a stacks: manually allocate bindings table
This commit removes initial bindings array from the process and allocates it
only in the bds stack. To make fields in the structure less confusing we rename
initial_bindings slot to inherit_bindings_p.

On observable behavior change is that bindings are inherited when the process is
enabled, not when it is created. That was not specified in documentation so it
should be fine to change this behavior. Moreover it makes more sense from the
programmer perspective -- we want to inherit bindings of the process that starts
our thread, not the one that creates it.
2025-05-26 08:36:03 +02:00
Daniel Kochmański
9687a1d33a stacks: move frames stack to a separate structure 2025-05-26 07:43:41 +02:00
Daniel Kochmański
8f00f3494a stacks: rename thread_local_bindings{,_size} to tl_bindings{,_size}
This is strictly cosmetic change.
2025-05-26 07:43:41 +02:00
Daniel Kochmański
f365ebe079 stacks: move the binding stack to a separate structure 2025-05-26 07:43:41 +02:00
Daniel Kochmański
62c8f3f714 threads: get rid of an annoying warning stemming from xopen
We've defined _XOPEN_SOURCE 600 but glibc defines it as 700 or more.
2025-05-13 14:18:10 +02:00
Daniel Kochmański
0f4e9b1e17 core: factor out process managament from thread managament
This is a preliminary step towards coroutines and for switching global env in
single-threaded builds.
2025-03-31 20:44:46 +02:00
Renamed from src/c/threads/process.d (Browse further)