-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'development' into cc-kernel-dev
- Loading branch information
Showing
40 changed files
with
1,303 additions
and
49 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,18 +5,21 @@ pipeline { | |
stage('tc check') { | ||
steps { | ||
sh 'make get_avr_tc [email protected]:VisorFolks/avr-toolchain.git' | ||
sh 'make get_riscv_tc [email protected]:VisorFolks/risc-v-toolchain.git' | ||
} | ||
} | ||
stage('check') { | ||
steps { | ||
sh 'make demo_avr check' | ||
sh 'make demo_avr_cpp check' | ||
sh 'make demo_riscv check' | ||
} | ||
} | ||
stage('build') { | ||
steps { | ||
sh 'make demo_avr clean default' | ||
sh 'make demo_avr_cpp clean default' | ||
sh 'make demo_riscv clean default' | ||
} | ||
} | ||
stage('clean') { | ||
|
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,16 @@ | ||
# | ||
# CYANCORE LICENSE | ||
# Copyrights (C) 2019, Cyancore Team | ||
# | ||
# File Name : copy_to_target.mk | ||
# Description : This file has build target to copy to | ||
# remote machine if any | ||
# Primary Author : Akash Kollipara [[email protected]] | ||
# Organisation : Cyancore Core-Team | ||
# | ||
|
||
--cpremote: $(ELF) | ||
@echo "< ! > Please add your commands here..." | ||
|
||
--rmremote: | ||
@echo "< ! > Please add your commands here..." |
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
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,14 @@ | ||
# | ||
# CYANCORE LICENSE | ||
# Copyrights (C) 2019, Cyancore Team | ||
# | ||
# File Name : build.mk | ||
# Description : Build script for this directory. | ||
# Primary Authod : Akash Kollipara [[email protected]] | ||
# Organisation : Cyancore Core-Team | ||
# | ||
|
||
RV32IA_ARCH_DIR := $(GET_PATH) | ||
|
||
DIR := $(RV32IA_ARCH_DIR) | ||
include mk/obj.mk |
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,35 @@ | ||
/* | ||
* CYANCORE LICENSE | ||
* Copyrights (C) 2019, Cyancore Team | ||
* | ||
* File Name : spinlock.c | ||
* Description : This file consists of sources of spinlock | ||
* Primary Author : Akash Kollipara [[email protected]] | ||
* Organisation : Cyancore Core-Team | ||
*/ | ||
|
||
#include <stdint.h> | ||
#include <status.h> | ||
#include <arch.h> | ||
#include <lock/lock.h> | ||
|
||
void spinlock_acquire(spinlock_t *key) | ||
{ | ||
unsigned int old, new; | ||
new = 1; | ||
while(1) | ||
{ | ||
if(*key) | ||
continue; | ||
asm volatile("amoswap.w %0, %2, %1" : "=r" (old), "+A" (*key) : "r" (new) : "memory"); | ||
fence(r, rw); | ||
if(!old) | ||
break; | ||
} | ||
} | ||
|
||
void spinlock_release(spinlock_t *key) | ||
{ | ||
fence(r, rw); | ||
*key = 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 |
---|---|---|
@@ -0,0 +1,91 @@ | ||
/* | ||
* CYANCORE LICENSE | ||
* Copyrights (C) 2019, 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 : Akash Kollipara [[email protected]] | ||
* Organisation : Cyancore Core-Team | ||
*/ | ||
|
||
#include <stdint.h> | ||
#include <status.h> | ||
#include <stdio.h> | ||
#include <arch.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 arch_early_setup() | ||
{ | ||
arch_di(); | ||
riscv_update_vector(); | ||
return; | ||
} | ||
|
||
/** | ||
* arch_setup - This function is called after initial setup is done | ||
* | ||
* @brief This function is called after initial setup is done. | ||
*/ | ||
void arch_setup() | ||
{ | ||
return; | ||
} | ||
|
||
void arch_di_save_state() | ||
{ | ||
} | ||
|
||
void arch_ei_restore_state() | ||
{ | ||
} | ||
|
||
/** | ||
* 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() | ||
{ | ||
context_frame_t *frame = get_context_frame(); | ||
printf("< x > Arch Panic!\n"); | ||
printf("Info:\nCause\t: 0x%x\t Address\t: 0x%x\n", frame->mcause, frame->mepc); | ||
while(1) | ||
arch_wfi(); | ||
} | ||
|
||
_WEAK void arch_unhandled_irq() | ||
{ | ||
context_frame_t *frame = get_context_frame(); | ||
printf("< x > Arch Unhandled IRQ!\n"); | ||
printf("Info:\nIRQ ID\t: 0x%x\n", frame->mcause & ~(1U << 31)); | ||
while(1) | ||
arch_wfi(); | ||
} |
Oops, something went wrong.