Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Remoteproc SHM driver
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CaroloCup
Remoteproc SHM driver
Commits
2f546191
Commit
2f546191
authored
6 years ago
by
Aljoscha Wißfeld
Browse files
Options
Downloads
Patches
Plain Diff
poll implemented but not tested
parent
275ea0d7
No related branches found
Branches containing commit
No related tags found
2 merge requests
!7
Multithreads enabled
,
!6
Select
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
remoteproc-shm.c
+24
-4
24 additions, 4 deletions
remoteproc-shm.c
with
24 additions
and
4 deletions
remoteproc-shm.c
+
24
−
4
View file @
2f546191
...
...
@@ -9,8 +9,6 @@
* (at your option) any later version.
*/
/* kern_select() */
#include
<linux/debugfs.h>
#include
<linux/err.h>
#include
<linux/fs.h>
...
...
@@ -32,10 +30,14 @@
#include
<linux/interrupt.h>
#include
<linux/delay.h>
#include
<linux/wait.h>
#include
<stdbool.h>
#define DRIVER_NAME "remoteproc-shm"
#define SHM_SIZE 0x800000
/* TODO: Semaphore */
struct
rproc_shm_device
{
struct
device
*
dev
;
struct
mbox_chan
*
mbox_channel
;
...
...
@@ -46,11 +48,14 @@ struct rproc_shm_device {
struct
device
*
cdev
;
int
major
;
struct
fasync_struct
*
async_queue
;
bool
interrupted
;
//sem_t sem;
};
struct
class
*
rproc_class
=
NULL
;
struct
rproc_shm_device
*
dev
;
static
struct
dentry
*
root_debugfs_dir
;
static
wait_queue_head_t
*
wait_queue
;
static
void
rproc_shm_receive_message
(
struct
mbox_client
*
client
,
void
*
message
)
{
...
...
@@ -63,10 +68,15 @@ static void rproc_shm_receive_message(struct mbox_client *client, void *message)
if
(
dev
->
async_queue
)
{
dev_info
(
client
->
dev
,
"dev->async_queue == True
\n
"
);
kill_fasync
(
&
dev
->
async_queue
,
SIGIO
,
POLL_IN
);
dev_info
(
client
->
dev
,
"After kill_fasync
\n
"
);
}
else
{
dev_info
(
client
->
dev
,
"dev->async_queue == FALSE
\n
"
);
}
dev
->
interrupted
=
true
;
wake_up_interruptible
(
wait_queue
);
}
static
void
rproc_shm_message_sent
(
struct
mbox_client
*
client
,
void
*
message
,
int
r
)
...
...
@@ -211,9 +221,17 @@ static int rproc_shm_fasync(int fd, struct file *filp, int mode)
static
unsigned
int
rproc_shm_poll
(
struct
file
*
filp
,
struct
poll_table_struct
*
poll_table
)
{
unsigned
int
mask
=
0
;
printk
(
KERN_INFO
"rproc_shm_poll"
);
poll_wait
(
filp
,
wait_queue
,
poll_table
);
return
0
;
dev
->
interrupted
=
false
;
mask
|=
POLLIN
|
POLLRDNORM
;
/* readable */
return
mask
;
}
static
int
rproc_shm_open
(
struct
inode
*
i
,
struct
file
*
filp
)
...
...
@@ -327,6 +345,8 @@ static int rproc_shm_probe(struct platform_device *pdev)
dev
->
shm_addr
=
virt_addr
;
dev
->
dma_handle
=
dma
;
init_waitqueue_head
(
wait_queue
);
ret
=
rproc_shm_add_debugfs
(
pdev
,
dev
);
if
(
ret
)
return
ret
;
...
...
@@ -361,7 +381,7 @@ static int rproc_shm_remove(struct platform_device *pdev)
dev_info
(
&
pdev
->
dev
,
"ADDRESS OF PTR: %p
\n
"
,
virt_addr
);
dev_info
(
&
pdev
->
dev
,
"ADDRESS OF DMA: %x
\n
"
,
dma
);
/* reset fasync
/* reset fasync
rproc_shm_fasync(-1, filp, 0);
*/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment