text: #pragma once
  
  #include <stdint.h>
  #include <stdbool.h>
  #include <pmsis.h>
  #include <FreeRTOS.h>
  #include <semphr.h>
  
  #define MEMORY_BARRIER() __asm__ __volatile__ ("" : : : "memory");
  
  struct compute_task {
      void (*entry)(void* args);
      void* args;
  };
  
  struct compute_core {
      spinlock_t spinlock;
      int32_t spinlock_meta;
      uint8_t in_use;
      struct compute_task* task;
  };
  
  int initialize_threads(char cores);
  void close_threads();
  
  void submit_task(struct compute_task* task);
  
  __attribute__((noinline)) void increment_num_available_cores();
  __attribute__((noinline)) void decrement_num_available_cores();
  __attribute__((noinline)) bool cores_unavailable();
  
  __attribute__((noinline)) void* malloc_l1(size_t size);
  __attribute__((noinline)) void free_l1(void* ptr, size_t size);