-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add environ functions #3
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
smp = 1 | ||
build_mode = release | ||
log_level = info | ||
|
||
Primary CPU 0 started. | ||
Found physcial memory regions: | ||
.text (READ | EXECUTE | RESERVED) | ||
.rodata (READ | RESERVED) | ||
.data .tdata .tbss .percpu (READ | WRITE | RESERVED) | ||
boot stack (READ | WRITE | RESERVED) | ||
.bss (READ | WRITE | RESERVED) | ||
free memory (READ | WRITE | FREE) | ||
Initialize global memory allocator... | ||
use TLSF allocator. | ||
Initialize kernel page table... | ||
Initialize platform devices... | ||
Primary CPU 0 init OK. | ||
Running argv tests... | ||
Argv tests run OK! | ||
Running environ tests... | ||
Environ tests run OK! | ||
Shutting down... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
alloc | ||
paging |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
int main(int argc, char** argv) { | ||
puts("Running argv tests..."); | ||
if (argc != 3) puts("args num is wrong"); | ||
if (strcmp(argv[0], "envtest") || strcmp(argv[1], "test1") || strcmp(argv[2], "test2")) puts("argv is wrong"); | ||
if(argv[3] != NULL) puts("argv is wrong"); | ||
puts("Argv tests run OK!"); | ||
|
||
puts("Running environ tests..."); | ||
char *env1 = "env1", *ex1 = "ex1", *ex2 = "ex_2"; | ||
if(setenv(env1, ex1, 1) || strcmp(ex1, getenv(env1))) puts("set new env is wrong"); | ||
if(setenv(env1, ex2, 1) || strcmp(ex2, getenv(env1))) puts("set old env is wrong"); | ||
if(setenv(env1, ex1, 0) || strcmp(ex2, getenv(env1))) puts("override the old env is wrong"); | ||
if(strcmp("hello", getenv("world")) || strcmp("world", getenv("hello"))) puts("boot env is wrong"); | ||
puts("Environ tests run OK!"); | ||
return 0; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
test_one "LOG=info ARGS=envtest,test1,test2 ENVS=hello=world,world=hello" "expect_info.out" | ||
rm -f $APP/*.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[package] | ||
name = "dtb" | ||
version = "0.1.0" | ||
edition = "2021" | ||
authors = ["Leping Wang <[email protected]>"] | ||
description = "Device tree basic operations" | ||
license = "GPL-3.0-or-later OR Apache-2.0" | ||
homepage = "https://github.com/rcore-os/arceos" | ||
repository = "https://github.com/rcore-os/arceos/tree/main/crates/dtb" | ||
documentation = "https://rcore-os.github.io/arceos/dtb/index.html" | ||
|
||
[dependencies] | ||
fdt-rs = { version = "0.4.3", default-features = false } | ||
lazy_init = { path = "../../crates/lazy_init" } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also add this two parameter to the doc in the head of this file