Skip to content
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

language check for mystikos #1512

Merged
merged 2 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext2/ext2.c
Original file line number Diff line number Diff line change
Expand Up @@ -2411,7 +2411,7 @@ static int _ftruncate(ext2_t* ext2, myst_file_t* file, off_t length, bool isdir)
}
else if (length > file_size)
{
/* make file larger (with a hole) */
/* make file larger (with a file hole) */
_inode_set_size(&file->shared->inode, length);
_update_timestamps(&file->shared->inode, CHANGE | MODIFY);
ECHECK(_write_inode(ext2, file->shared->ino, &file->shared->inode));
Expand Down
2 changes: 1 addition & 1 deletion include/myst/ramfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ have to be customized. Some examples:
on the user provided buffer.

- Customized stateful Read/Write: for files for which read and write operations
are stateful, such as PTY master and slaves. Read and write
are stateful, such as PTY leader and followers. Read and write
operations on these files are applied on the file-level buffers.
*/

Expand Down
72 changes: 36 additions & 36 deletions kernel/devfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ static myst_fs_t* _devfs;

struct pty_pair
{
char* path_master;
char* path_slave;
myst_file_t* file_master;
myst_file_t* file_slave;
int slaveID;
char* path_leader;
char* path_follower;
myst_file_t* file_leader;
myst_file_t* file_follower;
int followerID;
struct pty_pair* next;
};

static struct pty_pair* _pty_pairs = NULL;

static int _nextSlaveID = 0;
static int _nextfollowerID = 0;

/*************************************
* callbacks
Expand Down Expand Up @@ -99,28 +99,28 @@ static int _urandom_read_cb(myst_file_t* self, void* buf, size_t count)
return ret;
}

static struct pty_pair* _find_paired_master_by_path(const char* path)
static struct pty_pair* _find_paired_leader_by_path(const char* path)
{
for (struct pty_pair* tmp = _pty_pairs; tmp; tmp = tmp->next)
{
if (strcmp(path, tmp->path_slave) == 0)
if (strcmp(path, tmp->path_follower) == 0)
return tmp;
}
return NULL;
}

static int _open_slave_pty_cb(
static int _open_follower_pty_cb(
myst_file_t* file,
myst_buf_t* buf,
const char* path)
{
(void)buf;
int ret = 0;
// find the paired master based on path
struct pty_pair* pair = _find_paired_master_by_path(path);
// find the paired leader based on path
struct pty_pair* pair = _find_paired_leader_by_path(path);
if (pair == NULL)
ERAISE(-ENXIO);
pair->file_slave = file;
pair->file_follower = file;

done:
return ret;
Expand All @@ -133,15 +133,15 @@ static int _close_pty_file_cb(myst_file_t* file)
struct pty_pair* prev = NULL;
for (struct pty_pair* tmp = _pty_pairs; tmp; tmp = tmp->next)
{
if (tmp->file_master == file || tmp->file_slave == file)
if (tmp->file_leader == file || tmp->file_follower == file)
{
if (prev)
prev->next = tmp->next;
else
_pty_pairs = _pty_pairs->next;

free(tmp->path_master);
free(tmp->path_slave);
free(tmp->path_leader);
free(tmp->path_follower);
free(tmp);
break;
}
Expand All @@ -151,36 +151,36 @@ static int _close_pty_file_cb(myst_file_t* file)
return ret;
}

static int _read_master_pty_cb(myst_file_t* file, void* buf, size_t count)
static int _read_leader_pty_cb(myst_file_t* file, void* buf, size_t count)
{
int ret = 0;
for (struct pty_pair* tmp = _pty_pairs; tmp; tmp = tmp->next)
{
if (tmp->file_master == file)
if (tmp->file_leader == file)
{
ret = myst_read_stateful_virtual_file(tmp->file_slave, buf, count);
ret = myst_read_stateful_virtual_file(tmp->file_follower, buf, count);
goto done;
}
}

ERAISE(-EINVAL); /* can't find the paired slave PTY device */
ERAISE(-EINVAL); /* can't find the paired follower PTY device */

done:
return ret;
}

static int _read_slave_pty_cb(myst_file_t* file, void* buf, size_t count)
static int _read_follower_pty_cb(myst_file_t* file, void* buf, size_t count)
{
int ret = 0;
for (struct pty_pair* tmp = _pty_pairs; tmp; tmp = tmp->next)
{
if (tmp->file_slave == file)
if (tmp->file_follower == file)
{
ret = myst_read_stateful_virtual_file(tmp->file_master, buf, count);
ret = myst_read_stateful_virtual_file(tmp->file_leader, buf, count);
goto done;
}
}
ERAISE(-EINVAL); /* can't find the paired master PTY device */
ERAISE(-EINVAL); /* can't find the paired leader PTY device */

done:
return ret;
Expand All @@ -191,7 +191,7 @@ static int _write_pty_cb(myst_file_t* file, const void* buf, size_t count)
return myst_write_stateful_virtual_file(file, buf, count);
}

