Skip to content

Commit

Permalink
Merge branch 'cc_os_stage' into test/pranjalchanda08/181-cc_os-testin…
Browse files Browse the repository at this point in the history
…g-on-platforms
  • Loading branch information
pranjalchanda08 committed Jan 31, 2023
2 parents 8bf74da + 2a5a31d commit 417e3a4
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 21 deletions.
24 changes: 17 additions & 7 deletions mk/picotool.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ SILENT_LOGS := > cbuild.log 2> /dev/null
endif

P_TARGETS += elf2uf2
T_ALLOWLIST += get_picotool pt_clean install_pt_dep
T_ALLOWLIST += get_picotool clean_picotool install_pt_dep

get_picotool: $(PICO_TOOL) $(ELF2UF2)

Expand All @@ -30,36 +30,46 @@ $(PICO_TOOL): $(PICO_TOOL_BUILD)
cp $(PICO_TOOL_PATH)/build/picotool $@

$(PICO_TOOL_BUILD): $(PICO_SDK_PATH) $(PICO_TOOL_PATH)
@echo "Building picotool ..."
@echo "< ! > Building picotool ..."
cd $(PICO_TOOL_PATH) && mkdir -p build && \
cd build && export PICO_SDK_PATH=$(PICO_SDK_PATH) && \
cmake ../ $(SILENT_LOGS) \
&& make $(SILENT_LOGS)
@echo "< / > Done!"

$(ELF2UF2): $(PICO_SDK_PATH)
@echo "Building elf2uf2 ..."
@echo "< ! > Building elf2uf2 ..."
mkdir -p $(MISC_TOOLS)/temp
cd $(MISC_TOOLS)/temp; \
cmake $(PICO_SDK_PATH)/tools/elf2uf2 2>/dev/null >/dev/null; \
make >/dev/null 2>/dev/null
cp $(MISC_TOOLS)/temp/elf2uf2 $@
rm -rf $(MISC_TOOLS)/temp
@echo "< ! > Cleaning up build space ..."
rm -rf $(PICO_SDK_PATH) $(PICO_TOOL_PATH)
@echo "< / > Done!"

elf2uf2: $(ELF2UF2) elf
@echo "Generating $(notdir $(ELF:.elf=.uf2)) ..."
$(ELF2UF2) $(ELF) $(ELF:.elf=.uf2)
@echo "< / > Done!"

$(PICO_SDK_PATH):
@echo "Fetching PICO SDK ..."
@echo "< ! > Fetching PICO SDK ..."
git clone $(PICO_SDK_GIT) --quiet $@
@echo "< / > Done!"

$(PICO_TOOL_PATH):
@echo "Fetching PICO Tool ..."
@echo "< ! > Fetching PICO Tool ..."
git clone $(PICO_TOOL_GIT) --quiet $@
@echo "< / > Done!"

install_pt_dep:
@echo "Installing Dependencies ..."
@echo "< ! > Installing Dependencies ..."
@sudo apt-get install build-essential pkg-config libusb-1.0-0-dev -y -qq > /dev/null
@echo "< / > Done!"

pt_clean:
clean_picotool:
@echo "< ! > Removing picotools ..."
rm -rf $(PICO_SDK_PATH) $(PICO_TOOL_PATH) $(PICO_TOOL) $(ELF2UF2)
@echo "< / > Done!"
32 changes: 23 additions & 9 deletions mk/qemu.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,38 @@
# Organisation : Cyancore Core-Team
#

T_ALLOWLIST += get_qemu
T_ALLOWLIST += get_qemu clean_qemu

get_qemu: | $(TOOLS_ROOT)/qemu/ $(TOOLS_ROOT)/qemu/build/
QEMU_CHECKOUT := v7.2.0
QEMU_PATH := $(TOOLS_ROOT)/qemu
QEMU_BUILD_PATH := $(QEMU_PATH)/build
QEMU_OUT_PATH := $(TOOLS_ROOT)/cc_qemu
QEMU_TLIST := avr-softmmu,arm-softmmu,riscv32-softmmu

