Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
asee
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
Package registry
Model registry
Operate
Environments
Terraform modules
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
Valentin Bout
asee
Commits
47944436
Commit
47944436
authored
1 year ago
by
root
Browse files
Options
Downloads
Patches
Plain Diff
pipebis3.ko working
parent
d10977af
Branches
main
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
work/tp3/pipebis3.c
+8
-13
8 additions, 13 deletions
work/tp3/pipebis3.c
work/tp3/pipebis3.mod.c
+2
-2
2 additions, 2 deletions
work/tp3/pipebis3.mod.c
with
10 additions
and
15 deletions
work/tp3/pipebis3.c
+
8
−
13
View file @
47944436
...
...
@@ -211,7 +211,7 @@ static int block_empty_buff(void)
}
if
(
is_sig
)
{
module_put
(
THIS_MODULE
);
//
module_put(THIS_MODULE);
return
-
1
;
}
...
...
@@ -270,6 +270,11 @@ static ssize_t device_read(struct file *filp, /* see include/linux/fs.h */
mutex_unlock
(
&
asse_buf_count_mutex
);
wake_up
(
&
wait_full
);
if
(
asee_buf_count
<=
0
)
{
pr_info
(
"Read blocked
\n
"
);
if
(
block_empty_buff
()
<
0
)
return
0
;
}
}
*
offset
=
last_read_bytes
;
...
...
@@ -292,7 +297,7 @@ static int block_full_buff(void)
}
if
(
is_sig
)
{
module_put
(
THIS_MODULE
);
//
module_put(THIS_MODULE);
return
-
1
;
}
}
...
...
@@ -328,9 +333,9 @@ static ssize_t device_write(struct file *filp, const char __user *buff,
//pr_info("Waking up empty\n");
wake_up
(
&
wait_empty
);
asee_buf_count
++
;
if
(
asee_buf_count
<
asee_buf_size
)
{
//pr_info("asee_buf_count++;\n");
asee_buf_count
++
;
mutex_unlock
(
&
asse_buf_count_mutex
);
}
else
{
//pr_info("atomic_set(&already_full, 1); \n");
...
...
@@ -340,16 +345,6 @@ static ssize_t device_write(struct file *filp, const char __user *buff,
}
}
mutex_lock
(
&
asse_buf_count_mutex
);
// Le probleme est ici, cela donne zero au debut
pr_info
(
"last_read_bytes: %d"
,
last_read_bytes
);
// We change asee_buf_size :TODO handle modulo
last_read_bytes
=
(
last_read_bytes
+
bytes_writen
)
%
asee_buf_size
;
pr_info
(
"bytes_writen: %d"
,
bytes_writen
);
pr_info
(
"asee_buf_count: %d"
,
asee_buf_count
);
pr_info
(
"Last read byte update to: %d"
,
last_read_bytes
);
mutex_unlock
(
&
asse_buf_count_mutex
);
*
off
=
last_writen_bytes
;
return
bytes_writen
;
...
...
This diff is collapsed.
Click to expand it.
work/tp3/pipebis3.mod.c
+
2
−
2
View file @
47944436
...
...
@@ -35,7 +35,6 @@ MODULE_INFO(retpoline, "Y");
static
const
struct
modversion_info
____versions
[]
__used
__section
(
"__versions"
)
=
{
{
0x1000e51
,
"schedule"
},
{
0x8c26d495
,
"prepare_to_wait_event"
},
{
0x92540fbf
,
"finish_wait"
},
{
0xf0fdf6cb
,
"__stack_chk_fail"
},
...
...
@@ -66,10 +65,11 @@ __used __section("__versions") = {
{
0x3213f038
,
"mutex_unlock"
},
{
0xe2c17b5d
,
"__SCT__might_resched"
},
{
0xfe487975
,
"init_wait_entry"
},
{
0x1000e51
,
"schedule"
},
{
0x76800044
,
"module_layout"
},
};
MODULE_INFO
(
depends
,
""
);
MODULE_INFO
(
srcversion
,
"
D65D0B5D00F7B86A769F376
"
);
MODULE_INFO
(
srcversion
,
"
331261CAA2C80075E1CB7DD
"
);
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