Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
card10
firmware
Merge requests
!6
Use inter-core API for pycardium IO
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
Use inter-core API for pycardium IO
rahix/use-api
into
master
Overview
0
Commits
3
Pipelines
2
Changes
12
Merged
Use inter-core API for pycardium IO
rahix
requested to merge
rahix/use-api
into
master
Jun 18, 2019
Overview
0
Commits
3
Pipelines
2
Changes
12
0
0
Merge request reports
Compare
master
version 1
128e627d
Jun 18, 2019
master (base)
and
latest version
latest version
886472d0
3 commits,
Jun 18, 2019
version 1
128e627d
2 commits,
Jun 18, 2019
12 files
+
449
−
11
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
12
epicardium/api/caller.c
0 → 100644
+
39
−
0
View file @ 886472d0
Edit in single-file editor
Open in Web IDE
#include
<stdlib.h>
#include
"sema.h"
#include
"api/caller.h"
void
*
_api_call_start
(
api_id_t
id
,
uintptr_t
size
)
{
while
(
SEMA_GetSema
(
_API_SEMAPHORE
)
==
E_BUSY
)
{}
/* TODO: Check flag */
API_CALL_MEM
->
id
=
id
;
return
API_CALL_MEM
->
buffer
;
}
void
*
_api_call_transact
(
void
*
buffer
)
{
API_CALL_MEM
->
call_flag
=
_API_FLAG_CALLING
;
SEMA_FreeSema
(
_API_SEMAPHORE
);
/* Notify the dispather of the new call */
__SEV
();
__WFE
();
while
(
1
)
{
/* Wait for the dispather to return */
__WFE
();
while
(
SEMA_GetSema
(
_API_SEMAPHORE
)
==
E_BUSY
)
{}
if
(
API_CALL_MEM
->
call_flag
==
_API_FLAG_RETURNED
)
{
break
;
}
SEMA_FreeSema
(
_API_SEMAPHORE
);
}
API_CALL_MEM
->
call_flag
=
_API_FLAG_IDLE
;
SEMA_FreeSema
(
_API_SEMAPHORE
);
return
API_CALL_MEM
->
buffer
;
}
Loading