Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TP_xv6
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
Container 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
Fache Charles
TP_xv6
Commits
ef1dd479
Commit
ef1dd479
authored
1 year ago
by
Fache Charles
Browse files
Options
Downloads
Patches
Plain Diff
4.4 tests don't pass but kernel compiles, remains at least initializing the sleeplock
parent
93f98762
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
kernel/file.c
+2
-1
2 additions, 1 deletion
kernel/file.c
kernel/sysfile.c
+62
-1
62 additions, 1 deletion
kernel/sysfile.c
with
64 additions
and
2 deletions
kernel/file.c
+
2
−
1
View file @
ef1dd479
...
...
@@ -25,7 +25,8 @@ fileinit(void)
initlock
(
&
ftable
.
lock
,
"ftable"
);
}
// Allocate a file structure.
// Allocate a file structure, returns 0 if
// none was found free
struct
file
*
filealloc
(
void
)
{
...
...
This diff is collapsed.
Click to expand it.
kernel/sysfile.c
+
62
−
1
View file @
ef1dd479
...
...
@@ -486,7 +486,68 @@ sys_pipe(void)
uint64
sys_create_mutex
(
void
)
{
return
-
1
;
// char path[MAXPATH];
int
fd
;
//, omode;
struct
file
*
f
;
// struct inode *ip;
// int n;
// if((n = argstr(0, path, MAXPATH)) < 0 || argint(1, &omode) < 0)
// return -1;
// begin_op(ROOTDEV);
// if(omode & O_CREATE){
// ip = create(path, T_FILE, 0, 0); //?
// if(ip == 0){
// end_op(ROOTDEV);
// return -1;
// }
// } else {
// if((ip = namei(path)) == 0){
// end_op(ROOTDEV);
// return -1;
// }
// ilock(ip);
// if(ip->type == T_DIR && omode != O_RDONLY){
// iunlockput(ip);
// end_op(ROOTDEV);
// return -1;
// }
// }
// if(ip->type == T_DEVICE && (ip->major < 0 || ip->major >= NDEV)){
// iunlockput(ip);
// end_op(ROOTDEV);
// return -1;
// }
if
((
f
=
filealloc
())
==
0
||
(
fd
=
fdalloc
(
f
))
<
0
){
if
(
f
)
fileclose
(
f
);
// iunlockput(ip);
// end_op(ROOTDEV);
return
-
1
;
}
// if(ip->type == T_DEVICE){
// f->type = FD_DEVICE;
// f->major = ip->major;
// f->minor = ip->minor;
// } else {
// f->type = FD_INODE;
// }
// f->ip = ip;
// f->off = 0;
// f->readable = !(omode & O_WRONLY);
// f->writable = (omode & O_WRONLY) || (omode & O_RDWR);
f
->
type
=
FD_MUTEX
;
// iunlock(ip);
// end_op(ROOTDEV);
return
fd
;
}
uint64
...
...
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