Home
last modified time | relevance | path

Searched refs:buf (Results 1 – 25 of 50) sorted by relevance

12

/DragonOS-0.1.5/kernel/src/libs/libUI/
Dscreen_manager.c32 …struct scm_buffer_info_t *buf = (struct scm_buffer_info_t *)kmalloc(sizeof(struct scm_buffer_info_… in __create_buffer() local
33 if (buf == NULL) in __create_buffer()
35 memset(buf, 0, sizeof(struct scm_buffer_info_t)); in __create_buffer()
36 buf->bit_depth = video_frame_buffer_info.bit_depth; in __create_buffer()
37 buf->flags = SCM_BF_DB; in __create_buffer()
40 buf->flags |= SCM_BF_PIXEL; in __create_buffer()
42 buf->flags |= SCM_BF_TEXT; in __create_buffer()
43 buf->height = video_frame_buffer_info.height; in __create_buffer()
44 buf->width = video_frame_buffer_info.width; in __create_buffer()
45 buf->size = video_frame_buffer_info.size; in __create_buffer()
[all …]
Dscreen_manager.h36 int (*install)(struct scm_buffer_info_t *buf); // 安装ui框架的回调函数
40 int (*change)(struct scm_buffer_info_t *buf); // 改变ui框架的帧缓冲区的回调函数
49 struct scm_buffer_info_t *buf; member
Dtextui.c69 int textui_install_handler(struct scm_buffer_info_t *buf) in textui_install_handler() argument
92 int textui_change_handler(struct scm_buffer_info_t *buf) in textui_change_handler() argument
94 memcpy((void *)buf->vaddr, (void *)(textui_framework.buf->vaddr), textui_framework.buf->size); in textui_change_handler()
95 textui_framework.buf = buf; in textui_change_handler()
327 uint16_t chars_per_vline = textui_framework.buf->width / TEXTUI_CHAR_WIDTH; in textui_init()
328 uint16_t total_vlines = textui_framework.buf->height / TEXTUI_CHAR_HEIGHT; in textui_init()
344 __private_info.actual_line = textui_framework.buf->height / TEXTUI_CHAR_HEIGHT; in textui_init()
/DragonOS-0.1.5/user/apps/shell/
Dshell.c22 int shell_readline(int fd, char *buf);
110 void clear_command(int count, char *buf) in clear_command() argument
114 memset(buf, 0, sizeof(buf)); in clear_command()
122 void change_command(char *buf, int type) in change_command() argument
141 strcpy(buf, history_commands[current_command_index]); in change_command()
142 printf("%s", buf); in change_command()
152 int shell_readline(int fd, char *buf) in shell_readline() argument
164 clear_command(count, buf); in shell_readline()
167 change_command(buf, 1); in shell_readline()
168 count = strlen(buf); in shell_readline()
[all …]
Dcmd_test.c12 char buf[512] = {0}; in shell_pipe_test() local
27 ret = read(fd[0], buf, sizeof(buf)); in shell_pipe_test()
28 printf("parent read %d bytes data: %s\n", ret, buf); in shell_pipe_test()
Dcmd.c251 struct dirent *buf = NULL; in shell_cmd_ls() local
256 buf = readdir(dir); in shell_cmd_ls()
257 if (buf == NULL) in shell_cmd_ls()
261 if (buf->d_type == DT_DIR) in shell_cmd_ls()
263 else if (buf->d_type == DT_REG) in shell_cmd_ls()
265 else if (buf->d_type == DT_BLK || buf->d_type == DT_CHR) in shell_cmd_ls()
270 sprintf(output_buf, "%s ", buf->d_name); in shell_cmd_ls()
317 char *buf = (char *)malloc(512); in shell_cmd_cat() local
321 memset(buf, 0, 512); in shell_cmd_cat()
322 int l = read(fd, buf, 511); in shell_cmd_cat()
[all …]
/DragonOS-0.1.5/user/libs/libc/src/
Dstdio.c10 char *buf = malloc(bufsize); in fprintf() local
11 memset(buf, 0, bufsize); in fprintf()
15 vsprintf(buf, format, args); in fprintf()
18 int len = strlen(buf); in fprintf()
22 buf[bufsize - 1] = 0; in fprintf()
24 write(stream->fd, buf, len); in fprintf()
25 free(buf); in fprintf()
Dunistd.c28 ssize_t read(int fd, void *buf, size_t count) in read() argument
30 return (ssize_t)syscall_invoke(SYS_READ, fd, (uint64_t)buf, count, 0, 0, 0, 0, 0); in read()
41 ssize_t write(int fd, void const *buf, size_t count) in write() argument
43 return (ssize_t)syscall_invoke(SYS_WRITE, fd, (uint64_t)buf, count, 0, 0, 0, 0, 0); in write()
183 unsigned char buf[32]; in swab() local
190 memcpy(buf, _src, transfer); in swab()
192 memcpy(_dest, buf, transfer); in swab()
Ddirent.c70 memset((dir->buf), 0, DIR_BUF_SIZE); in readdir()
72 int len = getdents(dir->fd, (struct dirent *)dir->buf, DIR_BUF_SIZE); in readdir()
75 return (struct dirent *)dir->buf; in readdir()
Dprintf.c42 char buf[4096]; in printf() local
47 count = vsprintf(buf, fmt, args); in printf()
49 put_string(buf, COLOR_WHITE, COLOR_BLACK); in printf()
53 int sprintf(char *buf, const char *fmt, ...) in sprintf() argument
59 count = vsprintf(buf, fmt, args); in sprintf()
72 int vsprintf(char *buf, const char *fmt, va_list args) in vsprintf() argument
79 str = buf; in vsprintf()
323 *ip = str - buf; in vsprintf()
347 return str - buf; in vsprintf()
/DragonOS-0.1.5/kernel/src/libs/
Dvec_cursor.rs104 pub fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), i32> { in read_exact()
105 if self.pos + buf.len() > self.data.len() { in read_exact()
108 buf.copy_from_slice(&self.data[self.pos..self.pos + buf.len()]); in read_exact()
109 self.pos += buf.len(); in read_exact()
116 pub fn read_u16_into(&mut self, buf: &mut [u16]) -> Result<(), i32> { in read_u16_into()
117 if self.pos + buf.len() * size_of::<u16>() > self.data.len() * size_of::<u16>() { in read_u16_into()
121 for i in 0..buf.len() { in read_u16_into()
122 buf[i] = self.read_u16()?; in read_u16_into()
219 pub fn write_exact(&mut self, buf: &[u8]) -> Result<(), i32> { in write_exact()
220 if self.pos + buf.len() > self.data.len() { in write_exact()
[all …]
Dunistd.c26 unsigned char buf[32]; in swab() local
33 memcpy(buf, _src, transfer); in swab()
35 memcpy(_dest, buf, transfer); in swab()
Dprintk.c54 static int __do_vsprintf(char *buf, const char *fmt, int buf_size, va_list args) in __do_vsprintf() argument
62 str = buf; in __do_vsprintf()
72 end = buf + buf_size; in __do_vsprintf()
310 *ip = str - buf; in __do_vsprintf()
354 return str - buf; in __do_vsprintf()
364 int vsprintf(char *buf, const char *fmt, va_list args) in vsprintf() argument
366 return __do_vsprintf(buf, fmt, -1, args); in vsprintf()
378 int vsnprintf(char *buf, const char *fmt, int buf_size, va_list args) in vsnprintf() argument
380 return __do_vsprintf(buf, fmt, buf_size, args); in vsnprintf()
600 char buf[4096]; // vsprintf()的缓冲区 in printk_color() local
[all …]
/DragonOS-0.1.5/kernel/src/common/
Dstdio.h11 extern int vsprintf(char *buf, const char *fmt, va_list args);
13 extern int sprintk(char *buf, const char *fmt, ...);
Dprintk.h50 int vsprintf(char *buf, const char *fmt, va_list args);
61 int vsnprintf(char *buf, const char *fmt, int buf_size, va_list args);
83 int sprintk(char *buf, const char *fmt, ...);
/DragonOS-0.1.5/kernel/src/driver/disk/
Data.c24 unsigned char buf[64]; in ata_disk_handler() local
30 buf[js++]=(info.Serial_Number[i] & 0xff); in ata_disk_handler()
32 buf[js] = '\0'; in ata_disk_handler()
33 printk("%s", buf); in ata_disk_handler()
/DragonOS-0.1.5/kernel/src/io/
Ddevice.rs35 fn read_at(&self, offset: usize, len: usize, buf: &mut [u8]) -> Result<usize, i32>; in read_at()
42 fn write_at(&self, offset: usize, len: usize, buf: &[u8]) -> Result<usize, i32>; in write_at()
60 fn read_at(&self, lba_id_start: BlockId, count: usize, buf: &mut [u8]) -> Result<usize, i32>; in read_at()
69 fn write_at(&self, lba_id_start: BlockId, count: usize, buf: &[u8]) -> Result<usize, i32>; in write_at()
99 fn read_at(&self, offset: usize, len: usize, buf: &mut [u8]) -> Result<usize, i32> { in read_at()
100 if len > buf.len() { in read_at()
111 let buf_slice = &mut buf[buf_begin..buf_end]; in read_at()
135 fn write_at(&self, offset: usize, len: usize, buf: &[u8]) -> Result<usize, i32> { in write_at()
137 if len > buf.len() { in write_at()
147 let buf_slice = &buf[buf_begin..buf_end]; in write_at()
/DragonOS-0.1.5/kernel/src/driver/disk/ahci/
Dahci_inode.rs123 buf: &mut [u8], in read_at()
126 if buf.len() < len { in read_at()
131 return self.0.lock().disk.read_at(offset, len, buf); in read_at()
142 buf: &[u8], in write_at()
145 if buf.len() < len { in write_at()
150 return self.0.lock().disk.write_at(offset, len, buf); in write_at()
Dahcidisk.rs56 buf: &mut [u8], in read_at()
60 if count * 512 > buf.len() || check_length > u16::MAX as usize { in read_at()
97 let mut buf_ptr = buf as *mut [u8] as *mut usize as usize; in read_at()
189 buf: &[u8], in write_at()
193 if count * 512 > buf.len() || check_length > u16::MAX as usize { in write_at()
233 let mut buf_ptr = buf as *const [u8] as *mut usize as usize; in write_at()
358 let mut buf: Vec<u8> = Vec::new(); in read_mbr_table() localVariable
359 buf.resize(size_of::<MbrDiskPartionTable>(), 0); in read_mbr_table()
361 self.read_at(0, 1, &mut buf)?; in read_mbr_table()
364 let mut cursor = VecCursor::new(buf); in read_mbr_table()
[all …]
/DragonOS-0.1.5/kernel/src/driver/tty/
Dtty.c61 long tty_read(struct vfs_file_t *filp, char *buf, int64_t count, long *position) in tty_read() argument
75 long tty_write(struct vfs_file_t *filp, char *buf, int64_t count, long *position) in tty_write() argument
/DragonOS-0.1.5/user/libs/libc/src/include/export/
Dunistd.h25 ssize_t read(int fd, void *buf, size_t count);
35 ssize_t write(int fd, void const *buf, size_t count);
Dstdio.h50 int sprintf(char *buf, const char *fmt, ...);
51 int vsprintf(char *buf, const char *fmt, va_list args);
/DragonOS-0.1.5/kernel/src/filesystem/devfs/
Dnull_dev.rs118 buf: &mut [u8], in read_at()
121 if buf.len() < len { in read_at()
126 buf[i] = 0; in read_at()
137 buf: &[u8], in write_at()
140 if buf.len() < len { in write_at()
Dzero_dev.rs118 buf: &mut [u8], in read_at()
121 if buf.len() < len { in read_at()
126 buf[i] = 0; in read_at()
137 buf: &[u8], in write_at()
140 if buf.len() < len { in write_at()
/DragonOS-0.1.5/kernel/src/filesystem/vfs/
Dfile.rs121 pub fn read(&mut self, len: usize, buf: &mut [u8]) -> Result<usize, i32> { in read()
125 if buf.len() < len { in read()
131 .read_at(self.offset, len, buf, &mut self.private_data)?; in read()
143 pub fn write(&mut self, len: usize, buf: &[u8]) -> Result<usize, i32> { in write()
146 if buf.len() < len { in write()
151 .write_at(self.offset, len, buf, &mut FilePrivateData::Unused)?; in write()
254 let buf: &mut [u8] = in readdir() localVariable
256 buf.copy_from_slice(name_bytes); in readdir()

12