$(TOOLS_ROOT)/qemu/:
get_qemu: $(QEMU_OUT_PATH)

$(TOOLS_ROOT)/qemu:
@echo "< ! > Using qemu version: $(QEMU_CHECKOUT)"
@echo "< ! > Fetching qemu ..."
mkdir -p $(TOOLS_ROOT)
cd $(TOOLS_ROOT); git clone https://gitlab.com/qemu-project/qemu.git;
cd $@; git submodule init; git submodule update --recursive
cd $(TOOLS_ROOT); git clone https://gitlab.com/qemu-project/qemu.git --quiet;
cd $@; git checkout -b $(QEMU_CHECKOUT) $(QEMU_CHECKOUT) 1> /dev/null 2> /dev/null
@echo "< / > Done !"

$(TOOLS_ROOT)/qemu/build/: $(TOOLS_ROOT)/qemu/

$(QEMU_OUT_PATH): $(QEMU_PATH)
@echo "< ! > Building qemu ..."
@echo "< ? > Please be patient as this might take a while ..."
cd $<; ./configure
make -j $(N_JOBS) -C $<
cd $<; ./configure --prefix=$(QEMU_OUT_PATH) --target-list=$(QEMU_TLIST) 2> /dev/null 1> /dev/null
make -j $(N_JOBS) -C $< install 2> /dev/null 1> /dev/null
@echo "< ! > Cleaning up build space ..."
rm -rf $(QEMU_PATH)
@echo "< ! > Adding load_qemu alias to bashrc ..."
@echo "< ! > run 'load_qemu' before trying to launch qemu!"
echo "alias load_qemu='export PATH=\"\$$PATH\":$@/build/'" >> ~/.bashrc
echo "alias load_qemu='export PATH=\"\$$PATH\":$@/bin/'" >> ~/.bashrc
@echo "< / > Done !"

clean_qemu:
@echo "< ! > Removing cc-qemu installation ..."
rm -rf $(QEMU_OUT_PATH) $(QEMU_PATH)
@echo "< / > Done!"
7 changes: 2 additions & 5 deletions src/visor/terravisor/services/kernel/cc_os_sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,10 @@ void _cc_sched_send_back_of_task_prio(cc_sched_tcb_t *node_ptr)
void _cc_os_pre_sched(cc_os_args args)
{
cc_sched_ctrl_t * sched_ctrl = (cc_sched_ctrl_t *) args;

sched_ctrl->curr_task->task_status = cc_sched_task_status_ready;
__cc_sched_wait_list_adjustment(sched_ctrl);
__cc_sched_deadlock_adjustment_and_detection(sched_ctrl);
_cc_sched_send_back_of_task_prio(sched_ctrl->curr_task);
}

/**
Expand Down Expand Up @@ -455,8 +456,6 @@ static void __cc_sched_algo_round_robin_fn(cc_sched_ctrl_t * sched_ctrl)
/* do waitlist adjustment */
cc_sched_tcb_t * ptr = sched_ctrl->curr_task->ready_link.next;

__cc_sched_wait_list_adjustment(sched_ctrl);

if (ptr == sched_ctrl->ready_list_head)
{
/* IDLE Task */
Expand All @@ -472,8 +471,6 @@ static void __cc_sched_algo_round_robin_fn(cc_sched_ctrl_t * sched_ctrl)
static void __cc_sched_algo_priority_driven_fn(cc_sched_ctrl_t * sched_ctrl)
{
/* do waitlist adjustment */
__cc_sched_wait_list_adjustment(sched_ctrl);

cc_sched_tcb_t * ptr = sched_ctrl->ready_list_head->ready_link.prev;
if(ptr != CC_OS_NULL_PTR)
{
Expand Down

0 comments on commit 417e3a4

Please sign in to comment.