Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
是的我们是有一个OS
proj0-LZUOSLab
Commits
edc257eb
Commit
edc257eb
authored
3 years ago
by
MaPl
Browse files
Options
Download
Patches
Plain Diff
[lab6] drivers/virtio: add queue_align configure
parent
db524d22
wyq-net
atomic
fs
precess
sleep
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
os/lab6/drivers/virtio/virtio_mmio.c
+1
-0
os/lab6/drivers/virtio/virtio_mmio.c
os/lab6/include/device/virtio/virtio_queue.h
+2
-0
os/lab6/include/device/virtio/virtio_queue.h
with
3 additions
and
0 deletions
+3
-0
os/lab6/drivers/virtio/virtio_mmio.c
+
1
−
0
View file @
edc257eb
...
...
@@ -38,6 +38,7 @@ void virtio_set_queue(struct virtio_device *device, uint64_t is_legacy, uint32_t
device
->
queue_num
=
VIRTQ_RING_NUM
;
// 6. set the queue address
if
(
is_legacy
)
{
device
->
queue_align
=
PAGE_SIZE
;
device
->
guest_page_size
=
PAGE_SIZE
;
device
->
queue_pfn
=
virtq_phy_addr
/
PAGE_SIZE
;
}
else
{
...
...
This diff is collapsed.
Click to expand it.
os/lab6/include/device/virtio/virtio_queue.h
+
2
−
0
View file @
edc257eb
...
...
@@ -92,6 +92,8 @@ struct virtq {
uint64_t
physical_addr
;
};
#define VIRTQ_ALIGN(x) (((x) + PAGE_SIZE) & ~PAGE_SIZE)
uint16_t
virtq_get_desc
(
struct
virtq
*
vq
);
void
virtq_free_desc
(
struct
virtq
*
vq
,
uint16_t
idx
);
void
virtq_free_desc_chain
(
struct
virtq
*
vq
,
uint16_t
idx
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
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
Menu
Explore
Projects
Groups
Topics
Snippets