Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release merge for Cyancore v1.3.0 #164

Merged
merged 33 commits into from
Aug 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
a638ff2
<heap> Add multi-core support and bug fixes
akashkollipara Aug 9, 2022
255d02a
<heap> Added more function for heap management
akashkollipara Aug 10, 2022
9d710e5
Merge pull request #145 from VisorFolks/dev_akash_heap_fixes
MayuriLokhande Aug 10, 2022
a75fe6c
<Driver> Updated all drivers to use heap memory
akashkollipara Aug 11, 2022
ede9762
Merge pull request #148 from VisorFolks/dev_akash_drv_upd
akashkollipara Aug 12, 2022
44545b7
<Logs> Add ability to completely disable logs
akashkollipara Aug 13, 2022
b38cee6
<sysclk> Fix for return code of set clk func
akashkollipara Aug 13, 2022
8116018
<ATMega2560> Updated platform config files
akashkollipara Aug 13, 2022
9ea2297
<FE310> Updated memory alignment
akashkollipara Aug 13, 2022
a575adc
<make> Remove debug info with new rv toolchain
akashkollipara Aug 13, 2022
5f88fae
Updated README
akashkollipara Aug 13, 2022
dfbeaef
<timer> Fixed missing clk failed init in timer
akashkollipara Aug 14, 2022
94c3b4b
<MegaAVR> Updated clks in dp
akashkollipara Aug 14, 2022
4650d26
Merge pull request #153 from VisorFolks/dev_akash_bugfix_upds
akashkollipara Aug 15, 2022
46f874f
<Memory> Optimised data space usage with correct qualifiers
akashkollipara Aug 15, 2022
84c874b
<FE310> Path to optimize memory usage
akashkollipara Aug 16, 2022
abd7a92
<Misc> Updated visuals
akashkollipara Aug 16, 2022
f0ea9f4
<Drivers> Improved error handling and update err codes
akashkollipara Aug 16, 2022
199ead7
<make> Feature updated to print size of sections
akashkollipara Aug 18, 2022
e6d87b4
Merge pull request #158 from VisorFolks/dev_akash_mem_opt
akashkollipara Aug 18, 2022
d68977a
<Arch> Updated machine call structure
akashkollipara Aug 15, 2022
f844671
<Timer> Driver fix to start from 0
akashkollipara Aug 19, 2022
e1d2d65
<Mem> Improved memory organization and placements
akashkollipara Aug 19, 2022
25443d3
Merge pull request #161 from VisorFolks/dev_akash_mem_clnup
akashkollipara Aug 19, 2022
ccdc771
Merge branch 'development' into dev_akash_timer_fix
pranjalchanda08 Aug 19, 2022
cf82fe2
Merge branch 'development' into dev_akash_ecalls_update
pranjalchanda08 Aug 19, 2022
ce90f1b
Merge pull request #160 from VisorFolks/dev_akash_timer_fix
akashkollipara Aug 19, 2022
e2cc2a9
Merge branch 'development' into dev_akash_ecalls_update
akashkollipara Aug 21, 2022
ba1250d
Merge pull request #156 from VisorFolks/dev_akash_ecalls_update
akashkollipara Aug 22, 2022
99ddf83
Patch for new size tool
akashkollipara Aug 22, 2022
7129346
Merge pull request #162 from VisorFolks/dev_akash_size
akashkollipara Aug 22, 2022
98c9363
Updated release info
akashkollipara Aug 23, 2022
cdd402f
Merge pull request #163 from VisorFolks/rel_upd
akashkollipara Aug 29, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</div>
</body>

> **Version (arch:2 | major:4 | minor:2): 1.2.2**
> **Version (arch:2 | major:4 | minor:2): 1.3.0**

