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

Temporary workaround for GNU GCC issue #36 #113

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,29 @@ __attribute__((interrupt ("machine"))) void u_sw_direct_irq_handler(void) {
"j u_sw_irq_handler\n"
);

#ifdef FPU
#define MSTATUS_FS_INITIAL 0x00002000

void fp_enable ()
{
unsigned int fs = MSTATUS_FS_INITIAL;

asm volatile("csrs mstatus, %0;"
"csrwi fcsr, 0;"
"csrs mstatus, %0;"
: : "r"(fs)
);
}
#endif

int main(int argc, char *argv[]) {
int retval;

#ifdef FPU
// Floating Point enable
fp_enable();
#endif

// Test 1
retval = test1();
if (retval != EXIT_SUCCESS)
Expand Down