Home
last modified time | relevance | path

Searched refs:addr (Results 1 – 24 of 24) sorted by relevance

/DragonOS-0.1.8/kernel/src/exception/
Dgate.h100 void set_tss_descriptor(unsigned int n, void *addr) in set_tss_descriptor() argument
105addr & 0xffff) << 16) | ((((unsigned long)addr >> 16) & 0xff) << 32) | ((unsigned long)0x89 << 40)… in set_tss_descriptor()
106 …*(unsigned long *)(phys_2_virt(GDT_Table + n + 1)) = (((unsigned long)addr >> 32) & 0xffffffff) | … in set_tss_descriptor()
127 void set_intr_gate(unsigned int n, unsigned char ist, void *addr) in set_intr_gate() argument
129 _set_gate(phys_2_virt(IDT_Table + n), 0x8E, ist, addr); // p=1,DPL=0, type=E in set_intr_gate()
141 void set_trap_gate(unsigned int n, unsigned char ist, void *addr) in set_trap_gate() argument
146 _set_gate(phys_2_virt(IDT_Table + n), 0x8F, ist, addr); // p=1,DPL=0, type=F in set_trap_gate()
156 void set_system_trap_gate(unsigned int n, unsigned char ist, void *addr) in set_system_trap_gate() argument
161 _set_gate(phys_2_virt(IDT_Table + n), 0xEF, ist, addr); // p=1,DPL=3, type=F in set_system_trap_gate()
165 static inline void set_system_intr_gate(unsigned int n,unsigned char ist,void * addr) //int3 in set_system_intr_gate() argument
[all …]
/DragonOS-0.1.8/kernel/src/mm/
Dmm.h35 #define PAGE_4K_ALIGN(addr) (((unsigned long)(addr) + PAGE_4K_SIZE - 1) & PAGE_4K_MASK) argument
36 #define PAGE_2M_ALIGN(addr) (((unsigned long)(addr) + PAGE_2M_SIZE - 1) & PAGE_2M_MASK) argument
39 #define virt_2_phys(addr) ((unsigned long)(addr)-PAGE_OFFSET) argument
40 #define phys_2_virt(addr) ((unsigned long *)((unsigned long)(addr) + PAGE_OFFSET)) argument
Dmod.rs64 pub fn virt_2_phys(addr: usize) -> usize { in virt_2_phys()
65 addr - PAGE_OFFSET as usize in virt_2_phys()
70 pub fn phys_2_virt(addr: usize) -> usize { in phys_2_virt()
71 addr + PAGE_OFFSET as usize in phys_2_virt()
583 pub fn contains(&self, addr: VirtAddr) -> bool { in contains()
584 return self.start() <= addr && addr < self.end(); in contains()
614 pub fn verify_area(addr: VirtAddr, size: usize) -> Result<(), SystemError> { in verify_area()
615 let end = addr.add(size); in verify_area()
616 if unlikely(end.data() < addr.data()) { in verify_area()
620 if !addr.check_user() || !end.check_user() { in verify_area()
Dpage.rs139 pub unsafe fn index_of(&self, addr: VirtAddr) -> Option<usize> { in index_of()
140 let addr = VirtAddr::new(addr.data() & Arch::PAGE_ADDRESS_MASK); in index_of() localVariable
144 if addr < self.base || addr >= self.base.add(mask) { in index_of()
147 return Some((addr.data() >> shift) & MMArch::PAGE_ENTRY_MASK); in index_of()
917 pub fn round_down_to_page_size(addr: usize) -> usize { in round_down_to_page_size()
918 addr & !(MMArch::PAGE_SIZE - 1) in round_down_to_page_size()
922 pub fn round_up_to_page_size(addr: usize) -> usize { in round_up_to_page_size()
923 round_down_to_page_size(addr + MMArch::PAGE_SIZE - 1) in round_up_to_page_size()
Ducontext.rs247 let addr = hint.data() & (!MMArch::PAGE_OFFSET_MASK); in map_anonymous() localVariable
250 if (addr != 0) && round_to_min && (addr < DEFAULT_MMAP_MIN_ADDR) { in map_anonymous()
252 } else if addr == 0 { in map_anonymous()
255 Some(VirtAddr::new(addr)) in map_anonymous()
305 addr: Option<VirtAddr>, in mmap()
317 let region = match addr { in mmap()
/DragonOS-0.1.8/kernel/src/debug/traceback/
Dtraceback.c5 static int lookup_kallsyms(uint64_t addr, int level) in lookup_kallsyms() argument
15 if (addr > kallsyms_address[index] && addr <= kallsyms_address[index + 1]) in lookup_kallsyms()
22 … %04d address:%#018lx\n", &str[kallsyms_names_index[index]], addr - kallsyms_address[index], addr); in lookup_kallsyms()
/DragonOS-0.1.8/user/apps/test_relibc/
Dmain.c194 struct sockaddr_in addr; in udp_client() local
207 bzero(&addr, sizeof(addr)); in udp_client()
208 addr.sin_family = AF_INET; in udp_client()
209 addr.sin_port = htons(12581); in udp_client()
210 addr.sin_addr.s_addr = inet_addr("192.168.199.129"); in udp_client()
213 sendto(sockfd, logo, sizeof(logo), 0, (struct sockaddr *)&addr, addr_len); in udp_client()
225 sendto(sockfd, buffer, len, 0, (struct sockaddr *)&addr, addr_len); in udp_client()
228 len = recvfrom(sockfd, buffer, sizeof(buffer), 0, (struct sockaddr *)&addr, &addr_len); in udp_client()
/DragonOS-0.1.8/kernel/src/net/
Dsyscall.rs167 pub fn connect(fd: usize, addr: *const SockAddr, addrlen: usize) -> Result<usize, SystemError> { in connect()
168 let endpoint: Endpoint = SockAddr::to_endpoint(addr, addrlen)?; in connect()
185 pub fn bind(fd: usize, addr: *const SockAddr, addrlen: usize) -> Result<usize, SystemError> { in bind()
186 let endpoint: Endpoint = SockAddr::to_endpoint(addr, addrlen)?; in bind()
208 addr: *const SockAddr, in sendto()
211 let endpoint = if addr.is_null() { in sendto()
214 Some(SockAddr::to_endpoint(addr, addrlen)?) in sendto()
237 addr: *mut SockAddr, in recvfrom()
251 if !addr.is_null() { in recvfrom()
254 sockaddr_in.write_to_user(addr, addrlen)?; in recvfrom()
[all …]
Dsocket.rs296 addr: wire::IpAddress::Ipv4(packet.src_addr()), in read()
346 if let wire::IpAddress::Ipv4(ipv4_dst) = endpoint.addr { in write()
463 let bind_res = if ip.addr.is_unspecified() { in do_bind()
527 let local_ep = match remote_endpoint.addr { in write()
618 .addr in endpoint()
685 let listen_result = if local_endpoint.addr.is_unspecified() { in do_listen()
/DragonOS-0.1.8/kernel/src/driver/multiboot2/
Dmultiboot2.c11 uintptr_t *addr = (uintptr_t *)multiboot2_boot_info_addr; in multiboot2_init() local
15 multiboot2_boot_info_size = *(unsigned int *)addr; in multiboot2_init()
23 uintptr_t addr = multiboot2_boot_info_addr; in multiboot2_iter() local
25 struct iter_data_t *tag = (struct iter_data_t *)((void *)addr + 8); in multiboot2_iter()
Dmultiboot2.h204 uint64_t addr; member
/DragonOS-0.1.8/kernel/src/libs/libUI/
Dtextui-render.c123 unsigned int *addr; in __textui_render_chromatic() local
138 addr = (uint32_t *)(fb + textui_framework.buf->width * (y + i) + x); in __textui_render_chromatic()
146 *addr = FRcolor; // 字,显示前景色 in __textui_render_chromatic()
148 *addr = BKcolor; // 背景色 in __textui_render_chromatic()
150 ++addr; in __textui_render_chromatic()
/DragonOS-0.1.8/kernel/src/syscall/
Duser_access.rs84 let addr = unsafe { user.add(i) }; in check_and_clone_cstr() localVariable
87 copy_from_user(&mut c, VirtAddr::new(addr as usize))?; in check_and_clone_cstr()
118 let addr = unsafe { user.add(i) }; in check_and_clone_cstr_array() localVariable
124 copy_from_user(&mut dst, VirtAddr::new(addr as usize))?; in check_and_clone_cstr_array()
Dmod.rs771 let addr = args[1] as *const SockAddr; in handle() localVariable
773 let virt_addr = VirtAddr::new(addr as usize); in handle()
779 Self::connect(args[0], addr, addrlen) in handle()
783 let addr = args[1] as *const SockAddr; in handle() localVariable
785 let virt_addr = VirtAddr::new(addr as usize); in handle()
791 Self::bind(args[0], addr, addrlen) in handle()
799 let addr = args[4] as *const SockAddr; in handle() localVariable
802 let virt_addr = VirtAddr::new(addr as usize); in handle()
812 Self::sendto(args[0], data, flags, addr, addrlen) in handle()
820 let addr = args[4] as *mut SockAddr; in handle() localVariable
[all …]
/DragonOS-0.1.8/kernel/src/driver/timers/rtc/
Drtc.rs93 fn read_cmos(addr: u8) -> u8 { in read_cmos()
95 io_out8(0x70, 0x80 | addr); in read_cmos()
/DragonOS-0.1.8/kernel/src/mm/allocator/
Dslab.rs47 Some(block) => return Some(block.addr() as *mut u8), in allocate()
120 fn addr(&self) -> usize { in addr() method
Dpage_frame.rs293 return self.allocate(PageFrameCount::new(1)).map(|(addr, _)| addr); in allocate_one()
Dbuddy.rs248 pub fn read_page<T>(addr: PhysAddr) -> T { in read_page()
249 let page_list = unsafe { A::read(A::phys_2_virt(addr).unwrap()) }; in read_page()
428 .map(|addr| (addr, PageFrameCount::new(1 << (order as usize - MIN_ORDER)))); in buddy_alloc()
/DragonOS-0.1.8/user/libs/libc/src/
Dmalloc.c23 #define PAGE_4K_ALIGN(addr) (((unsigned long)(addr) + PAGE_4K_SIZE - 1) & PAGE_4K_MASK) argument
24 #define PAGE_2M_ALIGN(addr) (((unsigned long)(addr) + PAGE_2M_SIZE - 1) & PAGE_2M_MASK) argument
/DragonOS-0.1.8/kernel/src/libs/
Dalign.rs121 pub fn page_align_up(addr: usize) -> usize { in page_align_up()
123 return (addr + page_size - 1) & (!(page_size - 1)); in page_align_up()
Delf.rs115 fn elf_page_offset(&self, addr: VirtAddr) -> usize { in elf_page_offset()
116 addr.data() & (Self::ELF_PAGE_SIZE - 1) in elf_page_offset()
119 fn elf_page_start(&self, addr: VirtAddr) -> VirtAddr { in elf_page_start()
120 VirtAddr::new(addr.data() & (!(Self::ELF_PAGE_SIZE - 1))) in elf_page_start()
123 fn elf_page_align_up(&self, addr: VirtAddr) -> VirtAddr { in elf_page_align_up()
124 VirtAddr::new((addr.data() + Self::ELF_PAGE_SIZE - 1) & (!(Self::ELF_PAGE_SIZE - 1))) in elf_page_align_up()
/DragonOS-0.1.8/kernel/src/common/
Dglib.h62 static __always_inline ul ALIGN(const ul addr, const ul _align) in ALIGN() argument
64 return (ul)((addr + _align - 1) & (~(_align - 1))); in ALIGN()
/DragonOS-0.1.8/kernel/src/io/
Ddevice.rs325 pub fn __bytes_to_lba(addr: usize, blk_size: usize) -> BlockId { in __bytes_to_lba()
326 return addr / blk_size; in __bytes_to_lba()
/DragonOS-0.1.8/kernel/src/arch/x86_64/mm/
Dmod.rs253 PHYS_MEMORY_AREAS[areas_count].base = PhysAddr::new(mb2_mem_info[i].addr as usize); in init_memory_area_from_multiboot2()