File tree Expand file tree Collapse file tree 9 files changed +17
-13
lines changed Expand file tree Collapse file tree 9 files changed +17
-13
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ pub struct PhysAddr(u64);
37
37
/// a valid sign extension and are not null either. So automatic sign extension would have
38
38
/// overwritten possibly meaningful bits. This likely indicates a bug, for example an invalid
39
39
/// address calculation.
40
- #[ derive( Debug ) ]
40
+ #[ derive( Debug , Clone , Copy ) ]
41
41
pub struct VirtAddrNotValid ( u64 ) ;
42
42
43
43
impl VirtAddr {
@@ -245,7 +245,7 @@ impl Sub<VirtAddr> for VirtAddr {
245
245
/// A passed `u64` was not a valid physical address.
246
246
///
247
247
/// This means that bits 52 to 64 are not were not all null.
248
- #[ derive( Debug ) ]
248
+ #[ derive( Debug , Clone , Copy ) ]
249
249
pub struct PhysAddrNotValid ( u64 ) ;
250
250
251
251
impl PhysAddr {
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ impl PortReadWrite for u32 {
63
63
}
64
64
65
65
/// An I/O port.
66
- #[ derive( Debug ) ]
66
+ #[ derive( Debug , Clone , PartialEq , Eq ) ]
67
67
pub struct Port < T : PortReadWrite > {
68
68
port : u16 ,
69
69
phantom : PhantomData < T > ,
Original file line number Diff line number Diff line change 10
10
#![ cfg_attr( feature = "deny-warnings" , deny( missing_docs) ) ]
11
11
#![ cfg_attr( not( feature = "deny-warnings" ) , warn( missing_docs) ) ]
12
12
13
+ #![ deny( missing_copy_implementations) ]
13
14
#![ deny( missing_debug_implementations) ]
14
15
15
16
#[ cfg( test) ]
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ use structures::paging::PhysFrame;
6
6
use PhysAddr ;
7
7
8
8
/// Various control flags modifying the basic operation of the CPU.
9
- #[ derive( Debug ) ]
9
+ #[ derive( Debug , Clone , Copy ) ]
10
10
pub struct Cr0 ;
11
11
12
12
impl Cr0 {
@@ -92,7 +92,7 @@ bitflags! {
92
92
}
93
93
94
94
/// Contains the physical address of the level 4 page table.
95
- #[ derive( Debug ) ]
95
+ #[ derive( Debug , Clone , Copy ) ]
96
96
pub struct Cr3 ;
97
97
98
98
impl Cr3 {
Original file line number Diff line number Diff line change 1
1
//! Functions to read and write control registers.
2
2
3
3
/// A model specific register.
4
- #[ derive( Debug ) ]
4
+ #[ derive( Debug , Clone , Copy ) ]
5
5
pub struct Msr ( u32 ) ;
6
6
7
7
impl Msr {
@@ -26,7 +26,7 @@ impl Msr {
26
26
}
27
27
28
28
/// The Extended Feature Enable Register.
29
- #[ derive( Debug ) ]
29
+ #[ derive( Debug , Clone , Copy ) ]
30
30
pub struct Efer ;
31
31
32
32
impl Efer {
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ impl fmt::Debug for SegmentSelector {
50
50
/// switching between user and kernel mode or for loading a TSS.
51
51
///
52
52
/// The GDT has a fixed size of 8 entries, trying to add more entries will panic.
53
- #[ derive( Debug ) ]
53
+ #[ derive( Debug , Clone , Copy ) ]
54
54
pub struct GlobalDescriptorTable {
55
55
table : [ u64 ; 8 ] ,
56
56
next_free : usize ,
@@ -109,7 +109,7 @@ impl GlobalDescriptorTable {
109
109
///
110
110
/// Segmentation is no longer supported in 64-bit mode, so most of the descriptor
111
111
/// contents are ignored.
112
- #[ derive( Debug ) ]
112
+ #[ derive( Debug , Clone , Copy ) ]
113
113
pub enum Descriptor {
114
114
/// Descriptor for a code or data segment.
115
115
///
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ use {PrivilegeLevel, VirtAddr};
31
31
/// [AMD64 manual volume 2](https://support.amd.com/TechDocs/24593.pdf)
32
32
/// (with slight modifications).
33
33
#[ allow( missing_debug_implementations) ]
34
+ #[ derive( Clone , Copy ) ]
34
35
#[ repr( C ) ]
35
36
pub struct InterruptDescriptorTable {
36
37
/// A divide by zero exception (`#DE`) occurs when the denominator of a DIV instruction or
@@ -637,6 +638,7 @@ impl EntryOptions {
637
638
}
638
639
639
640
/// Represents the exception stack frame pushed by the CPU on exception entry.
641
+ #[ derive( Clone , Copy ) ]
640
642
#[ repr( C ) ]
641
643
pub struct ExceptionStackFrame {
642
644
/// This value points to the instruction that should be executed when the interrupt
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ pub enum FrameError {
18
18
}
19
19
20
20
/// A 64-bit page table entry.
21
+ #[ allow( missing_copy_implementations) ]
21
22
#[ derive( Clone ) ]
22
23
#[ repr( transparent) ]
23
24
pub struct PageTableEntry {
Original file line number Diff line number Diff line change @@ -104,11 +104,11 @@ pub struct RecursivePageTable<'a> {
104
104
/// An error indicating that the given page table is not recursively mapped.
105
105
///
106
106
/// Returned from `RecursivePageTable::new`.
107
- #[ derive( Debug ) ]
107
+ #[ derive( Debug , Clone , Copy ) ]
108
108
pub struct NotRecursivelyMapped ;
109
109
110
110
/// This error is returned from `map_to` and similar methods.
111
- #[ derive( Debug ) ]
111
+ #[ derive( Debug , Clone , Copy ) ]
112
112
pub enum MapToError {
113
113
/// An additional frame was needed for the mapping process, but the frame allocator
114
114
/// returned `None`.
@@ -121,7 +121,7 @@ pub enum MapToError {
121
121
}
122
122
123
123
/// An error indicating that an `unmap` call failed.
124
- #[ derive( Debug ) ]
124
+ #[ derive( Debug , Clone , Copy ) ]
125
125
pub enum UnmapError {
126
126
/// An upper level page table entry has the `HUGE_PAGE` flag set, which means that the
127
127
/// given page is part of a huge page and can't be freed individually.
@@ -133,7 +133,7 @@ pub enum UnmapError {
133
133
}
134
134
135
135
/// An error indicating that an `update_flags` call failed.
136
- #[ derive( Debug ) ]
136
+ #[ derive( Debug , Clone , Copy ) ]
137
137
pub enum FlagUpdateError {
138
138
/// The given page is not mapped to a physical frame.
139
139
PageNotMapped ,
You can’t perform that action at this time.
0 commit comments