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
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
Merged
Use inter-core API for pycardium IO
rahix/use-api
into
master
Overview
0
Commits
3
Pipelines
2
Changes
12
Merged
rahix
requested to merge
rahix/use-api
into
master
5 years ago
Overview
0
Commits
3
Pipelines
2
Changes
12
Expand
0
0
Merge request reports
Compare
master
version 1
128e627d
5 years ago
master (base)
and
latest version
latest version
886472d0
3 commits,
5 years ago
version 1
128e627d
2 commits,
5 years ago
12 files
+
449
−
11
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
12
Search (e.g. *.vue) (Ctrl+P)
epicardium/api/caller.c
0 → 100644
+
39
−
0
Options
#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