Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into ospp
Browse files Browse the repository at this point in the history
  • Loading branch information
codeironman committed Nov 7, 2024
2 parents 2709fac + 01b8a76 commit 173ec35
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 24 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/makefile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ jobs:
name: Format check ${{ matrix.arch }}
runs-on: ubuntu-latest
continue-on-error: true
container: dragonos/dragonos-dev:v1.4
container: dragonos/dragonos-dev:v1.5

strategy:
matrix:
arch: [x86_64, riscv64]

steps:
- run: echo "Running in dragonos/dragonos-dev:v1.4"
- run: echo "Running in dragonos/dragonos-dev:v1.5"
- uses: actions/checkout@v3

- name: Format check
Expand All @@ -35,14 +35,14 @@ jobs:
name: Kernel static test ${{ matrix.arch }}
runs-on: ubuntu-latest
continue-on-error: true
container: dragonos/dragonos-dev:v1.4
container: dragonos/dragonos-dev:v1.5

strategy:
matrix:
arch: [x86_64, riscv64]

steps:
- run: echo "Running in dragonos/dragonos-dev:v1.4"
- run: echo "Running in dragonos/dragonos-dev:v1.5"

- uses: actions/checkout@v3

Expand All @@ -56,10 +56,10 @@ jobs:
build-x86_64:

runs-on: ubuntu-latest
container: dragonos/dragonos-dev:v1.4
container: dragonos/dragonos-dev:v1.5

steps:
- run: echo "Running in dragonos/dragonos-dev:v1.4"
- run: echo "Running in dragonos/dragonos-dev:v1.5"

- uses: actions/checkout@v3
- name: build the DragonOS
Expand All @@ -78,10 +78,10 @@ jobs:
build-riscv64:

runs-on: ubuntu-latest
container: dragonos/dragonos-dev:v1.4
container: dragonos/dragonos-dev:v1.5

steps:
- run: echo "Running in dragonos/dragonos-dev:v1.4"
- run: echo "Running in dragonos/dragonos-dev:v1.5"

- uses: actions/checkout@v3
with:
Expand Down
37 changes: 23 additions & 14 deletions kernel/src/filesystem/eventfd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use crate::libs::spinlock::{SpinLock, SpinLockGuard};
use crate::libs::wait_queue::WaitQueue;
use crate::net::event_poll::{EPollEventType, EPollItem, EventPoll, KernelIoctlData};
use crate::process::ProcessManager;
use crate::sched::SchedMode;
use crate::syscall::Syscall;
use alloc::collections::LinkedList;
use alloc::string::String;
Expand Down Expand Up @@ -76,6 +77,11 @@ impl EventFdInode {

Err(SystemError::ENOENT)
}

fn readable(&self) -> bool {
let count = self.eventfd.lock().count;
return count > 0;
}
}

impl IndexNode for EventFdInode {
Expand Down Expand Up @@ -104,26 +110,29 @@ impl IndexNode for EventFdInode {
_offset: usize,
len: usize,
buf: &mut [u8],
data: SpinLockGuard<FilePrivateData>,
data_guard: SpinLockGuard<FilePrivateData>,
) -> Result<usize, SystemError> {
let data = data_guard.clone();
drop(data_guard);
if len < 8 {
return Err(SystemError::EINVAL);
}
let mut val = loop {
let val = self.eventfd.lock().count;
if val != 0 {
break val;
}
if self
.eventfd
.lock()
.flags
.contains(EventFdFlags::EFD_NONBLOCK)
{
let mut lock_efd = self.eventfd.lock();
while lock_efd.count == 0 {
if lock_efd.flags.contains(EventFdFlags::EFD_NONBLOCK) {
drop(lock_efd);
return Err(SystemError::EAGAIN_OR_EWOULDBLOCK);
}
self.wait_queue.sleep();
};

drop(lock_efd);
let r = wq_wait_event_interruptible!(self.wait_queue, self.readable(), {});
if r.is_err() {
return Err(SystemError::ERESTARTSYS);
}

lock_efd = self.eventfd.lock();
}
let mut val = lock_efd.count;

let mut eventfd = self.eventfd.lock();
if eventfd.flags.contains(EventFdFlags::EFD_SEMAPHORE) {
Expand Down
1 change: 1 addition & 0 deletions kernel/src/process/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ use crate::{
VirtAddr,
},
namespaces::{mnt_namespace::FsStruct, pid_namespace::PidStrcut, NsProxy},
namespaces::{mnt_namespace::FsStruct, pid_namespace::PidStrcut, NsProxy},
net::socket::SocketInode,
sched::{
completion::Completion, cpu_rq, fair::FairSchedEntity, prio::MAX_PRIO, DequeueFlag,
Expand Down
2 changes: 1 addition & 1 deletion tools/BUILD_CONTAINER_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.4
v1.5
16 changes: 16 additions & 0 deletions tools/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
#!/bin/bash

CONFIG_FILE=~/.cargo/config.toml

change_rust_src_to_official() {
echo -e "[source.crates-io] \n \
registry = \"sparse+https://index.crates.io/\" \n \
[net] \n \
git-fetch-with-cli = true \n \
" > $CONFIG_FILE
}

# Check if the GITHUB_WORKFLOW environment variable is set and not empty
if [ -n "$GITHUB_ACTION" ]; then
change_rust_src_to_official
fi


exec "$@"
2 changes: 1 addition & 1 deletion user/dadk/config/nova_shell-0.1.0.dadk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"BuildFromSource": {
"Git": {
"url": "https://git.mirrors.dragonos.org.cn/DragonOS-Community/NovaShell.git",
"revision": "7bb802ad1e"
"revision": "cb835e03e4"
}
}
},
Expand Down

0 comments on commit 173ec35

Please sign in to comment.