/DragonOS/kernel/src/net/socket/ |
H A D | unix.rs | 14 buffer: Arc<SpinLock<Vec<u8>>>, field 31 let buffer = Arc::new(SpinLock::new(Vec::with_capacity(Self::DEFAULT_BUF_SIZE))); in new() localVariable 45 buffer, in new() 64 let mut buffer = self.buffer.lock_irqsave(); in read() localVariable 66 let len = core::cmp::min(buf.len(), buffer.len()); in read() 67 buf[..len].copy_from_slice(&buffer[..len]); in read() 69 let _ = buffer.split_off(len); in read() 98 let mut buffer = self.buffer.lock_irqsave(); in write_buffer() localVariable 101 if buffer.capacity() - buffer.len() < len { in write_buffer() 104 buffer.extend_from_slice(buf); in write_buffer() [all …]
|
/DragonOS/kernel/src/syscall/ |
H A D | user_access.rs | 84 let mut buffer = Vec::new(); in check_and_clone_cstr() localVariable 98 buffer.push(NonZero::new(c[0]).ok_or(SystemError::EINVAL)?); in check_and_clone_cstr() 101 let cstr = CString::from(buffer); in check_and_clone_cstr() 125 let mut buffer = Vec::new(); in check_and_clone_cstr_array() localVariable 146 buffer.push(string); in check_and_clone_cstr_array() 148 return Ok(buffer); in check_and_clone_cstr_array() 154 buffer: &'a mut [u8], field 159 buffer: &'a [u8], field 176 buffer: unsafe { core::slice::from_raw_parts(addr as *const u8, len) }, in new() 181 return self.buffer.len(); in size() [all …]
|
H A D | mod.rs | 166 let user_buf = user_buffer_writer.buffer(0)?; in handle() 197 let buf = user_buffer_writer.buffer(0)?; in handle() 574 let buffer = user_buffer_writer.buffer::<MsgHdr>(0)?; in handle() localVariable 576 let msg = &mut buffer[0]; in handle() 867 let fds = user_buffer_writer.buffer::<i32>(0)?; in handle() 922 let user_buf = user_buffer_writer.buffer(0)?; in handle() 1079 let set: &mut [u8] = user_buffer_writer.buffer(0)?; in handle()
|
/DragonOS/user/apps/test_dup3/ |
H A D | main.c | 18 char buffer[100]; in main() local 19 int bytes_read = read(new_fd, buffer, sizeof(buffer)); in main() 25 printf("Data:\n %.*s\n", bytes_read, buffer); in main()
|
/DragonOS/user/apps/http_server/ |
H A D | main.c | 37 char buffer[MAX_RESPONSE_SIZE]; in send_header() local 68 …sprintf(buffer, "HTTP/1.1 200 OK\nContent-Type: %s\nContent-Length: %d\n\n", content_type, content… in send_header() 69 send_response(sockfd, buffer); in send_header() 91 char buffer[1048576]; in send_file() local 97 readSize = read(fd, &buffer, to_read); in send_file() 100 void *p = buffer; in send_file() 179 char buffer[MAX_REQUEST_SIZE] = {0}; in main() local 227 valread = read(new_socket, buffer, MAX_REQUEST_SIZE); in main() 228 printf("%s\n", buffer); in main() 231 handle_request(new_socket, buffer); in main()
|
/DragonOS/user/apps/test_socket/src/ |
H A D | test_unix_stream_pair.rs | 12 let mut buffer = [0; 1024]; in test_unix_stream_pair() localVariable 13 let nbytes = sock0.read(&mut buffer).expect("read error"); in test_unix_stream_pair() 14 let received_msg = str::from_utf8(&buffer[..nbytes]).unwrap(); in test_unix_stream_pair()
|
H A D | test_unix_stream.rs | 29 let mut buffer = [0; 1024]; in test_unix_stream() localVariable 30 let nbytes = stream.read(&mut buffer).expect("read error"); in test_unix_stream() 31 let received_msg = str::from_utf8(&buffer[..nbytes]).unwrap(); in test_unix_stream()
|
/DragonOS/user/apps/test_mkfifo/ |
H A D | main.c | 17 char buffer[BUFFER_SIZE]; in main() local 40 bytes_read = read(pipe_fd, buffer, BUFFER_SIZE); in main() 43 printf("Child process received message: %s\n", buffer); in main()
|
/DragonOS/kernel/src/filesystem/procfs/ |
H A D | kmsg.rs | 34 buffer: AllocRingBuffer<LogMessage>, field 46 buffer: AllocRingBuffer::new(KMSG_BUFFER_CAPACITY), in new() 55 self.buffer.push(msg); in push() 84 for msg in self.buffer.iter() { in read_level() 112 self.buffer.clear(); in clear() 144 for msg in self.buffer.iter() { in tobytes()
|
/DragonOS/user/apps/test_ramfs/ |
H A D | main.c | 94 char buffer[100]; in main() local 96 fread(buffer, 1, 100, file3); in main() 97 printf("file3.txt content: %s\n", buffer); in main()
|
/DragonOS/kernel/src/driver/video/fbdev/base/ |
H A D | render_helper.rs | 15 buffer: u32, field 48 buffer: 0, in new() 108 return Ok(PixelLineStatus::Full(self.buffer)); in full_buffer() 114 self.buffer |= temp; in full_buffer() 120 return Err(PixelLineStatus::Full(self.buffer)); in full_buffer() 127 return Ok(PixelLineStatus::Full(self.buffer)); in full_buffer() 129 return Ok(PixelLineStatus::NotFull(self.buffer)); in full_buffer() 148 self.buffer = 0; in next()
|
/DragonOS/kernel/src/driver/net/e1000e/ |
H A D | e1000e.rs | 92 buffer: NonNull<u8>, field 106 buffer: NonNull::dangling(), in new() 113 buffer: vaddr, in new() 123 return self.buffer; in as_addr() 129 return self.buffer.as_ptr() as u64; in as_addr_u64() 140 return unsafe { from_raw_parts(self.buffer.as_ptr(), self.length) }; in as_slice() 145 return unsafe { from_raw_parts_mut(self.buffer.as_ptr(), self.length) }; in as_mut_slice() 158 unsafe { dma_dealloc(self.paddr, self.buffer, E1000E_DMA_PAGES) }; in free_buffer() 321 let buffer = E1000EBuffer::new(PAGE_SIZE); in new() localVariable 322 ring.addr = buffer.as_paddr() as u64; in new() [all …]
|
H A D | e1000e_driver.rs | 115 let mut buffer = E1000EBuffer::new(4096); in consume() localVariable 116 let result = f(buffer.as_mut_slice()); in consume() 118 device.e1000e_transmit(buffer); in consume() 119 buffer.free_buffer(); in consume() 156 Some(buffer) => Some(( in receive() 157 E1000ERxToken(buffer), in receive()
|
/DragonOS/kernel/src/filesystem/overlayfs/ |
H A D | copy_up.rs | 21 let mut buffer = vec![0u8; metadata.size as usize]; in copy_up() localVariable 23 lower_inode.read_at(0, metadata.size as usize, &mut buffer, lock.lock())?; in copy_up() 25 new_upper_inode.write_at(0, metadata.size as usize, &buffer, lock.lock())?; in copy_up()
|
/DragonOS/kernel/src/driver/net/ |
H A D | loopback.rs | 38 buffer: Vec<u8>, field 55 f(self.buffer.as_mut_slice()) in consume() 80 let mut buffer = vec![0; len]; in consume() localVariable 81 let result = f(buffer.as_mut_slice()); in consume() 83 device.loopback_transmit(buffer); in consume() 112 let buffer = self.queue.pop_front(); in loopback_receive() localVariable 113 match buffer { in loopback_receive() 114 Some(buffer) => { in loopback_receive() 116 return buffer; in loopback_receive() 129 pub fn loopback_transmit(&mut self, buffer: Vec<u8>) { in loopback_transmit() [all …]
|
/DragonOS/kernel/crates/rbpf/src/ |
H A D | lib.rs | 81 buffer: Vec<u8>, field 626 let buffer = vec![0u8; get_buff_len(data_offset, data_end_offset)]; in new() localVariable 630 buffer, in new() 674 let buffer = vec![0u8; get_buff_len(data_offset, data_end_offset)]; in set_program() localVariable 675 self.mbuff.buffer = buffer; in set_program() 799 let l = self.mbuff.buffer.len(); in execute_program() 806 &mut self.mbuff.buffer[(self.mbuff.data_offset)..], in execute_program() 810 &mut self.mbuff.buffer[(self.mbuff.data_end_offset)..], in execute_program() 813 self.parent.execute_program(mem, &self.mbuff.buffer) in execute_program() 913 self.mbuff.buffer.as_ptr() as *mut u8, in execute_program_jit() [all …]
|
/DragonOS/user/apps/test-blockcache/src/ |
H A D | main.rs | 11 let mut buffer = [0; 512]; in main() localVariable 16 let bytes_read = file.read_exact(&mut buffer)?; in main()
|
/DragonOS/kernel/crates/klog_types/src/ |
H A D | lib.rs | 230 let buffer = StaticThingBuf::with_recycle(MMLogCycle::new()); in new() localVariable 231 assert!(buffer.offset_of_slots() != 0); in new() 232 let slot_total_size = size_of_val(&buffer) - buffer.offset_of_slots(); in new() 242 slots_offset: (offset_of!(MMLogChannel<CAP>, buf) + buffer.offset_of_slots()) as u64, in new() 243 buf: buffer, in new()
|
/DragonOS/kernel/src/arch/x86_64/include/asm/ |
H A D | asm.h | 254 #define io_insw(port, buffer, nr) \ argument 255 __asm__ __volatile__("cld;rep;insw;mfence;" ::"d"(port), "D"(buffer), "c"(nr) \ 262 #define io_outsw(port, buffer, nr) \ argument 263 __asm__ __volatile__("cld;rep;outsw;mfence;" ::"d"(port), "S"(buffer), "c"(nr) \
|
/DragonOS/kernel/src/driver/virtio/ |
H A D | virtio_impl.rs | 93 buffer: NonNull<[u8]>, in share() 96 let vaddr = VirtAddr::new(buffer.as_ptr() as *mut u8 as usize); in share()
|
/DragonOS/kernel/src/libs/lib_ui/ |
H A D | screen_manager.rs | 100 let buffer = Self { in new() localVariable 111 return Ok(buffer); in new() 129 let buffer = Self { in new_device_buffer() localVariable 138 return Ok(buffer); in new_device_buffer()
|
/DragonOS/kernel/crates/rbpf/ |
H A D | README.md | 106 it has access to a C `struct sk_buff` instead, which is a buffer containing 117 buffer provided by the user, and that is expected to contain pointers to the 122 handle the metadata buffer for the user. In fact, this struct has a static 123 internal buffer that is passed to the program. The user has to indicate the 125 of packet data in the buffer. On calling the function that runs the program 127 static buffer, at the appointed offsets, for the start and the end of the 131 No metadata buffer is involved, the eBPF program directly receives the 168 the memory area of packet data are to be stored in the internal metadata buffer 227 data and the metadata buffer, or only to the packet data, or nothing at all, 323 ### Using a metadata buffer [all …]
|
/DragonOS/kernel/src/net/event_poll/ |
H A D | syscall.rs | 62 let epoll_events = epds_writer.buffer::<EPollEvent>(0)?; in epoll_wait()
|
/DragonOS/kernel/src/process/ |
H A D | syscall.rs | 479 let ubuf = writer.buffer::<RUsage>(0).unwrap(); in get_rusage() 521 let mut rlimit = writer.buffer::<RLimit64>(0).unwrap()[0]; in prlimit64() 530 let mut rlimit = writer.buffer::<RLimit64>(0).unwrap()[0]; in prlimit64() 539 let mut rlimit = writer.buffer::<RLimit64>(0).unwrap()[0]; in prlimit64()
|
/DragonOS/user/apps/test_bind/ |
H A D | main.c | 17 char buffer[MAX_REQUEST_SIZE] = {0}; variable
|