Skip to content

Commit 498fdb8

Browse files
committed
Disable new_uninit feature
1 parent caf06b6 commit 498fdb8

File tree

3 files changed

+3
-18
lines changed

3 files changed

+3
-18
lines changed

src/arch/x86_64/kernel/scheduler.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,7 @@ impl TaskTLS {
274274
// So the thread pointer needs to be `block_ptr + tls_offset`.
275275
// Allocating only tls_len bytes would be enough to hold the TLS block.
276276
// For the thread pointer to be sound though, we need it's value to be included in or one byte past the same allocation.
277-
let block = Box::<[u8]>::new_zeroed_slice(tls_offset);
278-
279-
// SAFETY: All u8s can hold the bit-pattern 0 as a valid value
280-
unsafe { block.assume_init() }
277+
vec![0; tls_offset].into_boxed_slice()
281278
};
282279

283280
// Initialize beginning of the TLS block with TLS initialization image

src/drivers/net/rtl8139.rs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -519,19 +519,8 @@ pub fn init_device(adapter: &pci::PciAdapter) -> Result<RTL8139Driver, DriverErr
519519
outl(iobase + TCR, TCR_IFG | TCR_MXDMA0 | TCR_MXDMA1 | TCR_MXDMA2);
520520
}
521521

522-
let rxbuffer = Box::<[u8]>::try_new_zeroed_slice(RX_BUF_LEN).map_err(|_| {
523-
error!("Unable to allocate buffers for RTL8139");
524-
DriverError::InitRTL8139DevFail(RTL8139Error::Unknown)
525-
})?;
526-
// SAFETY: All u8s can hold the bit-pattern 0 as a valid value
527-
let rxbuffer = unsafe { rxbuffer.assume_init() };
528-
529-
let txbuffer = Box::<[u8]>::try_new_zeroed_slice(NO_TX_BUFFERS * TX_BUF_LEN).map_err(|_| {
530-
error!("Unable to allocate buffers for RTL8139");
531-
DriverError::InitRTL8139DevFail(RTL8139Error::Unknown)
532-
})?;
533-
// SAFETY: All u8s can hold the bit-pattern 0 as a valid value
534-
let txbuffer = unsafe { txbuffer.assume_init() };
522+
let rxbuffer = vec![0; RX_BUF_LEN].into_boxed_slice();
523+
let txbuffer = vec![0; NO_TX_BUFFERS * TX_BUF_LEN].into_boxed_slice();
535524

536525
debug!(
537526
"Allocate TxBuffer at {:p} and RxBuffer at {:p}",

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#![feature(asm_const)]
1313
#![feature(linked_list_cursors)]
1414
#![feature(naked_functions)]
15-
#![feature(new_uninit)]
1615
#![feature(specialization)]
1716
#![feature(strict_provenance)]
1817
#![feature(is_some_and)]

0 commit comments

Comments
 (0)