[![GitHub CI](https://github.com/VisorFolks/cyancore/actions/workflows/github_ci.yml/badge.svg)](https://github.com/VisorFolks/cyancore/actions/workflows/github_ci.yml)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=VisorFolks_cyancore&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=VisorFolks_cyancore)
Expand Down
12 changes: 6 additions & 6 deletions mk/elf.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ LD_SUPPLEMENT := $(addprefix $(OUT)/,$(LD_SUPPLEMENT:.ld.sx=.ld))

elf: $(ELF)

$(ELF): $(DEP_LIBS) $(DEP_OBJS) $(LD_SCRIPT) $(LD_SUPPLEMENT)
.SECONDEXPANSION:
$(ELF): $(DEP_LIBS) $(DEP_OBJS) $(LD_SCRIPT) $(LD_SUPPLEMENT) | $$(SIZE)
@echo "Elf: Generating $(@F) ..."
$(LD) -dT $(LD_SCRIPT) $(addprefix -T , $(LD_SUPPLEMENT)) $(LD_FLAGS) -Map=$(@:.elf=.map) -o $@ $(filter %.o, $^) $(DEP_LIB_PATH) $(DEP_LIBS_ARG) -L $(TL) -lgcc
$(LD) -dT $(LD_SCRIPT) $(addprefix -T , $(LD_SUPPLEMENT)) $(LD_FLAGS) \
-Map=$(@:.elf=.map) -o $@ $(filter %.o, $^) $(DEP_LIB_PATH) $(DEP_LIBS_ARG) -L $(TL) -lgcc
$(OD) -Dx -h --wide $@ > $(@:.elf=.lst)
$(OC) -O binary $@ $(@:.elf=.bin)
$(OC) -O ihex $@ $(@:.elf=.hex)
@echo "=================================================="
@echo "Size of Executable:"
@cd $(@D); $(SIZE) $(@F)
@cd $(@D); $(SIZE) -f $(@F) -m Flash $(FLASH_START) $(FLASH_SIZE) \
-m RAM $(RAM_START) $(RAM_SIZE) $(MEMSIZE_ARGS)
@echo ""

.SECONDEXPANSION:
$(OUT)/%.ld: %.ld.sx
mkdir -p $(@D)
@echo "Elf: Preprocessing $(@F) ..."
Expand Down
1 change: 0 additions & 1 deletion mk/tc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ OD := $(TC)-objdump
OC := $(TC)-objcopy
STRIP := $(TC)-strip
A2L := $(TC)-addr2line
SIZE := $(TC)-size
endif

ifeq ($(realpath $(TI)),)
Expand Down
8 changes: 8 additions & 0 deletions mk/tc_get.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ T_ALLOWLIST += get_all_tc get_avr_tc get_arm_tc get_riscv_tc

# GIT REPO RECOMMENDED
# Provide git repo path for toolchains for better experience
ESIZE_REPO := https://github.com/VisorFolks/cc_elf_size.git
AVR_TC_REPO ?=
RISC_V_TC_REPO ?=
ARM_TC_REPO ?=
Expand All @@ -23,6 +24,13 @@ get_all_tc: --tc_clear get_avr_tc get_arm_tc get_riscv_tc
--tc_clear:
rm -rf $(TOOLS_ROOT)

SIZE := $(TOOLS_ROOT)/cc_elf_size/size
$(SIZE):
$(info < ! > Fetching ELF-Size utility ...)
cd $(TOOLS_ROOT); git clone $(ESIZE_REPO) --quiet;
$(MAKE) -C $(@D)
echo "< / > Done !"

get_arm_tc: $(TOOLS_ROOT)/arm-toolchain/bin/arm-none-eabi-gcc
$(TOOLS_ROOT)/arm-toolchain/bin/arm-none-eabi-gcc:
ifeq ($(ARM_TC_REPO),)
Expand Down
1 change: 0 additions & 1 deletion projects/demo_avr/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ STDLOG_MEMBUF := 0
BOOTMSGS := 0
EARLYCON_SERIAL := 1
CONSOLE_SERIAL := 1
TERRAKERN := 0
OBRDLED_ENABLE := 1
1 change: 0 additions & 1 deletion src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ This is the root directory of all the sources of this framework.
| [include](include) | Constitues of all the include/header files except for arch |
| [lib](lib) | Constitues of all the necessary libraries |
| [platform](platform) | Constitues of platform/development board specific sources |
| [projects](projects) | Constitues of project sources made using this framework |
| [visor](visor) | Constitues of terra/hyper/super - visors' sources |

---
Expand Down
27 changes: 5 additions & 22 deletions src/arch/avr/8/common_5x_6/terravisor/arch.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@
#include <stdint.h>
#include <status.h>
#include <syslog.h>
#include <machine_call.h>
#include <terravisor/workers.h>
#include <plat_arch.h>
#include <mmio.h>
#include <arch.h>
#include <terravisor/workers.h>

/**
* arch_early_setup - This function is called in the early stages of boot
*
* @brief This function is responsible to clean reset cpu status/control registers.
*
*/
void (* const p_mcall)(unsigned int, unsigned int, unsigned int, unsigned int, mret_t *) = &machine_call;
void arch_early_setup()
{
arch_di();
Expand Down Expand Up @@ -72,30 +72,12 @@ void arch_wfi()
asm volatile("sleep");
}

/**
* arch_machine_call - perform machine call
*
* @brief This function emulates the machine
* call to maintain consistency.
*
* @param[in] code: machine call code
* @param[in] a0: first argument
* @param[in] a1: second argument
* @param[in] a2: third argument
* @param[in] *ret: return value
*/
void arch_machine_call(unsigned int code, unsigned int a0, unsigned int a1, unsigned int a2, mret_t *ret)
{
if(ret == NULL)
return;
machine_call(code, a0, a1, a2, ret);
return;
}

void _NORETURN arch_panic_handler_callback()
{
context_frame_t *frame;
frame = get_context_frame();
if(!frame)
goto panic;
syslog_stdout_enable();
sysdbg("r0=%p\tr1=%p\tr2=%p\tr3=%p\tr4=%p\tr5=%p\n",
frame->r0, frame->r1, frame->r2, frame->r3, frame->r4, frame->r5);
Expand All @@ -112,5 +94,6 @@ void _NORETURN arch_panic_handler_callback()
#if DEBUG==0
syslog(info, "SP=%p\tSREG = %p\n", frame, frame->sreg);
#endif
panic:
while(1) arch_wfi();
}
4 changes: 2 additions & 2 deletions src/arch/avr/8/common_5x_6/terravisor/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
*/
function entry
cli
ldi r18, lo8(stack_start)
ldi r18, lo8(_stack_end)
ldi r30, SPL
st Z, r18
ldi r18, hi8(stack_start)
ldi r18, hi8(_stack_end)
ldi r30, SPH
st Z, r18
eor r18, r18
Expand Down
31 changes: 22 additions & 9 deletions src/arch/avr/8/common_5x_6/terravisor/include/arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <plat_arch.h>
#include <avr.h>
#include <mmio.h>
#include <machine_call.h>

/**
* arch_early_setup - This needs to be called in early stages of boot
Expand All @@ -38,15 +39,6 @@ void arch_ei_restore_state(istate_t *);
*/
void arch_panic_handler();

#ifdef _MACHINE_CALL_H_
/**
* arch_machine_call - Performs machine call
*
* Refer arch.c for more details.
*/
void arch_machine_call(call_arg_t, call_arg_t, call_arg_t, call_arg_t, mret_t *);
#endif

/**
* arch_register_interrupt_handler - Registers interrtup handler
* for arch specific interrupt vectors
Expand All @@ -62,6 +54,27 @@ static inline unsigned int arch_core_index()
return 0;
}

/**
* arch_machine_call - perform machine call
*
* @brief This function emulates the machine
* call to maintain consistency.
*
* @param[in] code: machine call code
* @param[in] a0: first argument
* @param[in] a1: second argument
* @param[in] a2: third argument
* @param[in] *ret: return value
*/
static inline void arch_machine_call(unsigned int code, unsigned int a0, unsigned int a1, unsigned int a2, mret_t *ret)
{
extern void (*const p_mcall)(unsigned int, unsigned int, unsigned int, unsigned int, mret_t*);
if(ret == NULL)
return;
p_mcall(code, a0, a1, a2, ret);
return;
}

/**
* arch_ei - arch enable global interrupts
*/
Expand Down
5 changes: 1 addition & 4 deletions src/arch/avr/8/common_5x_6/terravisor/interrupt_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,9 @@ void interrupt_handler(unsigned char id, context_frame_t *frame)
}


/* Fixed memory block of 33 bytes on bss */
context_frame_t snapshot_frame;

context_frame_t *get_context_frame()
{
if(local_frame)
return local_frame;
return &snapshot_frame;
return NULL;
}
27 changes: 0 additions & 27 deletions src/arch/avr/8/common_5x_6/terravisor/stack.S

This file was deleted.

27 changes: 0 additions & 27 deletions src/arch/riscv/32/i/terravisor/arch.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,33 +95,6 @@ void arch_ei_restore_state(istate_t *istate)
asm volatile("csrs mie, %0" : : "r" (*istate));
}

