MCPcopy Create free account
hub / github.com/F-Stack/f-stack / arm32_sync_icache

Function arm32_sync_icache

freebsd/arm/arm/sys_machdep.c:98–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96}
97
98static int
99arm32_sync_icache(struct thread *td, void *args)
100{
101 struct arm_sync_icache_args ua;
102 int error;
103 ksiginfo_t ksi;
104 vm_offset_t rv;
105
106 if ((error = copyin(args, &ua, sizeof(ua))) != 0)
107 return (error);
108
109 if (ua.len == 0) {
110 td->td_retval[0] = 0;
111 return (0);
112 }
113
114 /*
115 * Validate arguments. Address and length are unsigned,
116 * so we can use wrapped overflow check.
117 */
118 if (((ua.addr + ua.len) < ua.addr) ||
119 ((ua.addr + ua.len) > VM_MAXUSER_ADDRESS)) {
120 ksiginfo_init_trap(&ksi);
121 ksi.ksi_signo = SIGSEGV;
122 ksi.ksi_code = SEGV_ACCERR;
123 ksi.ksi_addr = (void *)max(ua.addr, VM_MAXUSER_ADDRESS);
124 trapsignal(td, &ksi);
125 return (EINVAL);
126 }
127
128 rv = sync_icache(ua.addr, ua.len);
129 if (rv != 1) {
130 ksiginfo_init_trap(&ksi);
131 ksi.ksi_signo = SIGSEGV;
132 ksi.ksi_code = SEGV_MAPERR;
133 ksi.ksi_addr = (void *)rv;
134 trapsignal(td, &ksi);
135 return (EINVAL);
136 }
137
138 td->td_retval[0] = 0;
139 return (0);
140}
141
142static int
143arm32_drain_writebuf(struct thread *td, void *args)

Callers 1

sysarchFunction · 0.85

Calls 4

maxFunction · 0.85
trapsignalFunction · 0.85
sync_icacheFunction · 0.85
copyinFunction · 0.50

Tested by

no test coverage detected