-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #287 from VisorFolks/development
<1.4.1> Release Update
- Loading branch information
Showing
45 changed files
with
1,038 additions
and
364 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,6 @@ | |
# | ||
|
||
COMPILER := gcc | ||
TC_VER := 5.4.0 | ||
FAMILY := mega_avr | ||
PLATFORM := atmega328p | ||
STDLOG_MEMBUF := 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,6 @@ | |
# | ||
|
||
COMPILER := gcc | ||
TC_VER := 5.4.0 | ||
FAMILY := mega_avr | ||
PLATFORM := atmega328p | ||
STDLOG_MEMBUF := 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,6 @@ | |
# | ||
|
||
COMPILER := gcc | ||
TC_VER := 5.4.0 | ||
FAMILY := mega_avr | ||
PLATFORM := atmega328p | ||
HEAP_SIZE := 500 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,6 @@ | |
# | ||
|
||
COMPILER := gcc | ||
TC_VER := 10.2.0 | ||
FAMILY := sifive | ||
PLATFORM := fe310g002 | ||
HEAP_SIZE := 3K | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,6 @@ | |
# | ||
|
||
COMPILER := gcc | ||
TC_VER := 10.2.0 | ||
FAMILY := sifive | ||
PLATFORM := qemu-sifive-e | ||
STDLOG_MEMBUF := 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,6 @@ | |
# | ||
|
||
COMPILER := gcc | ||
TC_VER := 10.2.0 | ||
FAMILY := sifive | ||
PLATFORM := fe310g002 | ||
STDLOG_MEMBUF := 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,6 @@ | |
# | ||
|
||
COMPILER := gcc | ||
TC_VER := 10.2.0 | ||
FAMILY := sifive | ||
PLATFORM := fe310g002-bl | ||
STDLOG_MEMBUF := 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,6 @@ | |
# | ||
|
||
COMPILER := gcc | ||
TC_VER := 10.2.0 | ||
FAMILY := sifive | ||
PLATFORM := qemu-sifive-e-bl | ||
USE_FLOAT := 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
/* | ||
* CYANCORE LICENSE | ||
* Copyrights (C) 2019, Cyancore Team | ||
* Copyrights (C) 2024, Cyancore Team | ||
* | ||
* File Name : arch.c | ||
* Description : This file consists of architecture specific function that | ||
* cannot be inlined. Hence, present in c file. | ||
* Primary Author : Mayuri Lokhande [[email protected]] | ||
* Primary Author : Mayuri Lokhande [[email protected]], | ||
* Akash Kollipara [[email protected]] | ||
* Organisation : Cyancore Core-Team | ||
*/ | ||
|
||
|
@@ -14,21 +15,50 @@ | |
#include <assert.h> | ||
#include <status.h> | ||
#include <syslog.h> | ||
#include <mmio.h> | ||
#include <arch.h> | ||
#include <interrupt.h> | ||
#include <visor/workers.h> | ||
#include <rand.h> | ||
#include <lock/lock.h> | ||
|
||
static void arch_ecall_handler() | ||
/** | ||
* arch_vcall_handler | ||
* | ||
* @brief This function handles svc calls. In Cyancore all exception calls | ||
* will be called as visor-calls. | ||
*/ | ||
static void arch_vcall_handler() | ||
{ | ||
context_frame_t *frame = get_context_frame(); | ||
vret_t vres; | ||
machine_call(frame->r0, frame->r1, frame->r3, &vres); | ||
vcall_handler(frame->r0, frame->r1, frame->r2, frame->r3, &vres); | ||
frame->r0 = vres.p; | ||
frame->r1 = vres.size; | ||
frame->r2 = vres.status; | ||
return; | ||
} | ||
|
||
/* This the key for boot lock */ | ||
static lock_t boot_key = LOCK_INITAL_VALUE; | ||
void arch_early_signal_boot_start() | ||
{ | ||
boot_key = LOCK_INITAL_VALUE; | ||
return; | ||
} | ||
|
||
void arch_wait_till_boot_done() | ||
{ | ||
lock_acquire(&boot_key); | ||
lock_release(&boot_key); | ||
return; | ||
} | ||
|
||
void arch_signal_boot_done() | ||
{ | ||
lock_release(&boot_key); | ||
return; | ||
} | ||
|
||
/** | ||
*arch_early_setup - This function is called in the early stages of boot | ||
* | ||
|
@@ -38,7 +68,6 @@ static void arch_ecall_handler() | |
void arch_early_setup() | ||
{ | ||
arch_di(); | ||
|
||
} | ||
|
||
/** | ||
|
@@ -48,15 +77,15 @@ void arch_early_setup() | |
*/ | ||
void arch_setup() | ||
{ | ||
link_interrupt(int_arch, 10 ,&arch_vcall_handler); | ||
return; | ||
} | ||
|
||
void arch_di_save_state(istate_t *sreg_i_backup) | ||
void arch_di_save_state(istate_t *istate _UNUSED) | ||
{ | ||
* | ||
} | ||
|
||
void arch_ei_restore_state(istate_t *sreg_i_backup) | ||
void arch_ei_restore_state(istate_t *istate _UNUSED) | ||
{ | ||
|
||
} | ||
|
@@ -77,14 +106,12 @@ void _NORETURN arch_panic_handler_callback() | |
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); | ||
sysdbg("r6=%p\tr7=%p\tr8=%p\tr9=%p\tr10=%p\tr11=%p\n", | ||
frame->r6, frame->r7, frame->r8, frame->r9, frame->r10, frame->r11); | ||
sysdbg("r12=%p\tr13=%p\tr14=%p\tr15=%p\tAPSR=%p\n", | ||
frame->r12, frame->r13, frame->r14, frame->r15, frame->apsr); | ||
sysdbg("r0=%p\tr1=%p\tr2=%p\tr3=%p\n", | ||
frame->r0, frame->r1, frame->r2, frame->r3); | ||
sysdbg("r12=%p\tLR=%p\tPSR=%p\tReturns To=%p\n", | ||
frame->r12, frame->lr, frame->psr, frame->ret_addr); | ||
#if DEBUG==0 | ||
syslog(info, "APSR=%p\n", frame->apsr); | ||
syslog(info, "PSR=%p\n", frame->psr); | ||
#endif | ||
panic: | ||
while(1) arch_wfi(); | ||
|
@@ -132,3 +159,28 @@ void arch_signal_resume(void) | |
{ | ||
sleep_flag = resume; | ||
} | ||
|
||
/** | ||
* arch_rseed_capture | ||
* | ||
* @brief This function is intended to capture unique seed value | ||
*/ | ||
void arch_rseed_capture() | ||
{ | ||
extern uintptr_t *_bss_start; | ||
srand((size_t)_bss_start); | ||
} | ||
|
||
_WEAK void arch_panic_handler() | ||
{ | ||
syslog_stdout_enable(); | ||
syslog(fail, "Arch Panic!\n"); | ||
arch_panic_handler_callback(); | ||
} | ||
|
||
_WEAK void arch_unhandled_irq() | ||
{ | ||
syslog_stdout_enable(); | ||
syslog(fail, "Arch Unhandled IRQ!\n"); | ||
arch_panic_handler_callback(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* CYANCORE LICENSE | ||
* Copyrights (C) 2024, Cyancore Team | ||
* | ||
* File Name : arch_verctors.S | ||
* Description : This file consists of array of vector table | ||
* specific to arm-m proile. | ||
* Primary Author : Akash Kollipara [[email protected]] | ||
* Organisation : Cyancore Core-Team | ||
*/ | ||
|
||
#include <asm.inc> | ||
|
||
object arch_vectors | ||
.word _stack_start | ||
.word init | ||
|
||
.set i, 1 | ||
.rept (N_EXCEP + N_IRQ) | ||
.word isr | ||
.set i, i+1 | ||
.endr |
Oops, something went wrong.