static int _open_master_pty_cb(
static int _open_leader_pty_cb(
myst_file_t* file,
myst_buf_t* buf,
const char* path)
Expand All @@ -204,22 +204,22 @@ static int _open_master_pty_cb(
if (pair == NULL)
ERAISE(-ENOMEM);

if ((pair->path_master = strdup(path)) == NULL)
if ((pair->path_leader = strdup(path)) == NULL)
ERAISE(-ENOMEM);

pair->slaveID = _nextSlaveID++;
snprintf(tmp, sizeof(tmp), "/pts/%d", pair->slaveID);
pair->followerID = _nextfollowerID++;
snprintf(tmp, sizeof(tmp), "/pts/%d", pair->followerID);

if ((pair->path_slave = strdup(tmp)) == NULL)
if ((pair->path_follower = strdup(tmp)) == NULL)
ERAISE(-ENOMEM);

pair->file_master = file;
pair->file_leader = file;
pair->next = _pty_pairs;
_pty_pairs = pair;

v_cb.open_cb = _open_slave_pty_cb;
v_cb.open_cb = _open_follower_pty_cb;
v_cb.close_cb = _close_pty_file_cb;
v_cb.read_cb = _read_slave_pty_cb;
v_cb.read_cb = _read_follower_pty_cb;
v_cb.write_cb = _write_pty_cb;

ECHECK(myst_create_virtual_file(
Expand Down Expand Up @@ -301,9 +301,9 @@ int devfs_setup()
/* /dev/ptmx */
{
myst_vcallback_t v_cb = {0};
v_cb.open_cb = _open_master_pty_cb;
v_cb.open_cb = _open_leader_pty_cb;
v_cb.close_cb = _close_pty_file_cb;
v_cb.read_cb = _read_master_pty_cb;
v_cb.read_cb = _read_leader_pty_cb;
v_cb.write_cb = _write_pty_cb;

myst_create_virtual_file(
Expand Down Expand Up @@ -332,9 +332,9 @@ int devfs_get_pts_id(myst_file_t* file, int* id)
{
for (struct pty_pair* tmp = _pty_pairs; tmp; tmp = tmp->next)
{
if (tmp->file_master == file)
if (tmp->file_leader == file)
{
*id = tmp->slaveID;
*id = tmp->followerID;
return 0;
}
}
Expand All @@ -345,7 +345,7 @@ bool devfs_is_pty_pts_device(myst_file_t* file)
{
for (struct pty_pair* tmp = _pty_pairs; tmp; tmp = tmp->next)
{
if (tmp->file_master == file || tmp->file_slave == file)
if (tmp->file_leader == file || tmp->file_follower == file)
return true;
}
return false;
Expand Down
2 changes: 1 addition & 1 deletion kernel/ramfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2441,7 +2441,7 @@ static int _fs_ioctl(
{
if (!devfs_is_pty_pts_device(file))
ERAISE(-ENOTTY);
// NOP. The PTY slave is always ready to serve.
// NOP. The PTY follower is always ready to serve.
break;
}
case TIOCGPTN:
Expand Down
15 changes: 6 additions & 9 deletions samples/confidential_ml/src/imagenet_classes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ tiger shark, Galeocerdo cuvieri
hammerhead, hammerhead shark
electric ray, crampfish, numbfish, torpedo
stingray
cock
hen
ostrich, Struthio camelus
brambling, Fringilla montifringilla
Expand Down Expand Up @@ -213,7 +212,6 @@ vizsla, Hungarian pointer
English setter
Irish setter, red setter
Gordon setter
Brittany spaniel
clumber, clumber spaniel
English springer, English springer spaniel
Welsh springer spaniel
Expand Down Expand Up @@ -246,7 +244,7 @@ Tibetan mastiff
French bulldog
Great Dane
Saint Bernard, St Bernard
Eskimo dog, husky
husky
malamute, malemute, Alaskan malamute
Siberian husky
dalmatian, coach dog, carriage dog
Expand Down Expand Up @@ -359,7 +357,7 @@ mink
polecat, fitch, foulmart, foumart, Mustela putorius
black-footed ferret, ferret, Mustela nigripes
otter
skunk, polecat, wood pussy
skunk, polecat
badger
armadillo
three-toed sloth, ai, Bradypus tridactylus
Expand All @@ -386,7 +384,7 @@ indri, indris, Indri indri, Indri brevicaudatus
Indian elephant, Elephas maximus
African elephant, Loxodonta africana
lesser panda, red panda, panda, bear cat, cat bear, Ailurus fulgens
giant panda, panda, panda bear, coon bear, Ailuropoda melanoleuca
giant panda, panda, panda bear, Ailuropoda melanoleuca
barracouta, snoek
eel
coho, cohoe, coho salmon, blue jack, silver salmon, Oncorhynchus kisutch
Expand Down Expand Up @@ -510,7 +508,7 @@ computer keyboard, keypad
confectionery, confectionary, candy store
container ship, containership, container vessel
convertible
corkscrew, bottle screw
corkscrew
cornet, horn, trumpet, trump
cowboy boot
cowboy hat, ten-gallon hat
Expand All @@ -523,7 +521,7 @@ Crock Pot
croquet ball
crutch
cuirass
dam, dike, dyke
dam, dike
desk
desktop computer
dial telephone, dial phone
Expand Down Expand Up @@ -732,7 +730,7 @@ plow, plough
plunger, plumber's helper
Polaroid camera, Polaroid Land camera
pole
police van, police wagon, paddy wagon, patrol wagon, wagon, black Maria
police van, police wagon, patrol wagon, wagon, black Maria
poncho
pool table, billiard table, snooker table
pop bottle, soda bottle
Expand Down Expand Up @@ -781,7 +779,6 @@ school bus
schooner
scoreboard
screen, CRT screen
screw
screwdriver
seat belt, seatbelt
sewing machine
Expand Down
14 changes: 5 additions & 9 deletions samples/pytorch_onnx_inference/src/imagenet_classes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ tiger shark, Galeocerdo cuvieri
hammerhead, hammerhead shark
electric ray, crampfish, numbfish, torpedo
stingray
cock
hen
ostrich, Struthio camelus
brambling, Fringilla montifringilla
Expand Down Expand Up @@ -213,7 +212,6 @@ vizsla, Hungarian pointer
English setter
Irish setter, red setter
Gordon setter
Brittany spaniel
clumber, clumber spaniel
English springer, English springer spaniel
Welsh springer spaniel
Expand Down Expand Up @@ -246,7 +244,7 @@ Tibetan mastiff
French bulldog
Great Dane
Saint Bernard, St Bernard
Eskimo dog, husky
husky
malamute, malemute, Alaskan malamute
Siberian husky
dalmatian, coach dog, carriage dog
Expand Down Expand Up @@ -359,7 +357,7 @@ mink
polecat, fitch, foulmart, foumart, Mustela putorius
black-footed ferret, ferret, Mustela nigripes
otter
skunk, polecat, wood pussy
skunk, polecat
badger
armadillo
three-toed sloth, ai, Bradypus tridactylus
Expand All @@ -386,7 +384,7 @@ indri, indris, Indri indri, Indri brevicaudatus
Indian elephant, Elephas maximus
African elephant, Loxodonta africana
lesser panda, red panda, panda, bear cat, cat bear, Ailurus fulgens
giant panda, panda, panda bear, coon bear, Ailuropoda melanoleuca
giant panda, panda, panda bear, Ailuropoda melanoleuca
barracouta, snoek
eel
coho, cohoe, coho salmon, blue jack, silver salmon, Oncorhynchus kisutch
Expand Down Expand Up @@ -510,7 +508,7 @@ computer keyboard, keypad
confectionery, confectionary, candy store
container ship, containership, container vessel
convertible
corkscrew, bottle screw
corkscrew
cornet, horn, trumpet, trump
cowboy boot
cowboy hat, ten-gallon hat
Expand All @@ -523,7 +521,6 @@ Crock Pot
croquet ball
crutch
cuirass
dam, dike, dyke
desk
desktop computer
dial telephone, dial phone
Expand Down Expand Up @@ -732,7 +729,7 @@ plow, plough
plunger, plumber's helper
Polaroid camera, Polaroid Land camera
pole
police van, police wagon, paddy wagon, patrol wagon, wagon, black Maria
police van, police wagon, patrol wagon, wagon, black Maria
poncho
pool table, billiard table, snooker table
pop bottle, soda bottle
Expand Down Expand Up @@ -781,7 +778,6 @@ school bus
schooner
scoreboard
screen, CRT screen
screw
screwdriver
seat belt, seatbelt
sewing machine
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class SampleData
public readonly static Airport[] Airports = new[]
{
new Airport { Code = "ATL", DisplayName = "Hartsfield–Jackson Atlanta International" },
new Airport { Code = "PEK", DisplayName = "Beijing Capital International" },
new Airport { Code = "PEK", DisplayName = "Beijing International" },
new Airport { Code = "DXB", DisplayName = "Dubai International" },
new Airport { Code = "LAX", DisplayName = "Los Angeles International" },
new Airport { Code = "HND", DisplayName = "Tokyo Haneda International" },
Expand Down
Loading