/**
* arch_machine_call - perform machine call
*
* @brief This function performs environment call
* in m mode
*
* @param[in] code: machine call code
* @param[in] a0: first argument
* @param[in] a1: second argument
* @param[in] a2: third argument
* @param[in] *ret: return struct
*/
void arch_machine_call(unsigned int code, unsigned int a0, unsigned int a1, unsigned int a2, mret_t *ret)
{
if(ret == NULL)
return;
asm volatile("mv a0, %0" : : "r" (code));
asm volatile("mv a1, %0" : : "r" (a0));
asm volatile("mv a2, %0" : : "r" (a1));
asm volatile("mv a3, %0" : : "r" (a2));
asm volatile("ecall");
asm volatile("mv %0, a0" : "=r" (ret->p));
asm volatile("mv %0, a1" : "=r" (ret->size));
asm volatile("mv %0, a2" : "=r" (ret->status));
return;
}

_WEAK void arch_panic_handler()
{
const context_frame_t *frame = get_context_frame();
Expand Down
37 changes: 30 additions & 7 deletions src/arch/riscv/32/i/terravisor/include/arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,6 @@ void arch_early_signal_boot_start();
void arch_wait_till_boot_done();
void arch_signal_boot_done();

/**
* arch_machine_call - Performs machine call
*
* Refer arch.c for more details.
*/
void arch_machine_call(unsigned int, unsigned int, unsigned int, unsigned int, mret_t *);

/**
* arch_register_interrupt_handler - Registers interrtup handler
* for arch specific exception vectors
Expand All @@ -67,6 +60,36 @@ static inline unsigned int arch_core_index()
return id;
}

/**
* arch_machine_call - perform machine call
*
* @brief This function performs environment call
* in m mode
*
* @param[in] code: machine call code
* @param[in] a0: first argument
* @param[in] a1: second argument
* @param[in] a2: third argument
* @param[in] *ret: return struct
*/
static inline void arch_machine_call(unsigned int code, unsigned int arg0, unsigned int arg1, unsigned int arg2, mret_t *ret)
{
if(ret == NULL)
return;
register uint32_t a0 asm("a0") = code;
register uint32_t a1 asm("a1") = arg0;
register uint32_t a2 asm("a2") = arg1;
register uint32_t a3 asm("a3") = arg2;
asm volatile("ecall"
: "+r" (a0), "+r" (a1), "+r"(a2)
: "r" (a0), "r" (a1), "r" (a2), "r" (a3)
: "memory");
ret->p = a0;
ret->size = a1;
ret->status = a2;
return;
}

/**
* arch_ei - arch enable global interrupts
*/
Expand Down
2 changes: 0 additions & 2 deletions src/driver/build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

DRIVER_PATH := $(GET_PATH)

LD_SUPPLEMENT += $(DRIVER_PATH)/driver.ld.sx

#==========< Essentials Drivers >==========#
include $(DRIVER_PATH)/interrupt/build.mk
include $(DRIVER_PATH)/watchdog/build.mk
Expand Down
Loading