File tree Expand file tree Collapse file tree 4 files changed +10
-10
lines changed Expand file tree Collapse file tree 4 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -76,10 +76,10 @@ pub trait Address:
76
76
self . align_down ( core:: mem:: align_of :: < T > ( ) )
77
77
}
78
78
79
- /// Offsets this address by `offset`.
79
+ /// Offsets this address by `offset` bytes .
80
80
///
81
81
/// If the specified offset would overflow, this function saturates instead.
82
- fn offset ( self , offset : i32 ) -> Self {
82
+ fn offset ( self , offset : isize ) -> Self {
83
83
if offset > 0 {
84
84
self + offset as usize
85
85
} else {
@@ -333,11 +333,11 @@ macro_rules! impl_addrs {
333
333
Address :: align_down( self , align)
334
334
}
335
335
336
- /// Offsets this address by `offset`.
336
+ /// Offsets this address by `offset` bytes .
337
337
///
338
338
/// If the specified offset would overflow, this function saturates instead.
339
339
#[ inline]
340
- pub fn offset( self , offset: i32 ) -> Self {
340
+ pub fn offset( self , offset: isize ) -> Self {
341
341
Address :: offset( self , offset)
342
342
}
343
343
Original file line number Diff line number Diff line change @@ -84,13 +84,13 @@ impl<A: Address> Region<A> {
84
84
}
85
85
86
86
pub fn split_front ( & mut self , size : usize ) -> Option < Self > {
87
- assert ! ( size <= core :: i32 :: MAX as usize ) ;
87
+ assert ! ( size <= isize :: MAX as usize ) ;
88
88
if size > self . size {
89
89
return None ;
90
90
}
91
91
let base = self . base ;
92
92
tracing:: trace!( size, self . size, "splitting down by" ) ;
93
- self . base = self . base . offset ( size as i32 ) ;
93
+ self . base = self . base . offset ( size as isize ) ;
94
94
self . size -= size;
95
95
Some ( Self {
96
96
base,
@@ -100,12 +100,12 @@ impl<A: Address> Region<A> {
100
100
}
101
101
102
102
pub fn split_back ( & mut self , size : usize ) -> Option < Self > {
103
- assert ! ( size <= core :: i32 :: MAX as usize ) ;
103
+ assert ! ( size <= isize :: MAX as usize ) ;
104
104
if size >= self . size {
105
105
return None ;
106
106
}
107
107
let rem_size = self . size - size;
108
- let base = self . base . offset ( size as i32 ) ;
108
+ let base = self . base . offset ( size as isize ) ;
109
109
tracing:: trace!(
110
110
size,
111
111
self . size,
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ impl StateSegment {
37
37
/// Returns the virtual address of the I/O permission bitmap.
38
38
#[ inline]
39
39
pub fn iomap_addr ( & self ) -> VAddr {
40
- VAddr :: of ( self ) . offset ( self . iomap_offset as i32 )
40
+ VAddr :: of ( self ) . offset ( self . iomap_offset as isize )
41
41
}
42
42
43
43
/// Loads the provided [`selector`](segment::Selector) into the current task
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ static TSS: sync::Lazy<task::StateSegment> = sync::Lazy::new(|| {
48
48
tss. interrupt_stacks [ Idt :: DOUBLE_FAULT_IST_OFFSET ] = unsafe {
49
49
// safety: asdf
50
50
VAddr :: from_usize_unchecked ( core:: ptr:: addr_of!( DOUBLE_FAULT_STACK ) as usize )
51
- . offset ( DOUBLE_FAULT_STACK_SIZE as i32 )
51
+ . offset ( DOUBLE_FAULT_STACK_SIZE as isize )
52
52
} ;
53
53
tracing:: debug!( ?tss, "TSS initialized" ) ;
54
54
tss
You can’t perform that action at this time.
0 commit comments