diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/linux/process.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/linux/process.cc Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,2134 @@ +/* + * Copyright (c) 2005 The Regents of The University of Michigan + * Copyright (c) 2007 MIPS Technologies, Inc. + * Copyright (c) 2016 The University of Virginia + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Gabe Black + * Korey Sewell + * Alec Roelke + */ + +#include "arch/riscv/linux/process.hh" + +#include "arch/riscv/linux/linux.hh" +#include "arch/riscv/isa_traits.hh" +#include "base/trace.hh" +#include "cpu/thread_context.hh" +#include "debug/SyscallVerbose.hh" +#include "kern/linux/linux.hh" +#include "sim/eventq.hh" +#include "sim/process.hh" +#include "sim/syscall_emul.hh" +#include "sim/system.hh" + +using namespace std; +using namespace RiscvISA; + +/// Target uname() handler. +static SyscallReturn +unameFunc(SyscallDesc *desc, int callnum, LiveProcess *process, + ThreadContext *tc) +{ + int index = 0; + TypedBufferArg name(process->getSyscallArg(tc, index)); + + strcpy(name->sysname, "Linux"); + strcpy(name->nodename,"sim.gem5.org"); + strcpy(name->release, "3.0.0"); + strcpy(name->version, "#1 Mon Aug 18 11:32:15 EDT 2003"); + strcpy(name->machine, "riscv"); + + name.copyOut(tc->getMemProxy()); + return 0; +} + +SyscallDesc RiscvLinuxProcess::syscallDescs[] = { + /* 0 */ SyscallDesc("unused#0", unimplementedFunc), + /* 1 */ SyscallDesc("unused#1", unimplementedFunc), + /* 2 */ SyscallDesc("unused#2", unimplementedFunc), + /* 3 */ SyscallDesc("unused#3", unimplementedFunc), + /* 4 */ SyscallDesc("unused#4", unimplementedFunc), + /* 5 */ SyscallDesc("unused#5", unimplementedFunc), + /* 6 */ SyscallDesc("unused#6", unimplementedFunc), + /* 7 */ SyscallDesc("unused#7", unimplementedFunc), + /* 8 */ SyscallDesc("unused#8", unimplementedFunc), + /* 9 */ SyscallDesc("unused#9", unimplementedFunc), + /* 10 */ SyscallDesc("unused#10", unimplementedFunc), + /* 11 */ SyscallDesc("unused#11", unimplementedFunc), + /* 12 */ SyscallDesc("unused#12", unimplementedFunc), + /* 13 */ SyscallDesc("unused#13", unimplementedFunc), + /* 14 */ SyscallDesc("unused#14", unimplementedFunc), + /* 15 */ SyscallDesc("unused#15", unimplementedFunc), + /* 16 */ SyscallDesc("unused#16", unimplementedFunc), + /* 17 */ SyscallDesc("getcwd", getcwdFunc), + /* 18 */ SyscallDesc("unused#18", unimplementedFunc), + /* 19 */ SyscallDesc("unused#19", unimplementedFunc), + /* 20 */ SyscallDesc("unused#20", unimplementedFunc), + /* 21 */ SyscallDesc("unused#21", unimplementedFunc), + /* 22 */ SyscallDesc("unused#22", unimplementedFunc), + /* 23 */ SyscallDesc("dup", unimplementedFunc), + /* 24 */ SyscallDesc("unused#24", unimplementedFunc), + /* 25 */ SyscallDesc("fcntl", fcntlFunc), + /* 26 */ SyscallDesc("unused#26", unimplementedFunc), + /* 27 */ SyscallDesc("unused#27", unimplementedFunc), + /* 28 */ SyscallDesc("unused#28", unimplementedFunc), + /* 29 */ SyscallDesc("ioctl", ioctlFunc), + /* 30 */ SyscallDesc("unused#30", unimplementedFunc), + /* 31 */ SyscallDesc("unused#31", unimplementedFunc), + /* 32 */ SyscallDesc("unused#32", unimplementedFunc), + /* 33 */ SyscallDesc("unused#33", unimplementedFunc), + /* 34 */ SyscallDesc("mkdirat", unimplementedFunc), + /* 35 */ SyscallDesc("unlinkat", unimplementedFunc), + /* 36 */ SyscallDesc("unused#36", unimplementedFunc), + /* 37 */ SyscallDesc("linkat", unimplementedFunc), + /* 38 */ SyscallDesc("unused#38", unimplementedFunc), + /* 39 */ SyscallDesc("unused#39", unimplementedFunc), + /* 40 */ SyscallDesc("unused#40", unimplementedFunc), + /* 41 */ SyscallDesc("unused#41", unimplementedFunc), + /* 42 */ SyscallDesc("unused#42", unimplementedFunc), + /* 43 */ SyscallDesc("unused#43", unimplementedFunc), + /* 44 */ SyscallDesc("unused#44", unimplementedFunc), + /* 45 */ SyscallDesc("unused#45", unimplementedFunc), + /* 46 */ SyscallDesc("ftruncate", ftruncateFunc), + /* 47 */ SyscallDesc("unused#47", unimplementedFunc), + /* 48 */ SyscallDesc("faccessat", unimplementedFunc), + /* 49 */ SyscallDesc("chdir", unimplementedFunc), + /* 50 */ SyscallDesc("unused#50", unimplementedFunc), + /* 51 */ SyscallDesc("unused#51", unimplementedFunc), + /* 52 */ SyscallDesc("unused#52", unimplementedFunc), + /* 53 */ SyscallDesc("unused#53", unimplementedFunc), + /* 54 */ SyscallDesc("unused#54", unimplementedFunc), + /* 55 */ SyscallDesc("unused#55", unimplementedFunc), + /* 56 */ SyscallDesc("openat", unimplementedFunc), + /* 57 */ SyscallDesc("close", closeFunc), + /* 58 */ SyscallDesc("unused#58", unimplementedFunc), + /* 59 */ SyscallDesc("unused#59", unimplementedFunc), + /* 60 */ SyscallDesc("unused#60", unimplementedFunc), + /* 61 */ SyscallDesc("getdents", unimplementedFunc), + /* 62 */ SyscallDesc("lseek", lseekFunc), + /* 63 */ SyscallDesc("read", readFunc), + /* 64 */ SyscallDesc("write", writeFunc), + /* 65 */ SyscallDesc("unused#65", unimplementedFunc), + /* 66 */ SyscallDesc("writev", writevFunc), + /* 67 */ SyscallDesc("pread", unimplementedFunc), + /* 68 */ SyscallDesc("pwrite", unimplementedFunc), + /* 69 */ SyscallDesc("unused#69", unimplementedFunc), + /* 70 */ SyscallDesc("unused#70", unimplementedFunc), + /* 71 */ SyscallDesc("unused#71", unimplementedFunc), + /* 72 */ SyscallDesc("unused#72", unimplementedFunc), + /* 73 */ SyscallDesc("unused#73", unimplementedFunc), + /* 74 */ SyscallDesc("unused#74", unimplementedFunc), + /* 75 */ SyscallDesc("unused#75", unimplementedFunc), + /* 76 */ SyscallDesc("unused#76", unimplementedFunc), + /* 77 */ SyscallDesc("unused#77", unimplementedFunc), + /* 78 */ SyscallDesc("readlinkat", unimplementedFunc), + /* 79 */ SyscallDesc("fstatat", unimplementedFunc), + /* 80 */ SyscallDesc("fstat", fstatFunc), + /* 81 */ SyscallDesc("unused#81", unimplementedFunc), + /* 82 */ SyscallDesc("unused#82", unimplementedFunc), + /* 83 */ SyscallDesc("unused#83", unimplementedFunc), + /* 84 */ SyscallDesc("unused#84", unimplementedFunc), + /* 85 */ SyscallDesc("unused#85", unimplementedFunc), + /* 86 */ SyscallDesc("unused#86", unimplementedFunc), + /* 87 */ SyscallDesc("unused#87", unimplementedFunc), + /* 88 */ SyscallDesc("unused#88", unimplementedFunc), + /* 89 */ SyscallDesc("unused#89", unimplementedFunc), + /* 90 */ SyscallDesc("unused#90", unimplementedFunc), + /* 91 */ SyscallDesc("unused#91", unimplementedFunc), + /* 92 */ SyscallDesc("unused#92", unimplementedFunc), + /* 93 */ SyscallDesc("exit", exitFunc), + /* 94 */ SyscallDesc("exit_group", exitFunc), + /* 95 */ SyscallDesc("unused#95", unimplementedFunc), + /* 96 */ SyscallDesc("unused#96", unimplementedFunc), + /* 97 */ SyscallDesc("unused#97", unimplementedFunc), + /* 98 */ SyscallDesc("unused#98", unimplementedFunc), + /* 99 */ SyscallDesc("unused#99", unimplementedFunc), + /* 100 */ SyscallDesc("unused#100", unimplementedFunc), + /* 101 */ SyscallDesc("unused#101", unimplementedFunc), + /* 102 */ SyscallDesc("unused#102", unimplementedFunc), + /* 103 */ SyscallDesc("unused#103", unimplementedFunc), + /* 104 */ SyscallDesc("unused#104", unimplementedFunc), + /* 105 */ SyscallDesc("unused#105", unimplementedFunc), + /* 106 */ SyscallDesc("unused#106", unimplementedFunc), + /* 107 */ SyscallDesc("unused#107", unimplementedFunc), + /* 108 */ SyscallDesc("unused#108", unimplementedFunc), + /* 109 */ SyscallDesc("unused#109", unimplementedFunc), + /* 110 */ SyscallDesc("unused#110", unimplementedFunc), + /* 111 */ SyscallDesc("unused#111", unimplementedFunc), + /* 112 */ SyscallDesc("unused#112", unimplementedFunc), + /* 113 */ SyscallDesc("clock_gettime", unimplementedFunc), + /* 114 */ SyscallDesc("unused#114", unimplementedFunc), + /* 115 */ SyscallDesc("unused#115", unimplementedFunc), + /* 116 */ SyscallDesc("unused#116", unimplementedFunc), + /* 117 */ SyscallDesc("unused#117", unimplementedFunc), + /* 118 */ SyscallDesc("unused#118", unimplementedFunc), + /* 119 */ SyscallDesc("unused#119", unimplementedFunc), + /* 120 */ SyscallDesc("unused#120", unimplementedFunc), + /* 121 */ SyscallDesc("unused#121", unimplementedFunc), + /* 122 */ SyscallDesc("unused#122", unimplementedFunc), + /* 123 */ SyscallDesc("unused#123", unimplementedFunc), + /* 124 */ SyscallDesc("unused#124", unimplementedFunc), + /* 125 */ SyscallDesc("unused#125", unimplementedFunc), + /* 126 */ SyscallDesc("unused#126", unimplementedFunc), + /* 127 */ SyscallDesc("unused#127", unimplementedFunc), + /* 128 */ SyscallDesc("unused#128", unimplementedFunc), + /* 129 */ SyscallDesc("kill", unimplementedFunc), + /* 130 */ SyscallDesc("unused#130", unimplementedFunc), + /* 131 */ SyscallDesc("unused#131", unimplementedFunc), + /* 132 */ SyscallDesc("unused#132", unimplementedFunc), + /* 133 */ SyscallDesc("unused#133", unimplementedFunc), + /* 134 */ SyscallDesc("rt_sigaction", unimplementedFunc), + /* 135 */ SyscallDesc("rt_sigprocmask", unimplementedFunc), + /* 136 */ SyscallDesc("unused#136", unimplementedFunc), + /* 137 */ SyscallDesc("unused#137", unimplementedFunc), + /* 138 */ SyscallDesc("unused#138", unimplementedFunc), + /* 139 */ SyscallDesc("unused#139", unimplementedFunc), + /* 140 */ SyscallDesc("unused#140", unimplementedFunc), + /* 141 */ SyscallDesc("unused#141", unimplementedFunc), + /* 142 */ SyscallDesc("unused#142", unimplementedFunc), + /* 143 */ SyscallDesc("unused#143", unimplementedFunc), + /* 144 */ SyscallDesc("unused#144", unimplementedFunc), + /* 145 */ SyscallDesc("unused#145", unimplementedFunc), + /* 146 */ SyscallDesc("unused#146", unimplementedFunc), + /* 147 */ SyscallDesc("unused#147", unimplementedFunc), + /* 148 */ SyscallDesc("unused#148", unimplementedFunc), + /* 149 */ SyscallDesc("unused#149", unimplementedFunc), + /* 150 */ SyscallDesc("unused#150", unimplementedFunc), + /* 151 */ SyscallDesc("unused#151", unimplementedFunc), + /* 152 */ SyscallDesc("unused#152", unimplementedFunc), + /* 153 */ SyscallDesc("times", unimplementedFunc), + /* 154 */ SyscallDesc("unused#154", unimplementedFunc), + /* 155 */ SyscallDesc("unused#155", unimplementedFunc), + /* 156 */ SyscallDesc("unused#156", unimplementedFunc), + /* 157 */ SyscallDesc("unused#157", unimplementedFunc), + /* 158 */ SyscallDesc("unused#158", unimplementedFunc), + /* 159 */ SyscallDesc("unused#159", unimplementedFunc), + /* 160 */ SyscallDesc("uname", unameFunc), + /* 161 */ SyscallDesc("unused#161", unimplementedFunc), + /* 162 */ SyscallDesc("unused#162", unimplementedFunc), + /* 163 */ SyscallDesc("getrlimit", unimplementedFunc), + /* 164 */ SyscallDesc("setrlimit", unimplementedFunc), + /* 165 */ SyscallDesc("getrusage", getrusageFunc), + /* 166 */ SyscallDesc("unused#166", unimplementedFunc), + /* 167 */ SyscallDesc("unused#167", unimplementedFunc), + /* 168 */ SyscallDesc("unused#168", unimplementedFunc), + /* 169 */ SyscallDesc("gettimeofday", unimplementedFunc), + /* 170 */ SyscallDesc("unused#170", unimplementedFunc), + /* 171 */ SyscallDesc("unused#171", unimplementedFunc), + /* 172 */ SyscallDesc("getpid", getpidFunc), + /* 173 */ SyscallDesc("unused#173", unimplementedFunc), + /* 174 */ SyscallDesc("getuid", getuidFunc), + /* 175 */ SyscallDesc("geteuid", geteuidFunc), + /* 176 */ SyscallDesc("getgid", getgidFunc), + /* 177 */ SyscallDesc("getegid", getegidFunc), + /* 178 */ SyscallDesc("unused#178", unimplementedFunc), + /* 179 */ SyscallDesc("unused#179", unimplementedFunc), + /* 180 */ SyscallDesc("unused#180", unimplementedFunc), + /* 181 */ SyscallDesc("unused#181", unimplementedFunc), + /* 182 */ SyscallDesc("unused#182", unimplementedFunc), + /* 183 */ SyscallDesc("unused#183", unimplementedFunc), + /* 184 */ SyscallDesc("unused#184", unimplementedFunc), + /* 185 */ SyscallDesc("unused#185", unimplementedFunc), + /* 186 */ SyscallDesc("unused#186", unimplementedFunc), + /* 187 */ SyscallDesc("unused#187", unimplementedFunc), + /* 188 */ SyscallDesc("unused#188", unimplementedFunc), + /* 189 */ SyscallDesc("unused#189", unimplementedFunc), + /* 190 */ SyscallDesc("unused#190", unimplementedFunc), + /* 191 */ SyscallDesc("unused#191", unimplementedFunc), + /* 192 */ SyscallDesc("unused#192", unimplementedFunc), + /* 193 */ SyscallDesc("unused#193", unimplementedFunc), + /* 194 */ SyscallDesc("unused#194", unimplementedFunc), + /* 195 */ SyscallDesc("unused#195", unimplementedFunc), + /* 196 */ SyscallDesc("unused#196", unimplementedFunc), + /* 197 */ SyscallDesc("unused#197", unimplementedFunc), + /* 198 */ SyscallDesc("unused#198", unimplementedFunc), + /* 199 */ SyscallDesc("unused#199", unimplementedFunc), + /* 200 */ SyscallDesc("unused#200", unimplementedFunc), + /* 201 */ SyscallDesc("unused#201", unimplementedFunc), + /* 202 */ SyscallDesc("unused#202", unimplementedFunc), + /* 203 */ SyscallDesc("unused#203", unimplementedFunc), + /* 204 */ SyscallDesc("unused#204", unimplementedFunc), + /* 205 */ SyscallDesc("unused#205", unimplementedFunc), + /* 206 */ SyscallDesc("unused#206", unimplementedFunc), + /* 207 */ SyscallDesc("unused#207", unimplementedFunc), + /* 208 */ SyscallDesc("unused#208", unimplementedFunc), + /* 209 */ SyscallDesc("unused#209", unimplementedFunc), + /* 210 */ SyscallDesc("unused#210", unimplementedFunc), + /* 211 */ SyscallDesc("unused#211", unimplementedFunc), + /* 212 */ SyscallDesc("unused#212", unimplementedFunc), + /* 213 */ SyscallDesc("unused#213", unimplementedFunc), + /* 214 */ SyscallDesc("brk", brkFunc), + /* 215 */ SyscallDesc("munmap", munmapFunc), + /* 216 */ SyscallDesc("mremap", mremapFunc), + /* 217 */ SyscallDesc("unused#217", unimplementedFunc), + /* 218 */ SyscallDesc("unused#218", unimplementedFunc), + /* 219 */ SyscallDesc("unused#219", unimplementedFunc), + /* 220 */ SyscallDesc("unused#220", unimplementedFunc), + /* 221 */ SyscallDesc("unused#221", unimplementedFunc), + /* 222 */ SyscallDesc("mmap", mmapFunc), + /* 223 */ SyscallDesc("unused#223", unimplementedFunc), + /* 224 */ SyscallDesc("unused#224", unimplementedFunc), + /* 225 */ SyscallDesc("unused#225", unimplementedFunc), + /* 226 */ SyscallDesc("mprotect", ignoreFunc), + /* 227 */ SyscallDesc("unused#227", unimplementedFunc), + /* 228 */ SyscallDesc("unused#228", unimplementedFunc), + /* 229 */ SyscallDesc("unused#229", unimplementedFunc), + /* 230 */ SyscallDesc("unused#230", unimplementedFunc), + /* 231 */ SyscallDesc("unused#231", unimplementedFunc), + /* 232 */ SyscallDesc("unused#232", unimplementedFunc), + /* 233 */ SyscallDesc("unused#233", unimplementedFunc), + /* 234 */ SyscallDesc("unused#234", unimplementedFunc), + /* 235 */ SyscallDesc("unused#235", unimplementedFunc), + /* 236 */ SyscallDesc("unused#236", unimplementedFunc), + /* 237 */ SyscallDesc("unused#237", unimplementedFunc), + /* 238 */ SyscallDesc("unused#238", unimplementedFunc), + /* 239 */ SyscallDesc("unused#239", unimplementedFunc), + /* 240 */ SyscallDesc("unused#240", unimplementedFunc), + /* 241 */ SyscallDesc("unused#241", unimplementedFunc), + /* 242 */ SyscallDesc("unused#242", unimplementedFunc), + /* 243 */ SyscallDesc("unused#243", unimplementedFunc), + /* 244 */ SyscallDesc("unused#244", unimplementedFunc), + /* 245 */ SyscallDesc("unused#245", unimplementedFunc), + /* 246 */ SyscallDesc("unused#246", unimplementedFunc), + /* 247 */ SyscallDesc("unused#247", unimplementedFunc), + /* 248 */ SyscallDesc("unused#248", unimplementedFunc), + /* 249 */ SyscallDesc("unused#249", unimplementedFunc), + /* 250 */ SyscallDesc("unused#250", unimplementedFunc), + /* 251 */ SyscallDesc("unused#251", unimplementedFunc), + /* 252 */ SyscallDesc("unused#252", unimplementedFunc), + /* 253 */ SyscallDesc("unused#253", unimplementedFunc), + /* 254 */ SyscallDesc("unused#254", unimplementedFunc), + /* 255 */ SyscallDesc("unused#255", unimplementedFunc), + /* 256 */ SyscallDesc("unused#256", unimplementedFunc), + /* 257 */ SyscallDesc("unused#257", unimplementedFunc), + /* 258 */ SyscallDesc("unused#258", unimplementedFunc), + /* 259 */ SyscallDesc("unused#259", unimplementedFunc), + /* 260 */ SyscallDesc("unused#260", unimplementedFunc), + /* 261 */ SyscallDesc("unused#261", unimplementedFunc), + /* 262 */ SyscallDesc("unused#262", unimplementedFunc), + /* 263 */ SyscallDesc("unused#263", unimplementedFunc), + /* 264 */ SyscallDesc("unused#264", unimplementedFunc), + /* 265 */ SyscallDesc("unused#265", unimplementedFunc), + /* 266 */ SyscallDesc("unused#266", unimplementedFunc), + /* 267 */ SyscallDesc("unused#267", unimplementedFunc), + /* 268 */ SyscallDesc("unused#268", unimplementedFunc), + /* 269 */ SyscallDesc("unused#269", unimplementedFunc), + /* 270 */ SyscallDesc("unused#270", unimplementedFunc), + /* 271 */ SyscallDesc("unused#271", unimplementedFunc), + /* 272 */ SyscallDesc("unused#272", unimplementedFunc), + /* 273 */ SyscallDesc("unused#273", unimplementedFunc), + /* 274 */ SyscallDesc("unused#274", unimplementedFunc), + /* 275 */ SyscallDesc("unused#275", unimplementedFunc), + /* 276 */ SyscallDesc("unused#276", unimplementedFunc), + /* 277 */ SyscallDesc("unused#277", unimplementedFunc), + /* 278 */ SyscallDesc("unused#278", unimplementedFunc), + /* 279 */ SyscallDesc("unused#279", unimplementedFunc), + /* 280 */ SyscallDesc("unused#280", unimplementedFunc), + /* 281 */ SyscallDesc("unused#281", unimplementedFunc), + /* 282 */ SyscallDesc("unused#282", unimplementedFunc), + /* 283 */ SyscallDesc("unused#283", unimplementedFunc), + /* 284 */ SyscallDesc("unused#284", unimplementedFunc), + /* 285 */ SyscallDesc("unused#285", unimplementedFunc), + /* 286 */ SyscallDesc("unused#286", unimplementedFunc), + /* 287 */ SyscallDesc("unused#287", unimplementedFunc), + /* 288 */ SyscallDesc("unused#288", unimplementedFunc), + /* 289 */ SyscallDesc("unused#289", unimplementedFunc), + /* 290 */ SyscallDesc("unused#290", unimplementedFunc), + /* 291 */ SyscallDesc("unused#291", unimplementedFunc), + /* 292 */ SyscallDesc("unused#292", unimplementedFunc), + /* 293 */ SyscallDesc("unused#293", unimplementedFunc), + /* 294 */ SyscallDesc("unused#294", unimplementedFunc), + /* 295 */ SyscallDesc("unused#295", unimplementedFunc), + /* 296 */ SyscallDesc("unused#296", unimplementedFunc), + /* 297 */ SyscallDesc("unused#297", unimplementedFunc), + /* 298 */ SyscallDesc("unused#298", unimplementedFunc), + /* 299 */ SyscallDesc("unused#299", unimplementedFunc), + /* 300 */ SyscallDesc("unused#300", unimplementedFunc), + /* 301 */ SyscallDesc("unused#301", unimplementedFunc), + /* 302 */ SyscallDesc("unused#302", unimplementedFunc), + /* 303 */ SyscallDesc("unused#303", unimplementedFunc), + /* 304 */ SyscallDesc("unused#304", unimplementedFunc), + /* 305 */ SyscallDesc("unused#305", unimplementedFunc), + /* 306 */ SyscallDesc("unused#306", unimplementedFunc), + /* 307 */ SyscallDesc("unused#307", unimplementedFunc), + /* 308 */ SyscallDesc("unused#308", unimplementedFunc), + /* 309 */ SyscallDesc("unused#309", unimplementedFunc), + /* 310 */ SyscallDesc("unused#310", unimplementedFunc), + /* 311 */ SyscallDesc("unused#311", unimplementedFunc), + /* 312 */ SyscallDesc("unused#312", unimplementedFunc), + /* 313 */ SyscallDesc("unused#313", unimplementedFunc), + /* 314 */ SyscallDesc("unused#314", unimplementedFunc), + /* 315 */ SyscallDesc("unused#315", unimplementedFunc), + /* 316 */ SyscallDesc("unused#316", unimplementedFunc), + /* 317 */ SyscallDesc("unused#317", unimplementedFunc), + /* 318 */ SyscallDesc("unused#318", unimplementedFunc), + /* 319 */ SyscallDesc("unused#319", unimplementedFunc), + /* 320 */ SyscallDesc("unused#320", unimplementedFunc), + /* 321 */ SyscallDesc("unused#321", unimplementedFunc), + /* 322 */ SyscallDesc("unused#322", unimplementedFunc), + /* 323 */ SyscallDesc("unused#323", unimplementedFunc), + /* 324 */ SyscallDesc("unused#324", unimplementedFunc), + /* 325 */ SyscallDesc("unused#325", unimplementedFunc), + /* 326 */ SyscallDesc("unused#326", unimplementedFunc), + /* 327 */ SyscallDesc("unused#327", unimplementedFunc), + /* 328 */ SyscallDesc("unused#328", unimplementedFunc), + /* 329 */ SyscallDesc("unused#329", unimplementedFunc), + /* 330 */ SyscallDesc("unused#330", unimplementedFunc), + /* 331 */ SyscallDesc("unused#331", unimplementedFunc), + /* 332 */ SyscallDesc("unused#332", unimplementedFunc), + /* 333 */ SyscallDesc("unused#333", unimplementedFunc), + /* 334 */ SyscallDesc("unused#334", unimplementedFunc), + /* 335 */ SyscallDesc("unused#335", unimplementedFunc), + /* 336 */ SyscallDesc("unused#336", unimplementedFunc), + /* 337 */ SyscallDesc("unused#337", unimplementedFunc), + /* 338 */ SyscallDesc("unused#338", unimplementedFunc), + /* 339 */ SyscallDesc("unused#339", unimplementedFunc), + /* 340 */ SyscallDesc("unused#340", unimplementedFunc), + /* 341 */ SyscallDesc("unused#341", unimplementedFunc), + /* 342 */ SyscallDesc("unused#342", unimplementedFunc), + /* 343 */ SyscallDesc("unused#343", unimplementedFunc), + /* 344 */ SyscallDesc("unused#344", unimplementedFunc), + /* 345 */ SyscallDesc("unused#345", unimplementedFunc), + /* 346 */ SyscallDesc("unused#346", unimplementedFunc), + /* 347 */ SyscallDesc("unused#347", unimplementedFunc), + /* 348 */ SyscallDesc("unused#348", unimplementedFunc), + /* 349 */ SyscallDesc("unused#349", unimplementedFunc), + /* 350 */ SyscallDesc("unused#350", unimplementedFunc), + /* 351 */ SyscallDesc("unused#351", unimplementedFunc), + /* 352 */ SyscallDesc("unused#352", unimplementedFunc), + /* 353 */ SyscallDesc("unused#353", unimplementedFunc), + /* 354 */ SyscallDesc("unused#354", unimplementedFunc), + /* 355 */ SyscallDesc("unused#355", unimplementedFunc), + /* 356 */ SyscallDesc("unused#356", unimplementedFunc), + /* 357 */ SyscallDesc("unused#357", unimplementedFunc), + /* 358 */ SyscallDesc("unused#358", unimplementedFunc), + /* 359 */ SyscallDesc("unused#359", unimplementedFunc), + /* 360 */ SyscallDesc("unused#360", unimplementedFunc), + /* 361 */ SyscallDesc("unused#361", unimplementedFunc), + /* 362 */ SyscallDesc("unused#362", unimplementedFunc), + /* 363 */ SyscallDesc("unused#363", unimplementedFunc), + /* 364 */ SyscallDesc("unused#364", unimplementedFunc), + /* 365 */ SyscallDesc("unused#365", unimplementedFunc), + /* 366 */ SyscallDesc("unused#366", unimplementedFunc), + /* 367 */ SyscallDesc("unused#367", unimplementedFunc), + /* 368 */ SyscallDesc("unused#368", unimplementedFunc), + /* 369 */ SyscallDesc("unused#369", unimplementedFunc), + /* 370 */ SyscallDesc("unused#370", unimplementedFunc), + /* 371 */ SyscallDesc("unused#371", unimplementedFunc), + /* 372 */ SyscallDesc("unused#372", unimplementedFunc), + /* 373 */ SyscallDesc("unused#373", unimplementedFunc), + /* 374 */ SyscallDesc("unused#374", unimplementedFunc), + /* 375 */ SyscallDesc("unused#375", unimplementedFunc), + /* 376 */ SyscallDesc("unused#376", unimplementedFunc), + /* 377 */ SyscallDesc("unused#377", unimplementedFunc), + /* 378 */ SyscallDesc("unused#378", unimplementedFunc), + /* 379 */ SyscallDesc("unused#379", unimplementedFunc), + /* 380 */ SyscallDesc("unused#380", unimplementedFunc), + /* 381 */ SyscallDesc("unused#381", unimplementedFunc), + /* 382 */ SyscallDesc("unused#382", unimplementedFunc), + /* 383 */ SyscallDesc("unused#383", unimplementedFunc), + /* 384 */ SyscallDesc("unused#384", unimplementedFunc), + /* 385 */ SyscallDesc("unused#385", unimplementedFunc), + /* 386 */ SyscallDesc("unused#386", unimplementedFunc), + /* 387 */ SyscallDesc("unused#387", unimplementedFunc), + /* 388 */ SyscallDesc("unused#388", unimplementedFunc), + /* 389 */ SyscallDesc("unused#389", unimplementedFunc), + /* 390 */ SyscallDesc("unused#390", unimplementedFunc), + /* 391 */ SyscallDesc("unused#391", unimplementedFunc), + /* 392 */ SyscallDesc("unused#392", unimplementedFunc), + /* 393 */ SyscallDesc("unused#393", unimplementedFunc), + /* 394 */ SyscallDesc("unused#394", unimplementedFunc), + /* 395 */ SyscallDesc("unused#395", unimplementedFunc), + /* 396 */ SyscallDesc("unused#396", unimplementedFunc), + /* 397 */ SyscallDesc("unused#397", unimplementedFunc), + /* 398 */ SyscallDesc("unused#398", unimplementedFunc), + /* 399 */ SyscallDesc("unused#399", unimplementedFunc), + /* 400 */ SyscallDesc("unused#400", unimplementedFunc), + /* 401 */ SyscallDesc("unused#401", unimplementedFunc), + /* 402 */ SyscallDesc("unused#402", unimplementedFunc), + /* 403 */ SyscallDesc("unused#403", unimplementedFunc), + /* 404 */ SyscallDesc("unused#404", unimplementedFunc), + /* 405 */ SyscallDesc("unused#405", unimplementedFunc), + /* 406 */ SyscallDesc("unused#406", unimplementedFunc), + /* 407 */ SyscallDesc("unused#407", unimplementedFunc), + /* 408 */ SyscallDesc("unused#408", unimplementedFunc), + /* 409 */ SyscallDesc("unused#409", unimplementedFunc), + /* 410 */ SyscallDesc("unused#410", unimplementedFunc), + /* 411 */ SyscallDesc("unused#411", unimplementedFunc), + /* 412 */ SyscallDesc("unused#412", unimplementedFunc), + /* 413 */ SyscallDesc("unused#413", unimplementedFunc), + /* 414 */ SyscallDesc("unused#414", unimplementedFunc), + /* 415 */ SyscallDesc("unused#415", unimplementedFunc), + /* 416 */ SyscallDesc("unused#416", unimplementedFunc), + /* 417 */ SyscallDesc("unused#417", unimplementedFunc), + /* 418 */ SyscallDesc("unused#418", unimplementedFunc), + /* 419 */ SyscallDesc("unused#419", unimplementedFunc), + /* 420 */ SyscallDesc("unused#420", unimplementedFunc), + /* 421 */ SyscallDesc("unused#421", unimplementedFunc), + /* 422 */ SyscallDesc("unused#422", unimplementedFunc), + /* 423 */ SyscallDesc("unused#423", unimplementedFunc), + /* 424 */ SyscallDesc("unused#424", unimplementedFunc), + /* 425 */ SyscallDesc("unused#425", unimplementedFunc), + /* 426 */ SyscallDesc("unused#426", unimplementedFunc), + /* 427 */ SyscallDesc("unused#427", unimplementedFunc), + /* 428 */ SyscallDesc("unused#428", unimplementedFunc), + /* 429 */ SyscallDesc("unused#429", unimplementedFunc), + /* 430 */ SyscallDesc("unused#430", unimplementedFunc), + /* 431 */ SyscallDesc("unused#431", unimplementedFunc), + /* 432 */ SyscallDesc("unused#432", unimplementedFunc), + /* 433 */ SyscallDesc("unused#433", unimplementedFunc), + /* 434 */ SyscallDesc("unused#434", unimplementedFunc), + /* 435 */ SyscallDesc("unused#435", unimplementedFunc), + /* 436 */ SyscallDesc("unused#436", unimplementedFunc), + /* 437 */ SyscallDesc("unused#437", unimplementedFunc), + /* 438 */ SyscallDesc("unused#438", unimplementedFunc), + /* 439 */ SyscallDesc("unused#439", unimplementedFunc), + /* 440 */ SyscallDesc("unused#440", unimplementedFunc), + /* 441 */ SyscallDesc("unused#441", unimplementedFunc), + /* 442 */ SyscallDesc("unused#442", unimplementedFunc), + /* 443 */ SyscallDesc("unused#443", unimplementedFunc), + /* 444 */ SyscallDesc("unused#444", unimplementedFunc), + /* 445 */ SyscallDesc("unused#445", unimplementedFunc), + /* 446 */ SyscallDesc("unused#446", unimplementedFunc), + /* 447 */ SyscallDesc("unused#447", unimplementedFunc), + /* 448 */ SyscallDesc("unused#448", unimplementedFunc), + /* 449 */ SyscallDesc("unused#449", unimplementedFunc), + /* 450 */ SyscallDesc("unused#450", unimplementedFunc), + /* 451 */ SyscallDesc("unused#451", unimplementedFunc), + /* 452 */ SyscallDesc("unused#452", unimplementedFunc), + /* 453 */ SyscallDesc("unused#453", unimplementedFunc), + /* 454 */ SyscallDesc("unused#454", unimplementedFunc), + /* 455 */ SyscallDesc("unused#455", unimplementedFunc), + /* 456 */ SyscallDesc("unused#456", unimplementedFunc), + /* 457 */ SyscallDesc("unused#457", unimplementedFunc), + /* 458 */ SyscallDesc("unused#458", unimplementedFunc), + /* 459 */ SyscallDesc("unused#459", unimplementedFunc), + /* 460 */ SyscallDesc("unused#460", unimplementedFunc), + /* 461 */ SyscallDesc("unused#461", unimplementedFunc), + /* 462 */ SyscallDesc("unused#462", unimplementedFunc), + /* 463 */ SyscallDesc("unused#463", unimplementedFunc), + /* 464 */ SyscallDesc("unused#464", unimplementedFunc), + /* 465 */ SyscallDesc("unused#465", unimplementedFunc), + /* 466 */ SyscallDesc("unused#466", unimplementedFunc), + /* 467 */ SyscallDesc("unused#467", unimplementedFunc), + /* 468 */ SyscallDesc("unused#468", unimplementedFunc), + /* 469 */ SyscallDesc("unused#469", unimplementedFunc), + /* 470 */ SyscallDesc("unused#470", unimplementedFunc), + /* 471 */ SyscallDesc("unused#471", unimplementedFunc), + /* 472 */ SyscallDesc("unused#472", unimplementedFunc), + /* 473 */ SyscallDesc("unused#473", unimplementedFunc), + /* 474 */ SyscallDesc("unused#474", unimplementedFunc), + /* 475 */ SyscallDesc("unused#475", unimplementedFunc), + /* 476 */ SyscallDesc("unused#476", unimplementedFunc), + /* 477 */ SyscallDesc("unused#477", unimplementedFunc), + /* 478 */ SyscallDesc("unused#478", unimplementedFunc), + /* 479 */ SyscallDesc("unused#479", unimplementedFunc), + /* 480 */ SyscallDesc("unused#480", unimplementedFunc), + /* 481 */ SyscallDesc("unused#481", unimplementedFunc), + /* 482 */ SyscallDesc("unused#482", unimplementedFunc), + /* 483 */ SyscallDesc("unused#483", unimplementedFunc), + /* 484 */ SyscallDesc("unused#484", unimplementedFunc), + /* 485 */ SyscallDesc("unused#485", unimplementedFunc), + /* 486 */ SyscallDesc("unused#486", unimplementedFunc), + /* 487 */ SyscallDesc("unused#487", unimplementedFunc), + /* 488 */ SyscallDesc("unused#488", unimplementedFunc), + /* 489 */ SyscallDesc("unused#489", unimplementedFunc), + /* 490 */ SyscallDesc("unused#490", unimplementedFunc), + /* 491 */ SyscallDesc("unused#491", unimplementedFunc), + /* 492 */ SyscallDesc("unused#492", unimplementedFunc), + /* 493 */ SyscallDesc("unused#493", unimplementedFunc), + /* 494 */ SyscallDesc("unused#494", unimplementedFunc), + /* 495 */ SyscallDesc("unused#495", unimplementedFunc), + /* 496 */ SyscallDesc("unused#496", unimplementedFunc), + /* 497 */ SyscallDesc("unused#497", unimplementedFunc), + /* 498 */ SyscallDesc("unused#498", unimplementedFunc), + /* 499 */ SyscallDesc("unused#499", unimplementedFunc), + /* 500 */ SyscallDesc("unused#500", unimplementedFunc), + /* 501 */ SyscallDesc("unused#501", unimplementedFunc), + /* 502 */ SyscallDesc("unused#502", unimplementedFunc), + /* 503 */ SyscallDesc("unused#503", unimplementedFunc), + /* 504 */ SyscallDesc("unused#504", unimplementedFunc), + /* 505 */ SyscallDesc("unused#505", unimplementedFunc), + /* 506 */ SyscallDesc("unused#506", unimplementedFunc), + /* 507 */ SyscallDesc("unused#507", unimplementedFunc), + /* 508 */ SyscallDesc("unused#508", unimplementedFunc), + /* 509 */ SyscallDesc("unused#509", unimplementedFunc), + /* 510 */ SyscallDesc("unused#510", unimplementedFunc), + /* 511 */ SyscallDesc("unused#511", unimplementedFunc), + /* 512 */ SyscallDesc("unused#512", unimplementedFunc), + /* 513 */ SyscallDesc("unused#513", unimplementedFunc), + /* 514 */ SyscallDesc("unused#514", unimplementedFunc), + /* 515 */ SyscallDesc("unused#515", unimplementedFunc), + /* 516 */ SyscallDesc("unused#516", unimplementedFunc), + /* 517 */ SyscallDesc("unused#517", unimplementedFunc), + /* 518 */ SyscallDesc("unused#518", unimplementedFunc), + /* 519 */ SyscallDesc("unused#519", unimplementedFunc), + /* 520 */ SyscallDesc("unused#520", unimplementedFunc), + /* 521 */ SyscallDesc("unused#521", unimplementedFunc), + /* 522 */ SyscallDesc("unused#522", unimplementedFunc), + /* 523 */ SyscallDesc("unused#523", unimplementedFunc), + /* 524 */ SyscallDesc("unused#524", unimplementedFunc), + /* 525 */ SyscallDesc("unused#525", unimplementedFunc), + /* 526 */ SyscallDesc("unused#526", unimplementedFunc), + /* 527 */ SyscallDesc("unused#527", unimplementedFunc), + /* 528 */ SyscallDesc("unused#528", unimplementedFunc), + /* 529 */ SyscallDesc("unused#529", unimplementedFunc), + /* 530 */ SyscallDesc("unused#530", unimplementedFunc), + /* 531 */ SyscallDesc("unused#531", unimplementedFunc), + /* 532 */ SyscallDesc("unused#532", unimplementedFunc), + /* 533 */ SyscallDesc("unused#533", unimplementedFunc), + /* 534 */ SyscallDesc("unused#534", unimplementedFunc), + /* 535 */ SyscallDesc("unused#535", unimplementedFunc), + /* 536 */ SyscallDesc("unused#536", unimplementedFunc), + /* 537 */ SyscallDesc("unused#537", unimplementedFunc), + /* 538 */ SyscallDesc("unused#538", unimplementedFunc), + /* 539 */ SyscallDesc("unused#539", unimplementedFunc), + /* 540 */ SyscallDesc("unused#540", unimplementedFunc), + /* 541 */ SyscallDesc("unused#541", unimplementedFunc), + /* 542 */ SyscallDesc("unused#542", unimplementedFunc), + /* 543 */ SyscallDesc("unused#543", unimplementedFunc), + /* 544 */ SyscallDesc("unused#544", unimplementedFunc), + /* 545 */ SyscallDesc("unused#545", unimplementedFunc), + /* 546 */ SyscallDesc("unused#546", unimplementedFunc), + /* 547 */ SyscallDesc("unused#547", unimplementedFunc), + /* 548 */ SyscallDesc("unused#548", unimplementedFunc), + /* 549 */ SyscallDesc("unused#549", unimplementedFunc), + /* 550 */ SyscallDesc("unused#550", unimplementedFunc), + /* 551 */ SyscallDesc("unused#551", unimplementedFunc), + /* 552 */ SyscallDesc("unused#552", unimplementedFunc), + /* 553 */ SyscallDesc("unused#553", unimplementedFunc), + /* 554 */ SyscallDesc("unused#554", unimplementedFunc), + /* 555 */ SyscallDesc("unused#555", unimplementedFunc), + /* 556 */ SyscallDesc("unused#556", unimplementedFunc), + /* 557 */ SyscallDesc("unused#557", unimplementedFunc), + /* 558 */ SyscallDesc("unused#558", unimplementedFunc), + /* 559 */ SyscallDesc("unused#559", unimplementedFunc), + /* 560 */ SyscallDesc("unused#560", unimplementedFunc), + /* 561 */ SyscallDesc("unused#561", unimplementedFunc), + /* 562 */ SyscallDesc("unused#562", unimplementedFunc), + /* 563 */ SyscallDesc("unused#563", unimplementedFunc), + /* 564 */ SyscallDesc("unused#564", unimplementedFunc), + /* 565 */ SyscallDesc("unused#565", unimplementedFunc), + /* 566 */ SyscallDesc("unused#566", unimplementedFunc), + /* 567 */ SyscallDesc("unused#567", unimplementedFunc), + /* 568 */ SyscallDesc("unused#568", unimplementedFunc), + /* 569 */ SyscallDesc("unused#569", unimplementedFunc), + /* 570 */ SyscallDesc("unused#570", unimplementedFunc), + /* 571 */ SyscallDesc("unused#571", unimplementedFunc), + /* 572 */ SyscallDesc("unused#572", unimplementedFunc), + /* 573 */ SyscallDesc("unused#573", unimplementedFunc), + /* 574 */ SyscallDesc("unused#574", unimplementedFunc), + /* 575 */ SyscallDesc("unused#575", unimplementedFunc), + /* 576 */ SyscallDesc("unused#576", unimplementedFunc), + /* 577 */ SyscallDesc("unused#577", unimplementedFunc), + /* 578 */ SyscallDesc("unused#578", unimplementedFunc), + /* 579 */ SyscallDesc("unused#579", unimplementedFunc), + /* 580 */ SyscallDesc("unused#580", unimplementedFunc), + /* 581 */ SyscallDesc("unused#581", unimplementedFunc), + /* 582 */ SyscallDesc("unused#582", unimplementedFunc), + /* 583 */ SyscallDesc("unused#583", unimplementedFunc), + /* 584 */ SyscallDesc("unused#584", unimplementedFunc), + /* 585 */ SyscallDesc("unused#585", unimplementedFunc), + /* 586 */ SyscallDesc("unused#586", unimplementedFunc), + /* 587 */ SyscallDesc("unused#587", unimplementedFunc), + /* 588 */ SyscallDesc("unused#588", unimplementedFunc), + /* 589 */ SyscallDesc("unused#589", unimplementedFunc), + /* 590 */ SyscallDesc("unused#590", unimplementedFunc), + /* 591 */ SyscallDesc("unused#591", unimplementedFunc), + /* 592 */ SyscallDesc("unused#592", unimplementedFunc), + /* 593 */ SyscallDesc("unused#593", unimplementedFunc), + /* 594 */ SyscallDesc("unused#594", unimplementedFunc), + /* 595 */ SyscallDesc("unused#595", unimplementedFunc), + /* 596 */ SyscallDesc("unused#596", unimplementedFunc), + /* 597 */ SyscallDesc("unused#597", unimplementedFunc), + /* 598 */ SyscallDesc("unused#598", unimplementedFunc), + /* 599 */ SyscallDesc("unused#599", unimplementedFunc), + /* 600 */ SyscallDesc("unused#600", unimplementedFunc), + /* 601 */ SyscallDesc("unused#601", unimplementedFunc), + /* 602 */ SyscallDesc("unused#602", unimplementedFunc), + /* 603 */ SyscallDesc("unused#603", unimplementedFunc), + /* 604 */ SyscallDesc("unused#604", unimplementedFunc), + /* 605 */ SyscallDesc("unused#605", unimplementedFunc), + /* 606 */ SyscallDesc("unused#606", unimplementedFunc), + /* 607 */ SyscallDesc("unused#607", unimplementedFunc), + /* 608 */ SyscallDesc("unused#608", unimplementedFunc), + /* 609 */ SyscallDesc("unused#609", unimplementedFunc), + /* 610 */ SyscallDesc("unused#610", unimplementedFunc), + /* 611 */ SyscallDesc("unused#611", unimplementedFunc), + /* 612 */ SyscallDesc("unused#612", unimplementedFunc), + /* 613 */ SyscallDesc("unused#613", unimplementedFunc), + /* 614 */ SyscallDesc("unused#614", unimplementedFunc), + /* 615 */ SyscallDesc("unused#615", unimplementedFunc), + /* 616 */ SyscallDesc("unused#616", unimplementedFunc), + /* 617 */ SyscallDesc("unused#617", unimplementedFunc), + /* 618 */ SyscallDesc("unused#618", unimplementedFunc), + /* 619 */ SyscallDesc("unused#619", unimplementedFunc), + /* 620 */ SyscallDesc("unused#620", unimplementedFunc), + /* 621 */ SyscallDesc("unused#621", unimplementedFunc), + /* 622 */ SyscallDesc("unused#622", unimplementedFunc), + /* 623 */ SyscallDesc("unused#623", unimplementedFunc), + /* 624 */ SyscallDesc("unused#624", unimplementedFunc), + /* 625 */ SyscallDesc("unused#625", unimplementedFunc), + /* 626 */ SyscallDesc("unused#626", unimplementedFunc), + /* 627 */ SyscallDesc("unused#627", unimplementedFunc), + /* 628 */ SyscallDesc("unused#628", unimplementedFunc), + /* 629 */ SyscallDesc("unused#629", unimplementedFunc), + /* 630 */ SyscallDesc("unused#630", unimplementedFunc), + /* 631 */ SyscallDesc("unused#631", unimplementedFunc), + /* 632 */ SyscallDesc("unused#632", unimplementedFunc), + /* 633 */ SyscallDesc("unused#633", unimplementedFunc), + /* 634 */ SyscallDesc("unused#634", unimplementedFunc), + /* 635 */ SyscallDesc("unused#635", unimplementedFunc), + /* 636 */ SyscallDesc("unused#636", unimplementedFunc), + /* 637 */ SyscallDesc("unused#637", unimplementedFunc), + /* 638 */ SyscallDesc("unused#638", unimplementedFunc), + /* 639 */ SyscallDesc("unused#639", unimplementedFunc), + /* 640 */ SyscallDesc("unused#640", unimplementedFunc), + /* 641 */ SyscallDesc("unused#641", unimplementedFunc), + /* 642 */ SyscallDesc("unused#642", unimplementedFunc), + /* 643 */ SyscallDesc("unused#643", unimplementedFunc), + /* 644 */ SyscallDesc("unused#644", unimplementedFunc), + /* 645 */ SyscallDesc("unused#645", unimplementedFunc), + /* 646 */ SyscallDesc("unused#646", unimplementedFunc), + /* 647 */ SyscallDesc("unused#647", unimplementedFunc), + /* 648 */ SyscallDesc("unused#648", unimplementedFunc), + /* 649 */ SyscallDesc("unused#649", unimplementedFunc), + /* 650 */ SyscallDesc("unused#650", unimplementedFunc), + /* 651 */ SyscallDesc("unused#651", unimplementedFunc), + /* 652 */ SyscallDesc("unused#652", unimplementedFunc), + /* 653 */ SyscallDesc("unused#653", unimplementedFunc), + /* 654 */ SyscallDesc("unused#654", unimplementedFunc), + /* 655 */ SyscallDesc("unused#655", unimplementedFunc), + /* 656 */ SyscallDesc("unused#656", unimplementedFunc), + /* 657 */ SyscallDesc("unused#657", unimplementedFunc), + /* 658 */ SyscallDesc("unused#658", unimplementedFunc), + /* 659 */ SyscallDesc("unused#659", unimplementedFunc), + /* 660 */ SyscallDesc("unused#660", unimplementedFunc), + /* 661 */ SyscallDesc("unused#661", unimplementedFunc), + /* 662 */ SyscallDesc("unused#662", unimplementedFunc), + /* 663 */ SyscallDesc("unused#663", unimplementedFunc), + /* 664 */ SyscallDesc("unused#664", unimplementedFunc), + /* 665 */ SyscallDesc("unused#665", unimplementedFunc), + /* 666 */ SyscallDesc("unused#666", unimplementedFunc), + /* 667 */ SyscallDesc("unused#667", unimplementedFunc), + /* 668 */ SyscallDesc("unused#668", unimplementedFunc), + /* 669 */ SyscallDesc("unused#669", unimplementedFunc), + /* 670 */ SyscallDesc("unused#670", unimplementedFunc), + /* 671 */ SyscallDesc("unused#671", unimplementedFunc), + /* 672 */ SyscallDesc("unused#672", unimplementedFunc), + /* 673 */ SyscallDesc("unused#673", unimplementedFunc), + /* 674 */ SyscallDesc("unused#674", unimplementedFunc), + /* 675 */ SyscallDesc("unused#675", unimplementedFunc), + /* 676 */ SyscallDesc("unused#676", unimplementedFunc), + /* 677 */ SyscallDesc("unused#677", unimplementedFunc), + /* 678 */ SyscallDesc("unused#678", unimplementedFunc), + /* 679 */ SyscallDesc("unused#679", unimplementedFunc), + /* 680 */ SyscallDesc("unused#680", unimplementedFunc), + /* 681 */ SyscallDesc("unused#681", unimplementedFunc), + /* 682 */ SyscallDesc("unused#682", unimplementedFunc), + /* 683 */ SyscallDesc("unused#683", unimplementedFunc), + /* 684 */ SyscallDesc("unused#684", unimplementedFunc), + /* 685 */ SyscallDesc("unused#685", unimplementedFunc), + /* 686 */ SyscallDesc("unused#686", unimplementedFunc), + /* 687 */ SyscallDesc("unused#687", unimplementedFunc), + /* 688 */ SyscallDesc("unused#688", unimplementedFunc), + /* 689 */ SyscallDesc("unused#689", unimplementedFunc), + /* 690 */ SyscallDesc("unused#690", unimplementedFunc), + /* 691 */ SyscallDesc("unused#691", unimplementedFunc), + /* 692 */ SyscallDesc("unused#692", unimplementedFunc), + /* 693 */ SyscallDesc("unused#693", unimplementedFunc), + /* 694 */ SyscallDesc("unused#694", unimplementedFunc), + /* 695 */ SyscallDesc("unused#695", unimplementedFunc), + /* 696 */ SyscallDesc("unused#696", unimplementedFunc), + /* 697 */ SyscallDesc("unused#697", unimplementedFunc), + /* 698 */ SyscallDesc("unused#698", unimplementedFunc), + /* 699 */ SyscallDesc("unused#699", unimplementedFunc), + /* 700 */ SyscallDesc("unused#700", unimplementedFunc), + /* 701 */ SyscallDesc("unused#701", unimplementedFunc), + /* 702 */ SyscallDesc("unused#702", unimplementedFunc), + /* 703 */ SyscallDesc("unused#703", unimplementedFunc), + /* 704 */ SyscallDesc("unused#704", unimplementedFunc), + /* 705 */ SyscallDesc("unused#705", unimplementedFunc), + /* 706 */ SyscallDesc("unused#706", unimplementedFunc), + /* 707 */ SyscallDesc("unused#707", unimplementedFunc), + /* 708 */ SyscallDesc("unused#708", unimplementedFunc), + /* 709 */ SyscallDesc("unused#709", unimplementedFunc), + /* 710 */ SyscallDesc("unused#710", unimplementedFunc), + /* 711 */ SyscallDesc("unused#711", unimplementedFunc), + /* 712 */ SyscallDesc("unused#712", unimplementedFunc), + /* 713 */ SyscallDesc("unused#713", unimplementedFunc), + /* 714 */ SyscallDesc("unused#714", unimplementedFunc), + /* 715 */ SyscallDesc("unused#715", unimplementedFunc), + /* 716 */ SyscallDesc("unused#716", unimplementedFunc), + /* 717 */ SyscallDesc("unused#717", unimplementedFunc), + /* 718 */ SyscallDesc("unused#718", unimplementedFunc), + /* 719 */ SyscallDesc("unused#719", unimplementedFunc), + /* 720 */ SyscallDesc("unused#720", unimplementedFunc), + /* 721 */ SyscallDesc("unused#721", unimplementedFunc), + /* 722 */ SyscallDesc("unused#722", unimplementedFunc), + /* 723 */ SyscallDesc("unused#723", unimplementedFunc), + /* 724 */ SyscallDesc("unused#724", unimplementedFunc), + /* 725 */ SyscallDesc("unused#725", unimplementedFunc), + /* 726 */ SyscallDesc("unused#726", unimplementedFunc), + /* 727 */ SyscallDesc("unused#727", unimplementedFunc), + /* 728 */ SyscallDesc("unused#728", unimplementedFunc), + /* 729 */ SyscallDesc("unused#729", unimplementedFunc), + /* 730 */ SyscallDesc("unused#730", unimplementedFunc), + /* 731 */ SyscallDesc("unused#731", unimplementedFunc), + /* 732 */ SyscallDesc("unused#732", unimplementedFunc), + /* 733 */ SyscallDesc("unused#733", unimplementedFunc), + /* 734 */ SyscallDesc("unused#734", unimplementedFunc), + /* 735 */ SyscallDesc("unused#735", unimplementedFunc), + /* 736 */ SyscallDesc("unused#736", unimplementedFunc), + /* 737 */ SyscallDesc("unused#737", unimplementedFunc), + /* 738 */ SyscallDesc("unused#738", unimplementedFunc), + /* 739 */ SyscallDesc("unused#739", unimplementedFunc), + /* 740 */ SyscallDesc("unused#740", unimplementedFunc), + /* 741 */ SyscallDesc("unused#741", unimplementedFunc), + /* 742 */ SyscallDesc("unused#742", unimplementedFunc), + /* 743 */ SyscallDesc("unused#743", unimplementedFunc), + /* 744 */ SyscallDesc("unused#744", unimplementedFunc), + /* 745 */ SyscallDesc("unused#745", unimplementedFunc), + /* 746 */ SyscallDesc("unused#746", unimplementedFunc), + /* 747 */ SyscallDesc("unused#747", unimplementedFunc), + /* 748 */ SyscallDesc("unused#748", unimplementedFunc), + /* 749 */ SyscallDesc("unused#749", unimplementedFunc), + /* 750 */ SyscallDesc("unused#750", unimplementedFunc), + /* 751 */ SyscallDesc("unused#751", unimplementedFunc), + /* 752 */ SyscallDesc("unused#752", unimplementedFunc), + /* 753 */ SyscallDesc("unused#753", unimplementedFunc), + /* 754 */ SyscallDesc("unused#754", unimplementedFunc), + /* 755 */ SyscallDesc("unused#755", unimplementedFunc), + /* 756 */ SyscallDesc("unused#756", unimplementedFunc), + /* 757 */ SyscallDesc("unused#757", unimplementedFunc), + /* 758 */ SyscallDesc("unused#758", unimplementedFunc), + /* 759 */ SyscallDesc("unused#759", unimplementedFunc), + /* 760 */ SyscallDesc("unused#760", unimplementedFunc), + /* 761 */ SyscallDesc("unused#761", unimplementedFunc), + /* 762 */ SyscallDesc("unused#762", unimplementedFunc), + /* 763 */ SyscallDesc("unused#763", unimplementedFunc), + /* 764 */ SyscallDesc("unused#764", unimplementedFunc), + /* 765 */ SyscallDesc("unused#765", unimplementedFunc), + /* 766 */ SyscallDesc("unused#766", unimplementedFunc), + /* 767 */ SyscallDesc("unused#767", unimplementedFunc), + /* 768 */ SyscallDesc("unused#768", unimplementedFunc), + /* 769 */ SyscallDesc("unused#769", unimplementedFunc), + /* 770 */ SyscallDesc("unused#770", unimplementedFunc), + /* 771 */ SyscallDesc("unused#771", unimplementedFunc), + /* 772 */ SyscallDesc("unused#772", unimplementedFunc), + /* 773 */ SyscallDesc("unused#773", unimplementedFunc), + /* 774 */ SyscallDesc("unused#774", unimplementedFunc), + /* 775 */ SyscallDesc("unused#775", unimplementedFunc), + /* 776 */ SyscallDesc("unused#776", unimplementedFunc), + /* 777 */ SyscallDesc("unused#777", unimplementedFunc), + /* 778 */ SyscallDesc("unused#778", unimplementedFunc), + /* 779 */ SyscallDesc("unused#779", unimplementedFunc), + /* 780 */ SyscallDesc("unused#780", unimplementedFunc), + /* 781 */ SyscallDesc("unused#781", unimplementedFunc), + /* 782 */ SyscallDesc("unused#782", unimplementedFunc), + /* 783 */ SyscallDesc("unused#783", unimplementedFunc), + /* 784 */ SyscallDesc("unused#784", unimplementedFunc), + /* 785 */ SyscallDesc("unused#785", unimplementedFunc), + /* 786 */ SyscallDesc("unused#786", unimplementedFunc), + /* 787 */ SyscallDesc("unused#787", unimplementedFunc), + /* 788 */ SyscallDesc("unused#788", unimplementedFunc), + /* 789 */ SyscallDesc("unused#789", unimplementedFunc), + /* 790 */ SyscallDesc("unused#790", unimplementedFunc), + /* 791 */ SyscallDesc("unused#791", unimplementedFunc), + /* 792 */ SyscallDesc("unused#792", unimplementedFunc), + /* 793 */ SyscallDesc("unused#793", unimplementedFunc), + /* 794 */ SyscallDesc("unused#794", unimplementedFunc), + /* 795 */ SyscallDesc("unused#795", unimplementedFunc), + /* 796 */ SyscallDesc("unused#796", unimplementedFunc), + /* 797 */ SyscallDesc("unused#797", unimplementedFunc), + /* 798 */ SyscallDesc("unused#798", unimplementedFunc), + /* 799 */ SyscallDesc("unused#799", unimplementedFunc), + /* 800 */ SyscallDesc("unused#800", unimplementedFunc), + /* 801 */ SyscallDesc("unused#801", unimplementedFunc), + /* 802 */ SyscallDesc("unused#802", unimplementedFunc), + /* 803 */ SyscallDesc("unused#803", unimplementedFunc), + /* 804 */ SyscallDesc("unused#804", unimplementedFunc), + /* 805 */ SyscallDesc("unused#805", unimplementedFunc), + /* 806 */ SyscallDesc("unused#806", unimplementedFunc), + /* 807 */ SyscallDesc("unused#807", unimplementedFunc), + /* 808 */ SyscallDesc("unused#808", unimplementedFunc), + /* 809 */ SyscallDesc("unused#809", unimplementedFunc), + /* 810 */ SyscallDesc("unused#810", unimplementedFunc), + /* 811 */ SyscallDesc("unused#811", unimplementedFunc), + /* 812 */ SyscallDesc("unused#812", unimplementedFunc), + /* 813 */ SyscallDesc("unused#813", unimplementedFunc), + /* 814 */ SyscallDesc("unused#814", unimplementedFunc), + /* 815 */ SyscallDesc("unused#815", unimplementedFunc), + /* 816 */ SyscallDesc("unused#816", unimplementedFunc), + /* 817 */ SyscallDesc("unused#817", unimplementedFunc), + /* 818 */ SyscallDesc("unused#818", unimplementedFunc), + /* 819 */ SyscallDesc("unused#819", unimplementedFunc), + /* 820 */ SyscallDesc("unused#820", unimplementedFunc), + /* 821 */ SyscallDesc("unused#821", unimplementedFunc), + /* 822 */ SyscallDesc("unused#822", unimplementedFunc), + /* 823 */ SyscallDesc("unused#823", unimplementedFunc), + /* 824 */ SyscallDesc("unused#824", unimplementedFunc), + /* 825 */ SyscallDesc("unused#825", unimplementedFunc), + /* 826 */ SyscallDesc("unused#826", unimplementedFunc), + /* 827 */ SyscallDesc("unused#827", unimplementedFunc), + /* 828 */ SyscallDesc("unused#828", unimplementedFunc), + /* 829 */ SyscallDesc("unused#829", unimplementedFunc), + /* 830 */ SyscallDesc("unused#830", unimplementedFunc), + /* 831 */ SyscallDesc("unused#831", unimplementedFunc), + /* 832 */ SyscallDesc("unused#832", unimplementedFunc), + /* 833 */ SyscallDesc("unused#833", unimplementedFunc), + /* 834 */ SyscallDesc("unused#834", unimplementedFunc), + /* 835 */ SyscallDesc("unused#835", unimplementedFunc), + /* 836 */ SyscallDesc("unused#836", unimplementedFunc), + /* 837 */ SyscallDesc("unused#837", unimplementedFunc), + /* 838 */ SyscallDesc("unused#838", unimplementedFunc), + /* 839 */ SyscallDesc("unused#839", unimplementedFunc), + /* 840 */ SyscallDesc("unused#840", unimplementedFunc), + /* 841 */ SyscallDesc("unused#841", unimplementedFunc), + /* 842 */ SyscallDesc("unused#842", unimplementedFunc), + /* 843 */ SyscallDesc("unused#843", unimplementedFunc), + /* 844 */ SyscallDesc("unused#844", unimplementedFunc), + /* 845 */ SyscallDesc("unused#845", unimplementedFunc), + /* 846 */ SyscallDesc("unused#846", unimplementedFunc), + /* 847 */ SyscallDesc("unused#847", unimplementedFunc), + /* 848 */ SyscallDesc("unused#848", unimplementedFunc), + /* 849 */ SyscallDesc("unused#849", unimplementedFunc), + /* 850 */ SyscallDesc("unused#850", unimplementedFunc), + /* 851 */ SyscallDesc("unused#851", unimplementedFunc), + /* 852 */ SyscallDesc("unused#852", unimplementedFunc), + /* 853 */ SyscallDesc("unused#853", unimplementedFunc), + /* 854 */ SyscallDesc("unused#854", unimplementedFunc), + /* 855 */ SyscallDesc("unused#855", unimplementedFunc), + /* 856 */ SyscallDesc("unused#856", unimplementedFunc), + /* 857 */ SyscallDesc("unused#857", unimplementedFunc), + /* 858 */ SyscallDesc("unused#858", unimplementedFunc), + /* 859 */ SyscallDesc("unused#859", unimplementedFunc), + /* 860 */ SyscallDesc("unused#860", unimplementedFunc), + /* 861 */ SyscallDesc("unused#861", unimplementedFunc), + /* 862 */ SyscallDesc("unused#862", unimplementedFunc), + /* 863 */ SyscallDesc("unused#863", unimplementedFunc), + /* 864 */ SyscallDesc("unused#864", unimplementedFunc), + /* 865 */ SyscallDesc("unused#865", unimplementedFunc), + /* 866 */ SyscallDesc("unused#866", unimplementedFunc), + /* 867 */ SyscallDesc("unused#867", unimplementedFunc), + /* 868 */ SyscallDesc("unused#868", unimplementedFunc), + /* 869 */ SyscallDesc("unused#869", unimplementedFunc), + /* 870 */ SyscallDesc("unused#870", unimplementedFunc), + /* 871 */ SyscallDesc("unused#871", unimplementedFunc), + /* 872 */ SyscallDesc("unused#872", unimplementedFunc), + /* 873 */ SyscallDesc("unused#873", unimplementedFunc), + /* 874 */ SyscallDesc("unused#874", unimplementedFunc), + /* 875 */ SyscallDesc("unused#875", unimplementedFunc), + /* 876 */ SyscallDesc("unused#876", unimplementedFunc), + /* 877 */ SyscallDesc("unused#877", unimplementedFunc), + /* 878 */ SyscallDesc("unused#878", unimplementedFunc), + /* 879 */ SyscallDesc("unused#879", unimplementedFunc), + /* 880 */ SyscallDesc("unused#880", unimplementedFunc), + /* 881 */ SyscallDesc("unused#881", unimplementedFunc), + /* 882 */ SyscallDesc("unused#882", unimplementedFunc), + /* 883 */ SyscallDesc("unused#883", unimplementedFunc), + /* 884 */ SyscallDesc("unused#884", unimplementedFunc), + /* 885 */ SyscallDesc("unused#885", unimplementedFunc), + /* 886 */ SyscallDesc("unused#886", unimplementedFunc), + /* 887 */ SyscallDesc("unused#887", unimplementedFunc), + /* 888 */ SyscallDesc("unused#888", unimplementedFunc), + /* 889 */ SyscallDesc("unused#889", unimplementedFunc), + /* 890 */ SyscallDesc("unused#890", unimplementedFunc), + /* 891 */ SyscallDesc("unused#891", unimplementedFunc), + /* 892 */ SyscallDesc("unused#892", unimplementedFunc), + /* 893 */ SyscallDesc("unused#893", unimplementedFunc), + /* 894 */ SyscallDesc("unused#894", unimplementedFunc), + /* 895 */ SyscallDesc("unused#895", unimplementedFunc), + /* 896 */ SyscallDesc("unused#896", unimplementedFunc), + /* 897 */ SyscallDesc("unused#897", unimplementedFunc), + /* 898 */ SyscallDesc("unused#898", unimplementedFunc), + /* 899 */ SyscallDesc("unused#899", unimplementedFunc), + /* 900 */ SyscallDesc("unused#900", unimplementedFunc), + /* 901 */ SyscallDesc("unused#901", unimplementedFunc), + /* 902 */ SyscallDesc("unused#902", unimplementedFunc), + /* 903 */ SyscallDesc("unused#903", unimplementedFunc), + /* 904 */ SyscallDesc("unused#904", unimplementedFunc), + /* 905 */ SyscallDesc("unused#905", unimplementedFunc), + /* 906 */ SyscallDesc("unused#906", unimplementedFunc), + /* 907 */ SyscallDesc("unused#907", unimplementedFunc), + /* 908 */ SyscallDesc("unused#908", unimplementedFunc), + /* 909 */ SyscallDesc("unused#909", unimplementedFunc), + /* 910 */ SyscallDesc("unused#910", unimplementedFunc), + /* 911 */ SyscallDesc("unused#911", unimplementedFunc), + /* 912 */ SyscallDesc("unused#912", unimplementedFunc), + /* 913 */ SyscallDesc("unused#913", unimplementedFunc), + /* 914 */ SyscallDesc("unused#914", unimplementedFunc), + /* 915 */ SyscallDesc("unused#915", unimplementedFunc), + /* 916 */ SyscallDesc("unused#916", unimplementedFunc), + /* 917 */ SyscallDesc("unused#917", unimplementedFunc), + /* 918 */ SyscallDesc("unused#918", unimplementedFunc), + /* 919 */ SyscallDesc("unused#919", unimplementedFunc), + /* 920 */ SyscallDesc("unused#920", unimplementedFunc), + /* 921 */ SyscallDesc("unused#921", unimplementedFunc), + /* 922 */ SyscallDesc("unused#922", unimplementedFunc), + /* 923 */ SyscallDesc("unused#923", unimplementedFunc), + /* 924 */ SyscallDesc("unused#924", unimplementedFunc), + /* 925 */ SyscallDesc("unused#925", unimplementedFunc), + /* 926 */ SyscallDesc("unused#926", unimplementedFunc), + /* 927 */ SyscallDesc("unused#927", unimplementedFunc), + /* 928 */ SyscallDesc("unused#928", unimplementedFunc), + /* 929 */ SyscallDesc("unused#929", unimplementedFunc), + /* 930 */ SyscallDesc("unused#930", unimplementedFunc), + /* 931 */ SyscallDesc("unused#931", unimplementedFunc), + /* 932 */ SyscallDesc("unused#932", unimplementedFunc), + /* 933 */ SyscallDesc("unused#933", unimplementedFunc), + /* 934 */ SyscallDesc("unused#934", unimplementedFunc), + /* 935 */ SyscallDesc("unused#935", unimplementedFunc), + /* 936 */ SyscallDesc("unused#936", unimplementedFunc), + /* 937 */ SyscallDesc("unused#937", unimplementedFunc), + /* 938 */ SyscallDesc("unused#938", unimplementedFunc), + /* 939 */ SyscallDesc("unused#939", unimplementedFunc), + /* 940 */ SyscallDesc("unused#940", unimplementedFunc), + /* 941 */ SyscallDesc("unused#941", unimplementedFunc), + /* 942 */ SyscallDesc("unused#942", unimplementedFunc), + /* 943 */ SyscallDesc("unused#943", unimplementedFunc), + /* 944 */ SyscallDesc("unused#944", unimplementedFunc), + /* 945 */ SyscallDesc("unused#945", unimplementedFunc), + /* 946 */ SyscallDesc("unused#946", unimplementedFunc), + /* 947 */ SyscallDesc("unused#947", unimplementedFunc), + /* 948 */ SyscallDesc("unused#948", unimplementedFunc), + /* 949 */ SyscallDesc("unused#949", unimplementedFunc), + /* 950 */ SyscallDesc("unused#950", unimplementedFunc), + /* 951 */ SyscallDesc("unused#951", unimplementedFunc), + /* 952 */ SyscallDesc("unused#952", unimplementedFunc), + /* 953 */ SyscallDesc("unused#953", unimplementedFunc), + /* 954 */ SyscallDesc("unused#954", unimplementedFunc), + /* 955 */ SyscallDesc("unused#955", unimplementedFunc), + /* 956 */ SyscallDesc("unused#956", unimplementedFunc), + /* 957 */ SyscallDesc("unused#957", unimplementedFunc), + /* 958 */ SyscallDesc("unused#958", unimplementedFunc), + /* 959 */ SyscallDesc("unused#959", unimplementedFunc), + /* 960 */ SyscallDesc("unused#960", unimplementedFunc), + /* 961 */ SyscallDesc("unused#961", unimplementedFunc), + /* 962 */ SyscallDesc("unused#962", unimplementedFunc), + /* 963 */ SyscallDesc("unused#963", unimplementedFunc), + /* 964 */ SyscallDesc("unused#964", unimplementedFunc), + /* 965 */ SyscallDesc("unused#965", unimplementedFunc), + /* 966 */ SyscallDesc("unused#966", unimplementedFunc), + /* 967 */ SyscallDesc("unused#967", unimplementedFunc), + /* 968 */ SyscallDesc("unused#968", unimplementedFunc), + /* 969 */ SyscallDesc("unused#969", unimplementedFunc), + /* 970 */ SyscallDesc("unused#970", unimplementedFunc), + /* 971 */ SyscallDesc("unused#971", unimplementedFunc), + /* 972 */ SyscallDesc("unused#972", unimplementedFunc), + /* 973 */ SyscallDesc("unused#973", unimplementedFunc), + /* 974 */ SyscallDesc("unused#974", unimplementedFunc), + /* 975 */ SyscallDesc("unused#975", unimplementedFunc), + /* 976 */ SyscallDesc("unused#976", unimplementedFunc), + /* 977 */ SyscallDesc("unused#977", unimplementedFunc), + /* 978 */ SyscallDesc("unused#978", unimplementedFunc), + /* 979 */ SyscallDesc("unused#979", unimplementedFunc), + /* 980 */ SyscallDesc("unused#980", unimplementedFunc), + /* 981 */ SyscallDesc("unused#981", unimplementedFunc), + /* 982 */ SyscallDesc("unused#982", unimplementedFunc), + /* 983 */ SyscallDesc("unused#983", unimplementedFunc), + /* 984 */ SyscallDesc("unused#984", unimplementedFunc), + /* 985 */ SyscallDesc("unused#985", unimplementedFunc), + /* 986 */ SyscallDesc("unused#986", unimplementedFunc), + /* 987 */ SyscallDesc("unused#987", unimplementedFunc), + /* 988 */ SyscallDesc("unused#988", unimplementedFunc), + /* 989 */ SyscallDesc("unused#989", unimplementedFunc), + /* 990 */ SyscallDesc("unused#990", unimplementedFunc), + /* 991 */ SyscallDesc("unused#991", unimplementedFunc), + /* 992 */ SyscallDesc("unused#992", unimplementedFunc), + /* 993 */ SyscallDesc("unused#993", unimplementedFunc), + /* 994 */ SyscallDesc("unused#994", unimplementedFunc), + /* 995 */ SyscallDesc("unused#995", unimplementedFunc), + /* 996 */ SyscallDesc("unused#996", unimplementedFunc), + /* 997 */ SyscallDesc("unused#997", unimplementedFunc), + /* 998 */ SyscallDesc("unused#998", unimplementedFunc), + /* 999 */ SyscallDesc("unused#999", unimplementedFunc), + /* 1000 */ SyscallDesc("unused#1000", unimplementedFunc), + /* 1001 */ SyscallDesc("unused#1001", unimplementedFunc), + /* 1002 */ SyscallDesc("unused#1002", unimplementedFunc), + /* 1003 */ SyscallDesc("unused#1003", unimplementedFunc), + /* 1004 */ SyscallDesc("unused#1004", unimplementedFunc), + /* 1005 */ SyscallDesc("unused#1005", unimplementedFunc), + /* 1006 */ SyscallDesc("unused#1006", unimplementedFunc), + /* 1007 */ SyscallDesc("unused#1007", unimplementedFunc), + /* 1008 */ SyscallDesc("unused#1008", unimplementedFunc), + /* 1009 */ SyscallDesc("unused#1009", unimplementedFunc), + /* 1010 */ SyscallDesc("unused#1010", unimplementedFunc), + /* 1011 */ SyscallDesc("unused#1011", unimplementedFunc), + /* 1012 */ SyscallDesc("unused#1012", unimplementedFunc), + /* 1013 */ SyscallDesc("unused#1013", unimplementedFunc), + /* 1014 */ SyscallDesc("unused#1014", unimplementedFunc), + /* 1015 */ SyscallDesc("unused#1015", unimplementedFunc), + /* 1016 */ SyscallDesc("unused#1016", unimplementedFunc), + /* 1017 */ SyscallDesc("unused#1017", unimplementedFunc), + /* 1018 */ SyscallDesc("unused#1018", unimplementedFunc), + /* 1019 */ SyscallDesc("unused#1019", unimplementedFunc), + /* 1020 */ SyscallDesc("unused#1020", unimplementedFunc), + /* 1021 */ SyscallDesc("unused#1021", unimplementedFunc), + /* 1022 */ SyscallDesc("unused#1022", unimplementedFunc), + /* 1023 */ SyscallDesc("unused#1023", unimplementedFunc), + /* 1024 */ SyscallDesc("open", openFunc), + /* 1025 */ SyscallDesc("link", unimplementedFunc), + /* 1026 */ SyscallDesc("unlink", unlinkFunc), + /* 1027 */ SyscallDesc("unused#1027", unimplementedFunc), + /* 1028 */ SyscallDesc("unused#1028", unimplementedFunc), + /* 1029 */ SyscallDesc("unused#1029", unimplementedFunc), + /* 1030 */ SyscallDesc("mkdir", mkdirFunc), + /* 1031 */ SyscallDesc("unused#1031", unimplementedFunc), + /* 1032 */ SyscallDesc("unused#1032", unimplementedFunc), + /* 1033 */ SyscallDesc("access", unimplementedFunc), + /* 1034 */ SyscallDesc("unused#1034", unimplementedFunc), + /* 1035 */ SyscallDesc("unused#1035", unimplementedFunc), + /* 1036 */ SyscallDesc("unused#1036", unimplementedFunc), + /* 1037 */ SyscallDesc("unused#1037", unimplementedFunc), + /* 1038 */ SyscallDesc("stat", statFunc), + /* 1039 */ SyscallDesc("lstat", unimplementedFunc), + /* 1040 */ SyscallDesc("unused#1040", unimplementedFunc), + /* 1041 */ SyscallDesc("unused#1041", unimplementedFunc), + /* 1042 */ SyscallDesc("unused#1042", unimplementedFunc), + /* 1043 */ SyscallDesc("unused#1043", unimplementedFunc), + /* 1044 */ SyscallDesc("unused#1044", unimplementedFunc), + /* 1045 */ SyscallDesc("unused#1045", unimplementedFunc), + /* 1046 */ SyscallDesc("unused#1046", unimplementedFunc), + /* 1047 */ SyscallDesc("unused#1047", unimplementedFunc), + /* 1048 */ SyscallDesc("unused#1048", unimplementedFunc), + /* 1049 */ SyscallDesc("unused#1049", unimplementedFunc), + /* 1050 */ SyscallDesc("unused#1050", unimplementedFunc), + /* 1051 */ SyscallDesc("unused#1051", unimplementedFunc), + /* 1052 */ SyscallDesc("unused#1052", unimplementedFunc), + /* 1053 */ SyscallDesc("unused#1053", unimplementedFunc), + /* 1054 */ SyscallDesc("unused#1054", unimplementedFunc), + /* 1055 */ SyscallDesc("unused#1055", unimplementedFunc), + /* 1056 */ SyscallDesc("unused#1056", unimplementedFunc), + /* 1057 */ SyscallDesc("unused#1057", unimplementedFunc), + /* 1058 */ SyscallDesc("unused#1058", unimplementedFunc), + /* 1059 */ SyscallDesc("unused#1059", unimplementedFunc), + /* 1060 */ SyscallDesc("unused#1060", unimplementedFunc), + /* 1061 */ SyscallDesc("unused#1061", unimplementedFunc), + /* 1062 */ SyscallDesc("time", unimplementedFunc), + /* 1063 */ SyscallDesc("unused#1063", unimplementedFunc), + /* 1064 */ SyscallDesc("unused#1064", unimplementedFunc), + /* 1065 */ SyscallDesc("unused#1065", unimplementedFunc), + /* 1066 */ SyscallDesc("unused#1066", unimplementedFunc), + /* 1067 */ SyscallDesc("unused#1067", unimplementedFunc), + /* 1068 */ SyscallDesc("unused#1068", unimplementedFunc), + /* 1069 */ SyscallDesc("unused#1069", unimplementedFunc), + /* 1070 */ SyscallDesc("unused#1070", unimplementedFunc), + /* 1071 */ SyscallDesc("unused#1071", unimplementedFunc), + /* 1072 */ SyscallDesc("unused#1072", unimplementedFunc), + /* 1073 */ SyscallDesc("unused#1073", unimplementedFunc), + /* 1074 */ SyscallDesc("unused#1074", unimplementedFunc), + /* 1075 */ SyscallDesc("unused#1075", unimplementedFunc), + /* 1076 */ SyscallDesc("unused#1076", unimplementedFunc), + /* 1077 */ SyscallDesc("unused#1077", unimplementedFunc), + /* 1078 */ SyscallDesc("unused#1078", unimplementedFunc), + /* 1079 */ SyscallDesc("unused#1079", unimplementedFunc), + /* 1080 */ SyscallDesc("unused#1080", unimplementedFunc), + /* 1081 */ SyscallDesc("unused#1081", unimplementedFunc), + /* 1082 */ SyscallDesc("unused#1082", unimplementedFunc), + /* 1083 */ SyscallDesc("unused#1083", unimplementedFunc), + /* 1084 */ SyscallDesc("unused#1084", unimplementedFunc), + /* 1085 */ SyscallDesc("unused#1085", unimplementedFunc), + /* 1086 */ SyscallDesc("unused#1086", unimplementedFunc), + /* 1087 */ SyscallDesc("unused#1087", unimplementedFunc), + /* 1088 */ SyscallDesc("unused#1088", unimplementedFunc), + /* 1089 */ SyscallDesc("unused#1089", unimplementedFunc), + /* 1090 */ SyscallDesc("unused#1090", unimplementedFunc), + /* 1091 */ SyscallDesc("unused#1091", unimplementedFunc), + /* 1092 */ SyscallDesc("unused#1092", unimplementedFunc), + /* 1093 */ SyscallDesc("unused#1093", unimplementedFunc), + /* 1094 */ SyscallDesc("unused#1094", unimplementedFunc), + /* 1095 */ SyscallDesc("unused#1095", unimplementedFunc), + /* 1096 */ SyscallDesc("unused#1096", unimplementedFunc), + /* 1097 */ SyscallDesc("unused#1097", unimplementedFunc), + /* 1098 */ SyscallDesc("unused#1098", unimplementedFunc), + /* 1099 */ SyscallDesc("unused#1099", unimplementedFunc), + /* 1100 */ SyscallDesc("unused#1100", unimplementedFunc), + /* 1101 */ SyscallDesc("unused#1101", unimplementedFunc), + /* 1102 */ SyscallDesc("unused#1102", unimplementedFunc), + /* 1103 */ SyscallDesc("unused#1103", unimplementedFunc), + /* 1104 */ SyscallDesc("unused#1104", unimplementedFunc), + /* 1105 */ SyscallDesc("unused#1105", unimplementedFunc), + /* 1106 */ SyscallDesc("unused#1106", unimplementedFunc), + /* 1107 */ SyscallDesc("unused#1107", unimplementedFunc), + /* 1108 */ SyscallDesc("unused#1108", unimplementedFunc), + /* 1109 */ SyscallDesc("unused#1109", unimplementedFunc), + /* 1110 */ SyscallDesc("unused#1110", unimplementedFunc), + /* 1111 */ SyscallDesc("unused#1111", unimplementedFunc), + /* 1112 */ SyscallDesc("unused#1112", unimplementedFunc), + /* 1113 */ SyscallDesc("unused#1113", unimplementedFunc), + /* 1114 */ SyscallDesc("unused#1114", unimplementedFunc), + /* 1115 */ SyscallDesc("unused#1115", unimplementedFunc), + /* 1116 */ SyscallDesc("unused#1116", unimplementedFunc), + /* 1117 */ SyscallDesc("unused#1117", unimplementedFunc), + /* 1118 */ SyscallDesc("unused#1118", unimplementedFunc), + /* 1119 */ SyscallDesc("unused#1119", unimplementedFunc), + /* 1120 */ SyscallDesc("unused#1120", unimplementedFunc), + /* 1121 */ SyscallDesc("unused#1121", unimplementedFunc), + /* 1122 */ SyscallDesc("unused#1122", unimplementedFunc), + /* 1123 */ SyscallDesc("unused#1123", unimplementedFunc), + /* 1124 */ SyscallDesc("unused#1124", unimplementedFunc), + /* 1125 */ SyscallDesc("unused#1125", unimplementedFunc), + /* 1126 */ SyscallDesc("unused#1126", unimplementedFunc), + /* 1127 */ SyscallDesc("unused#1127", unimplementedFunc), + /* 1128 */ SyscallDesc("unused#1128", unimplementedFunc), + /* 1129 */ SyscallDesc("unused#1129", unimplementedFunc), + /* 1130 */ SyscallDesc("unused#1130", unimplementedFunc), + /* 1131 */ SyscallDesc("unused#1131", unimplementedFunc), + /* 1132 */ SyscallDesc("unused#1132", unimplementedFunc), + /* 1133 */ SyscallDesc("unused#1133", unimplementedFunc), + /* 1134 */ SyscallDesc("unused#1134", unimplementedFunc), + /* 1135 */ SyscallDesc("unused#1135", unimplementedFunc), + /* 1136 */ SyscallDesc("unused#1136", unimplementedFunc), + /* 1137 */ SyscallDesc("unused#1137", unimplementedFunc), + /* 1138 */ SyscallDesc("unused#1138", unimplementedFunc), + /* 1139 */ SyscallDesc("unused#1139", unimplementedFunc), + /* 1140 */ SyscallDesc("unused#1140", unimplementedFunc), + /* 1141 */ SyscallDesc("unused#1141", unimplementedFunc), + /* 1142 */ SyscallDesc("unused#1142", unimplementedFunc), + /* 1143 */ SyscallDesc("unused#1143", unimplementedFunc), + /* 1144 */ SyscallDesc("unused#1144", unimplementedFunc), + /* 1145 */ SyscallDesc("unused#1145", unimplementedFunc), + /* 1146 */ SyscallDesc("unused#1146", unimplementedFunc), + /* 1147 */ SyscallDesc("unused#1147", unimplementedFunc), + /* 1148 */ SyscallDesc("unused#1148", unimplementedFunc), + /* 1149 */ SyscallDesc("unused#1149", unimplementedFunc), + /* 1150 */ SyscallDesc("unused#1150", unimplementedFunc), + /* 1151 */ SyscallDesc("unused#1151", unimplementedFunc), + /* 1152 */ SyscallDesc("unused#1152", unimplementedFunc), + /* 1153 */ SyscallDesc("unused#1153", unimplementedFunc), + /* 1154 */ SyscallDesc("unused#1154", unimplementedFunc), + /* 1155 */ SyscallDesc("unused#1155", unimplementedFunc), + /* 1156 */ SyscallDesc("unused#1156", unimplementedFunc), + /* 1157 */ SyscallDesc("unused#1157", unimplementedFunc), + /* 1158 */ SyscallDesc("unused#1158", unimplementedFunc), + /* 1159 */ SyscallDesc("unused#1159", unimplementedFunc), + /* 1160 */ SyscallDesc("unused#1160", unimplementedFunc), + /* 1161 */ SyscallDesc("unused#1161", unimplementedFunc), + /* 1162 */ SyscallDesc("unused#1162", unimplementedFunc), + /* 1163 */ SyscallDesc("unused#1163", unimplementedFunc), + /* 1164 */ SyscallDesc("unused#1164", unimplementedFunc), + /* 1165 */ SyscallDesc("unused#1165", unimplementedFunc), + /* 1166 */ SyscallDesc("unused#1166", unimplementedFunc), + /* 1167 */ SyscallDesc("unused#1167", unimplementedFunc), + /* 1168 */ SyscallDesc("unused#1168", unimplementedFunc), + /* 1169 */ SyscallDesc("unused#1169", unimplementedFunc), + /* 1170 */ SyscallDesc("unused#1170", unimplementedFunc), + /* 1171 */ SyscallDesc("unused#1171", unimplementedFunc), + /* 1172 */ SyscallDesc("unused#1172", unimplementedFunc), + /* 1173 */ SyscallDesc("unused#1173", unimplementedFunc), + /* 1174 */ SyscallDesc("unused#1174", unimplementedFunc), + /* 1175 */ SyscallDesc("unused#1175", unimplementedFunc), + /* 1176 */ SyscallDesc("unused#1176", unimplementedFunc), + /* 1177 */ SyscallDesc("unused#1177", unimplementedFunc), + /* 1178 */ SyscallDesc("unused#1178", unimplementedFunc), + /* 1179 */ SyscallDesc("unused#1179", unimplementedFunc), + /* 1180 */ SyscallDesc("unused#1180", unimplementedFunc), + /* 1181 */ SyscallDesc("unused#1181", unimplementedFunc), + /* 1182 */ SyscallDesc("unused#1182", unimplementedFunc), + /* 1183 */ SyscallDesc("unused#1183", unimplementedFunc), + /* 1184 */ SyscallDesc("unused#1184", unimplementedFunc), + /* 1185 */ SyscallDesc("unused#1185", unimplementedFunc), + /* 1186 */ SyscallDesc("unused#1186", unimplementedFunc), + /* 1187 */ SyscallDesc("unused#1187", unimplementedFunc), + /* 1188 */ SyscallDesc("unused#1188", unimplementedFunc), + /* 1189 */ SyscallDesc("unused#1189", unimplementedFunc), + /* 1190 */ SyscallDesc("unused#1190", unimplementedFunc), + /* 1191 */ SyscallDesc("unused#1191", unimplementedFunc), + /* 1192 */ SyscallDesc("unused#1192", unimplementedFunc), + /* 1193 */ SyscallDesc("unused#1193", unimplementedFunc), + /* 1194 */ SyscallDesc("unused#1194", unimplementedFunc), + /* 1195 */ SyscallDesc("unused#1195", unimplementedFunc), + /* 1196 */ SyscallDesc("unused#1196", unimplementedFunc), + /* 1197 */ SyscallDesc("unused#1197", unimplementedFunc), + /* 1198 */ SyscallDesc("unused#1198", unimplementedFunc), + /* 1199 */ SyscallDesc("unused#1199", unimplementedFunc), + /* 1200 */ SyscallDesc("unused#1200", unimplementedFunc), + /* 1201 */ SyscallDesc("unused#1201", unimplementedFunc), + /* 1202 */ SyscallDesc("unused#1202", unimplementedFunc), + /* 1203 */ SyscallDesc("unused#1203", unimplementedFunc), + /* 1204 */ SyscallDesc("unused#1204", unimplementedFunc), + /* 1205 */ SyscallDesc("unused#1205", unimplementedFunc), + /* 1206 */ SyscallDesc("unused#1206", unimplementedFunc), + /* 1207 */ SyscallDesc("unused#1207", unimplementedFunc), + /* 1208 */ SyscallDesc("unused#1208", unimplementedFunc), + /* 1209 */ SyscallDesc("unused#1209", unimplementedFunc), + /* 1210 */ SyscallDesc("unused#1210", unimplementedFunc), + /* 1211 */ SyscallDesc("unused#1211", unimplementedFunc), + /* 1212 */ SyscallDesc("unused#1212", unimplementedFunc), + /* 1213 */ SyscallDesc("unused#1213", unimplementedFunc), + /* 1214 */ SyscallDesc("unused#1214", unimplementedFunc), + /* 1215 */ SyscallDesc("unused#1215", unimplementedFunc), + /* 1216 */ SyscallDesc("unused#1216", unimplementedFunc), + /* 1217 */ SyscallDesc("unused#1217", unimplementedFunc), + /* 1218 */ SyscallDesc("unused#1218", unimplementedFunc), + /* 1219 */ SyscallDesc("unused#1219", unimplementedFunc), + /* 1220 */ SyscallDesc("unused#1220", unimplementedFunc), + /* 1221 */ SyscallDesc("unused#1221", unimplementedFunc), + /* 1222 */ SyscallDesc("unused#1222", unimplementedFunc), + /* 1223 */ SyscallDesc("unused#1223", unimplementedFunc), + /* 1224 */ SyscallDesc("unused#1224", unimplementedFunc), + /* 1225 */ SyscallDesc("unused#1225", unimplementedFunc), + /* 1226 */ SyscallDesc("unused#1226", unimplementedFunc), + /* 1227 */ SyscallDesc("unused#1227", unimplementedFunc), + /* 1228 */ SyscallDesc("unused#1228", unimplementedFunc), + /* 1229 */ SyscallDesc("unused#1229", unimplementedFunc), + /* 1230 */ SyscallDesc("unused#1230", unimplementedFunc), + /* 1231 */ SyscallDesc("unused#1231", unimplementedFunc), + /* 1232 */ SyscallDesc("unused#1232", unimplementedFunc), + /* 1233 */ SyscallDesc("unused#1233", unimplementedFunc), + /* 1234 */ SyscallDesc("unused#1234", unimplementedFunc), + /* 1235 */ SyscallDesc("unused#1235", unimplementedFunc), + /* 1236 */ SyscallDesc("unused#1236", unimplementedFunc), + /* 1237 */ SyscallDesc("unused#1237", unimplementedFunc), + /* 1238 */ SyscallDesc("unused#1238", unimplementedFunc), + /* 1239 */ SyscallDesc("unused#1239", unimplementedFunc), + /* 1240 */ SyscallDesc("unused#1240", unimplementedFunc), + /* 1241 */ SyscallDesc("unused#1241", unimplementedFunc), + /* 1242 */ SyscallDesc("unused#1242", unimplementedFunc), + /* 1243 */ SyscallDesc("unused#1243", unimplementedFunc), + /* 1244 */ SyscallDesc("unused#1244", unimplementedFunc), + /* 1245 */ SyscallDesc("unused#1245", unimplementedFunc), + /* 1246 */ SyscallDesc("unused#1246", unimplementedFunc), + /* 1247 */ SyscallDesc("unused#1247", unimplementedFunc), + /* 1248 */ SyscallDesc("unused#1248", unimplementedFunc), + /* 1249 */ SyscallDesc("unused#1249", unimplementedFunc), + /* 1250 */ SyscallDesc("unused#1250", unimplementedFunc), + /* 1251 */ SyscallDesc("unused#1251", unimplementedFunc), + /* 1252 */ SyscallDesc("unused#1252", unimplementedFunc), + /* 1253 */ SyscallDesc("unused#1253", unimplementedFunc), + /* 1254 */ SyscallDesc("unused#1254", unimplementedFunc), + /* 1255 */ SyscallDesc("unused#1255", unimplementedFunc), + /* 1256 */ SyscallDesc("unused#1256", unimplementedFunc), + /* 1257 */ SyscallDesc("unused#1257", unimplementedFunc), + /* 1258 */ SyscallDesc("unused#1258", unimplementedFunc), + /* 1259 */ SyscallDesc("unused#1259", unimplementedFunc), + /* 1260 */ SyscallDesc("unused#1260", unimplementedFunc), + /* 1261 */ SyscallDesc("unused#1261", unimplementedFunc), + /* 1262 */ SyscallDesc("unused#1262", unimplementedFunc), + /* 1263 */ SyscallDesc("unused#1263", unimplementedFunc), + /* 1264 */ SyscallDesc("unused#1264", unimplementedFunc), + /* 1265 */ SyscallDesc("unused#1265", unimplementedFunc), + /* 1266 */ SyscallDesc("unused#1266", unimplementedFunc), + /* 1267 */ SyscallDesc("unused#1267", unimplementedFunc), + /* 1268 */ SyscallDesc("unused#1268", unimplementedFunc), + /* 1269 */ SyscallDesc("unused#1269", unimplementedFunc), + /* 1270 */ SyscallDesc("unused#1270", unimplementedFunc), + /* 1271 */ SyscallDesc("unused#1271", unimplementedFunc), + /* 1272 */ SyscallDesc("unused#1272", unimplementedFunc), + /* 1273 */ SyscallDesc("unused#1273", unimplementedFunc), + /* 1274 */ SyscallDesc("unused#1274", unimplementedFunc), + /* 1275 */ SyscallDesc("unused#1275", unimplementedFunc), + /* 1276 */ SyscallDesc("unused#1276", unimplementedFunc), + /* 1277 */ SyscallDesc("unused#1277", unimplementedFunc), + /* 1278 */ SyscallDesc("unused#1278", unimplementedFunc), + /* 1279 */ SyscallDesc("unused#1279", unimplementedFunc), + /* 1280 */ SyscallDesc("unused#1280", unimplementedFunc), + /* 1281 */ SyscallDesc("unused#1281", unimplementedFunc), + /* 1282 */ SyscallDesc("unused#1282", unimplementedFunc), + /* 1283 */ SyscallDesc("unused#1283", unimplementedFunc), + /* 1284 */ SyscallDesc("unused#1284", unimplementedFunc), + /* 1285 */ SyscallDesc("unused#1285", unimplementedFunc), + /* 1286 */ SyscallDesc("unused#1286", unimplementedFunc), + /* 1287 */ SyscallDesc("unused#1287", unimplementedFunc), + /* 1288 */ SyscallDesc("unused#1288", unimplementedFunc), + /* 1289 */ SyscallDesc("unused#1289", unimplementedFunc), + /* 1290 */ SyscallDesc("unused#1290", unimplementedFunc), + /* 1291 */ SyscallDesc("unused#1291", unimplementedFunc), + /* 1292 */ SyscallDesc("unused#1292", unimplementedFunc), + /* 1293 */ SyscallDesc("unused#1293", unimplementedFunc), + /* 1294 */ SyscallDesc("unused#1294", unimplementedFunc), + /* 1295 */ SyscallDesc("unused#1295", unimplementedFunc), + /* 1296 */ SyscallDesc("unused#1296", unimplementedFunc), + /* 1297 */ SyscallDesc("unused#1297", unimplementedFunc), + /* 1298 */ SyscallDesc("unused#1298", unimplementedFunc), + /* 1299 */ SyscallDesc("unused#1299", unimplementedFunc), + /* 1300 */ SyscallDesc("unused#1300", unimplementedFunc), + /* 1301 */ SyscallDesc("unused#1301", unimplementedFunc), + /* 1302 */ SyscallDesc("unused#1302", unimplementedFunc), + /* 1303 */ SyscallDesc("unused#1303", unimplementedFunc), + /* 1304 */ SyscallDesc("unused#1304", unimplementedFunc), + /* 1305 */ SyscallDesc("unused#1305", unimplementedFunc), + /* 1306 */ SyscallDesc("unused#1306", unimplementedFunc), + /* 1307 */ SyscallDesc("unused#1307", unimplementedFunc), + /* 1308 */ SyscallDesc("unused#1308", unimplementedFunc), + /* 1309 */ SyscallDesc("unused#1309", unimplementedFunc), + /* 1310 */ SyscallDesc("unused#1310", unimplementedFunc), + /* 1311 */ SyscallDesc("unused#1311", unimplementedFunc), + /* 1312 */ SyscallDesc("unused#1312", unimplementedFunc), + /* 1313 */ SyscallDesc("unused#1313", unimplementedFunc), + /* 1314 */ SyscallDesc("unused#1314", unimplementedFunc), + /* 1315 */ SyscallDesc("unused#1315", unimplementedFunc), + /* 1316 */ SyscallDesc("unused#1316", unimplementedFunc), + /* 1317 */ SyscallDesc("unused#1317", unimplementedFunc), + /* 1318 */ SyscallDesc("unused#1318", unimplementedFunc), + /* 1319 */ SyscallDesc("unused#1319", unimplementedFunc), + /* 1320 */ SyscallDesc("unused#1320", unimplementedFunc), + /* 1321 */ SyscallDesc("unused#1321", unimplementedFunc), + /* 1322 */ SyscallDesc("unused#1322", unimplementedFunc), + /* 1323 */ SyscallDesc("unused#1323", unimplementedFunc), + /* 1324 */ SyscallDesc("unused#1324", unimplementedFunc), + /* 1325 */ SyscallDesc("unused#1325", unimplementedFunc), + /* 1326 */ SyscallDesc("unused#1326", unimplementedFunc), + /* 1327 */ SyscallDesc("unused#1327", unimplementedFunc), + /* 1328 */ SyscallDesc("unused#1328", unimplementedFunc), + /* 1329 */ SyscallDesc("unused#1329", unimplementedFunc), + /* 1330 */ SyscallDesc("unused#1330", unimplementedFunc), + /* 1331 */ SyscallDesc("unused#1331", unimplementedFunc), + /* 1332 */ SyscallDesc("unused#1332", unimplementedFunc), + /* 1333 */ SyscallDesc("unused#1333", unimplementedFunc), + /* 1334 */ SyscallDesc("unused#1334", unimplementedFunc), + /* 1335 */ SyscallDesc("unused#1335", unimplementedFunc), + /* 1336 */ SyscallDesc("unused#1336", unimplementedFunc), + /* 1337 */ SyscallDesc("unused#1337", unimplementedFunc), + /* 1338 */ SyscallDesc("unused#1338", unimplementedFunc), + /* 1339 */ SyscallDesc("unused#1339", unimplementedFunc), + /* 1340 */ SyscallDesc("unused#1340", unimplementedFunc), + /* 1341 */ SyscallDesc("unused#1341", unimplementedFunc), + /* 1342 */ SyscallDesc("unused#1342", unimplementedFunc), + /* 1343 */ SyscallDesc("unused#1343", unimplementedFunc), + /* 1344 */ SyscallDesc("unused#1344", unimplementedFunc), + /* 1345 */ SyscallDesc("unused#1345", unimplementedFunc), + /* 1346 */ SyscallDesc("unused#1346", unimplementedFunc), + /* 1347 */ SyscallDesc("unused#1347", unimplementedFunc), + /* 1348 */ SyscallDesc("unused#1348", unimplementedFunc), + /* 1349 */ SyscallDesc("unused#1349", unimplementedFunc), + /* 1350 */ SyscallDesc("unused#1350", unimplementedFunc), + /* 1351 */ SyscallDesc("unused#1351", unimplementedFunc), + /* 1352 */ SyscallDesc("unused#1352", unimplementedFunc), + /* 1353 */ SyscallDesc("unused#1353", unimplementedFunc), + /* 1354 */ SyscallDesc("unused#1354", unimplementedFunc), + /* 1355 */ SyscallDesc("unused#1355", unimplementedFunc), + /* 1356 */ SyscallDesc("unused#1356", unimplementedFunc), + /* 1357 */ SyscallDesc("unused#1357", unimplementedFunc), + /* 1358 */ SyscallDesc("unused#1358", unimplementedFunc), + /* 1359 */ SyscallDesc("unused#1359", unimplementedFunc), + /* 1360 */ SyscallDesc("unused#1360", unimplementedFunc), + /* 1361 */ SyscallDesc("unused#1361", unimplementedFunc), + /* 1362 */ SyscallDesc("unused#1362", unimplementedFunc), + /* 1363 */ SyscallDesc("unused#1363", unimplementedFunc), + /* 1364 */ SyscallDesc("unused#1364", unimplementedFunc), + /* 1365 */ SyscallDesc("unused#1365", unimplementedFunc), + /* 1366 */ SyscallDesc("unused#1366", unimplementedFunc), + /* 1367 */ SyscallDesc("unused#1367", unimplementedFunc), + /* 1368 */ SyscallDesc("unused#1368", unimplementedFunc), + /* 1369 */ SyscallDesc("unused#1369", unimplementedFunc), + /* 1370 */ SyscallDesc("unused#1370", unimplementedFunc), + /* 1371 */ SyscallDesc("unused#1371", unimplementedFunc), + /* 1372 */ SyscallDesc("unused#1372", unimplementedFunc), + /* 1373 */ SyscallDesc("unused#1373", unimplementedFunc), + /* 1374 */ SyscallDesc("unused#1374", unimplementedFunc), + /* 1375 */ SyscallDesc("unused#1375", unimplementedFunc), + /* 1376 */ SyscallDesc("unused#1376", unimplementedFunc), + /* 1377 */ SyscallDesc("unused#1377", unimplementedFunc), + /* 1378 */ SyscallDesc("unused#1378", unimplementedFunc), + /* 1379 */ SyscallDesc("unused#1379", unimplementedFunc), + /* 1380 */ SyscallDesc("unused#1380", unimplementedFunc), + /* 1381 */ SyscallDesc("unused#1381", unimplementedFunc), + /* 1382 */ SyscallDesc("unused#1382", unimplementedFunc), + /* 1383 */ SyscallDesc("unused#1383", unimplementedFunc), + /* 1384 */ SyscallDesc("unused#1384", unimplementedFunc), + /* 1385 */ SyscallDesc("unused#1385", unimplementedFunc), + /* 1386 */ SyscallDesc("unused#1386", unimplementedFunc), + /* 1387 */ SyscallDesc("unused#1387", unimplementedFunc), + /* 1388 */ SyscallDesc("unused#1388", unimplementedFunc), + /* 1389 */ SyscallDesc("unused#1389", unimplementedFunc), + /* 1390 */ SyscallDesc("unused#1390", unimplementedFunc), + /* 1391 */ SyscallDesc("unused#1391", unimplementedFunc), + /* 1392 */ SyscallDesc("unused#1392", unimplementedFunc), + /* 1393 */ SyscallDesc("unused#1393", unimplementedFunc), + /* 1394 */ SyscallDesc("unused#1394", unimplementedFunc), + /* 1395 */ SyscallDesc("unused#1395", unimplementedFunc), + /* 1396 */ SyscallDesc("unused#1396", unimplementedFunc), + /* 1397 */ SyscallDesc("unused#1397", unimplementedFunc), + /* 1398 */ SyscallDesc("unused#1398", unimplementedFunc), + /* 1399 */ SyscallDesc("unused#1399", unimplementedFunc), + /* 1400 */ SyscallDesc("unused#1400", unimplementedFunc), + /* 1401 */ SyscallDesc("unused#1401", unimplementedFunc), + /* 1402 */ SyscallDesc("unused#1402", unimplementedFunc), + /* 1403 */ SyscallDesc("unused#1403", unimplementedFunc), + /* 1404 */ SyscallDesc("unused#1404", unimplementedFunc), + /* 1405 */ SyscallDesc("unused#1405", unimplementedFunc), + /* 1406 */ SyscallDesc("unused#1406", unimplementedFunc), + /* 1407 */ SyscallDesc("unused#1407", unimplementedFunc), + /* 1408 */ SyscallDesc("unused#1408", unimplementedFunc), + /* 1409 */ SyscallDesc("unused#1409", unimplementedFunc), + /* 1410 */ SyscallDesc("unused#1410", unimplementedFunc), + /* 1411 */ SyscallDesc("unused#1411", unimplementedFunc), + /* 1412 */ SyscallDesc("unused#1412", unimplementedFunc), + /* 1413 */ SyscallDesc("unused#1413", unimplementedFunc), + /* 1414 */ SyscallDesc("unused#1414", unimplementedFunc), + /* 1415 */ SyscallDesc("unused#1415", unimplementedFunc), + /* 1416 */ SyscallDesc("unused#1416", unimplementedFunc), + /* 1417 */ SyscallDesc("unused#1417", unimplementedFunc), + /* 1418 */ SyscallDesc("unused#1418", unimplementedFunc), + /* 1419 */ SyscallDesc("unused#1419", unimplementedFunc), + /* 1420 */ SyscallDesc("unused#1420", unimplementedFunc), + /* 1421 */ SyscallDesc("unused#1421", unimplementedFunc), + /* 1422 */ SyscallDesc("unused#1422", unimplementedFunc), + /* 1423 */ SyscallDesc("unused#1423", unimplementedFunc), + /* 1424 */ SyscallDesc("unused#1424", unimplementedFunc), + /* 1425 */ SyscallDesc("unused#1425", unimplementedFunc), + /* 1426 */ SyscallDesc("unused#1426", unimplementedFunc), + /* 1427 */ SyscallDesc("unused#1427", unimplementedFunc), + /* 1428 */ SyscallDesc("unused#1428", unimplementedFunc), + /* 1429 */ SyscallDesc("unused#1429", unimplementedFunc), + /* 1430 */ SyscallDesc("unused#1430", unimplementedFunc), + /* 1431 */ SyscallDesc("unused#1431", unimplementedFunc), + /* 1432 */ SyscallDesc("unused#1432", unimplementedFunc), + /* 1433 */ SyscallDesc("unused#1433", unimplementedFunc), + /* 1434 */ SyscallDesc("unused#1434", unimplementedFunc), + /* 1435 */ SyscallDesc("unused#1435", unimplementedFunc), + /* 1436 */ SyscallDesc("unused#1436", unimplementedFunc), + /* 1437 */ SyscallDesc("unused#1437", unimplementedFunc), + /* 1438 */ SyscallDesc("unused#1438", unimplementedFunc), + /* 1439 */ SyscallDesc("unused#1439", unimplementedFunc), + /* 1440 */ SyscallDesc("unused#1440", unimplementedFunc), + /* 1441 */ SyscallDesc("unused#1441", unimplementedFunc), + /* 1442 */ SyscallDesc("unused#1442", unimplementedFunc), + /* 1443 */ SyscallDesc("unused#1443", unimplementedFunc), + /* 1444 */ SyscallDesc("unused#1444", unimplementedFunc), + /* 1445 */ SyscallDesc("unused#1445", unimplementedFunc), + /* 1446 */ SyscallDesc("unused#1446", unimplementedFunc), + /* 1447 */ SyscallDesc("unused#1447", unimplementedFunc), + /* 1448 */ SyscallDesc("unused#1448", unimplementedFunc), + /* 1449 */ SyscallDesc("unused#1449", unimplementedFunc), + /* 1450 */ SyscallDesc("unused#1450", unimplementedFunc), + /* 1451 */ SyscallDesc("unused#1451", unimplementedFunc), + /* 1452 */ SyscallDesc("unused#1452", unimplementedFunc), + /* 1453 */ SyscallDesc("unused#1453", unimplementedFunc), + /* 1454 */ SyscallDesc("unused#1454", unimplementedFunc), + /* 1455 */ SyscallDesc("unused#1455", unimplementedFunc), + /* 1456 */ SyscallDesc("unused#1456", unimplementedFunc), + /* 1457 */ SyscallDesc("unused#1457", unimplementedFunc), + /* 1458 */ SyscallDesc("unused#1458", unimplementedFunc), + /* 1459 */ SyscallDesc("unused#1459", unimplementedFunc), + /* 1460 */ SyscallDesc("unused#1460", unimplementedFunc), + /* 1461 */ SyscallDesc("unused#1461", unimplementedFunc), + /* 1462 */ SyscallDesc("unused#1462", unimplementedFunc), + /* 1463 */ SyscallDesc("unused#1463", unimplementedFunc), + /* 1464 */ SyscallDesc("unused#1464", unimplementedFunc), + /* 1465 */ SyscallDesc("unused#1465", unimplementedFunc), + /* 1466 */ SyscallDesc("unused#1466", unimplementedFunc), + /* 1467 */ SyscallDesc("unused#1467", unimplementedFunc), + /* 1468 */ SyscallDesc("unused#1468", unimplementedFunc), + /* 1469 */ SyscallDesc("unused#1469", unimplementedFunc), + /* 1470 */ SyscallDesc("unused#1470", unimplementedFunc), + /* 1471 */ SyscallDesc("unused#1471", unimplementedFunc), + /* 1472 */ SyscallDesc("unused#1472", unimplementedFunc), + /* 1473 */ SyscallDesc("unused#1473", unimplementedFunc), + /* 1474 */ SyscallDesc("unused#1474", unimplementedFunc), + /* 1475 */ SyscallDesc("unused#1475", unimplementedFunc), + /* 1476 */ SyscallDesc("unused#1476", unimplementedFunc), + /* 1477 */ SyscallDesc("unused#1477", unimplementedFunc), + /* 1478 */ SyscallDesc("unused#1478", unimplementedFunc), + /* 1479 */ SyscallDesc("unused#1479", unimplementedFunc), + /* 1480 */ SyscallDesc("unused#1480", unimplementedFunc), + /* 1481 */ SyscallDesc("unused#1481", unimplementedFunc), + /* 1482 */ SyscallDesc("unused#1482", unimplementedFunc), + /* 1483 */ SyscallDesc("unused#1483", unimplementedFunc), + /* 1484 */ SyscallDesc("unused#1484", unimplementedFunc), + /* 1485 */ SyscallDesc("unused#1485", unimplementedFunc), + /* 1486 */ SyscallDesc("unused#1486", unimplementedFunc), + /* 1487 */ SyscallDesc("unused#1487", unimplementedFunc), + /* 1488 */ SyscallDesc("unused#1488", unimplementedFunc), + /* 1489 */ SyscallDesc("unused#1489", unimplementedFunc), + /* 1490 */ SyscallDesc("unused#1490", unimplementedFunc), + /* 1491 */ SyscallDesc("unused#1491", unimplementedFunc), + /* 1492 */ SyscallDesc("unused#1492", unimplementedFunc), + /* 1493 */ SyscallDesc("unused#1493", unimplementedFunc), + /* 1494 */ SyscallDesc("unused#1494", unimplementedFunc), + /* 1495 */ SyscallDesc("unused#1495", unimplementedFunc), + /* 1496 */ SyscallDesc("unused#1496", unimplementedFunc), + /* 1497 */ SyscallDesc("unused#1497", unimplementedFunc), + /* 1498 */ SyscallDesc("unused#1498", unimplementedFunc), + /* 1499 */ SyscallDesc("unused#1499", unimplementedFunc), + /* 1500 */ SyscallDesc("unused#1500", unimplementedFunc), + /* 1501 */ SyscallDesc("unused#1501", unimplementedFunc), + /* 1502 */ SyscallDesc("unused#1502", unimplementedFunc), + /* 1503 */ SyscallDesc("unused#1503", unimplementedFunc), + /* 1504 */ SyscallDesc("unused#1504", unimplementedFunc), + /* 1505 */ SyscallDesc("unused#1505", unimplementedFunc), + /* 1506 */ SyscallDesc("unused#1506", unimplementedFunc), + /* 1507 */ SyscallDesc("unused#1507", unimplementedFunc), + /* 1508 */ SyscallDesc("unused#1508", unimplementedFunc), + /* 1509 */ SyscallDesc("unused#1509", unimplementedFunc), + /* 1510 */ SyscallDesc("unused#1510", unimplementedFunc), + /* 1511 */ SyscallDesc("unused#1511", unimplementedFunc), + /* 1512 */ SyscallDesc("unused#1512", unimplementedFunc), + /* 1513 */ SyscallDesc("unused#1513", unimplementedFunc), + /* 1514 */ SyscallDesc("unused#1514", unimplementedFunc), + /* 1515 */ SyscallDesc("unused#1515", unimplementedFunc), + /* 1516 */ SyscallDesc("unused#1516", unimplementedFunc), + /* 1517 */ SyscallDesc("unused#1517", unimplementedFunc), + /* 1518 */ SyscallDesc("unused#1518", unimplementedFunc), + /* 1519 */ SyscallDesc("unused#1519", unimplementedFunc), + /* 1520 */ SyscallDesc("unused#1520", unimplementedFunc), + /* 1521 */ SyscallDesc("unused#1521", unimplementedFunc), + /* 1522 */ SyscallDesc("unused#1522", unimplementedFunc), + /* 1523 */ SyscallDesc("unused#1523", unimplementedFunc), + /* 1524 */ SyscallDesc("unused#1524", unimplementedFunc), + /* 1525 */ SyscallDesc("unused#1525", unimplementedFunc), + /* 1526 */ SyscallDesc("unused#1526", unimplementedFunc), + /* 1527 */ SyscallDesc("unused#1527", unimplementedFunc), + /* 1528 */ SyscallDesc("unused#1528", unimplementedFunc), + /* 1529 */ SyscallDesc("unused#1529", unimplementedFunc), + /* 1530 */ SyscallDesc("unused#1530", unimplementedFunc), + /* 1531 */ SyscallDesc("unused#1531", unimplementedFunc), + /* 1532 */ SyscallDesc("unused#1532", unimplementedFunc), + /* 1533 */ SyscallDesc("unused#1533", unimplementedFunc), + /* 1534 */ SyscallDesc("unused#1534", unimplementedFunc), + /* 1535 */ SyscallDesc("unused#1535", unimplementedFunc), + /* 1536 */ SyscallDesc("unused#1536", unimplementedFunc), + /* 1537 */ SyscallDesc("unused#1537", unimplementedFunc), + /* 1538 */ SyscallDesc("unused#1538", unimplementedFunc), + /* 1539 */ SyscallDesc("unused#1539", unimplementedFunc), + /* 1540 */ SyscallDesc("unused#1540", unimplementedFunc), + /* 1541 */ SyscallDesc("unused#1541", unimplementedFunc), + /* 1542 */ SyscallDesc("unused#1542", unimplementedFunc), + /* 1543 */ SyscallDesc("unused#1543", unimplementedFunc), + /* 1544 */ SyscallDesc("unused#1544", unimplementedFunc), + /* 1545 */ SyscallDesc("unused#1545", unimplementedFunc), + /* 1546 */ SyscallDesc("unused#1546", unimplementedFunc), + /* 1547 */ SyscallDesc("unused#1547", unimplementedFunc), + /* 1548 */ SyscallDesc("unused#1548", unimplementedFunc), + /* 1549 */ SyscallDesc("unused#1549", unimplementedFunc), + /* 1550 */ SyscallDesc("unused#1550", unimplementedFunc), + /* 1551 */ SyscallDesc("unused#1551", unimplementedFunc), + /* 1552 */ SyscallDesc("unused#1552", unimplementedFunc), + /* 1553 */ SyscallDesc("unused#1553", unimplementedFunc), + /* 1554 */ SyscallDesc("unused#1554", unimplementedFunc), + /* 1555 */ SyscallDesc("unused#1555", unimplementedFunc), + /* 1556 */ SyscallDesc("unused#1556", unimplementedFunc), + /* 1557 */ SyscallDesc("unused#1557", unimplementedFunc), + /* 1558 */ SyscallDesc("unused#1558", unimplementedFunc), + /* 1559 */ SyscallDesc("unused#1559", unimplementedFunc), + /* 1560 */ SyscallDesc("unused#1560", unimplementedFunc), + /* 1561 */ SyscallDesc("unused#1561", unimplementedFunc), + /* 1562 */ SyscallDesc("unused#1562", unimplementedFunc), + /* 1563 */ SyscallDesc("unused#1563", unimplementedFunc), + /* 1564 */ SyscallDesc("unused#1564", unimplementedFunc), + /* 1565 */ SyscallDesc("unused#1565", unimplementedFunc), + /* 1566 */ SyscallDesc("unused#1566", unimplementedFunc), + /* 1567 */ SyscallDesc("unused#1567", unimplementedFunc), + /* 1568 */ SyscallDesc("unused#1568", unimplementedFunc), + /* 1569 */ SyscallDesc("unused#1569", unimplementedFunc), + /* 1570 */ SyscallDesc("unused#1570", unimplementedFunc), + /* 1571 */ SyscallDesc("unused#1571", unimplementedFunc), + /* 1572 */ SyscallDesc("unused#1572", unimplementedFunc), + /* 1573 */ SyscallDesc("unused#1573", unimplementedFunc), + /* 1574 */ SyscallDesc("unused#1574", unimplementedFunc), + /* 1575 */ SyscallDesc("unused#1575", unimplementedFunc), + /* 1576 */ SyscallDesc("unused#1576", unimplementedFunc), + /* 1577 */ SyscallDesc("unused#1577", unimplementedFunc), + /* 1578 */ SyscallDesc("unused#1578", unimplementedFunc), + /* 1579 */ SyscallDesc("unused#1579", unimplementedFunc), + /* 1580 */ SyscallDesc("unused#1580", unimplementedFunc), + /* 1581 */ SyscallDesc("unused#1581", unimplementedFunc), + /* 1582 */ SyscallDesc("unused#1582", unimplementedFunc), + /* 1583 */ SyscallDesc("unused#1583", unimplementedFunc), + /* 1584 */ SyscallDesc("unused#1584", unimplementedFunc), + /* 1585 */ SyscallDesc("unused#1585", unimplementedFunc), + /* 1586 */ SyscallDesc("unused#1586", unimplementedFunc), + /* 1587 */ SyscallDesc("unused#1587", unimplementedFunc), + /* 1588 */ SyscallDesc("unused#1588", unimplementedFunc), + /* 1589 */ SyscallDesc("unused#1589", unimplementedFunc), + /* 1590 */ SyscallDesc("unused#1590", unimplementedFunc), + /* 1591 */ SyscallDesc("unused#1591", unimplementedFunc), + /* 1592 */ SyscallDesc("unused#1592", unimplementedFunc), + /* 1593 */ SyscallDesc("unused#1593", unimplementedFunc), + /* 1594 */ SyscallDesc("unused#1594", unimplementedFunc), + /* 1595 */ SyscallDesc("unused#1595", unimplementedFunc), + /* 1596 */ SyscallDesc("unused#1596", unimplementedFunc), + /* 1597 */ SyscallDesc("unused#1597", unimplementedFunc), + /* 1598 */ SyscallDesc("unused#1598", unimplementedFunc), + /* 1599 */ SyscallDesc("unused#1599", unimplementedFunc), + /* 1600 */ SyscallDesc("unused#1600", unimplementedFunc), + /* 1601 */ SyscallDesc("unused#1601", unimplementedFunc), + /* 1602 */ SyscallDesc("unused#1602", unimplementedFunc), + /* 1603 */ SyscallDesc("unused#1603", unimplementedFunc), + /* 1604 */ SyscallDesc("unused#1604", unimplementedFunc), + /* 1605 */ SyscallDesc("unused#1605", unimplementedFunc), + /* 1606 */ SyscallDesc("unused#1606", unimplementedFunc), + /* 1607 */ SyscallDesc("unused#1607", unimplementedFunc), + /* 1608 */ SyscallDesc("unused#1608", unimplementedFunc), + /* 1609 */ SyscallDesc("unused#1609", unimplementedFunc), + /* 1610 */ SyscallDesc("unused#1610", unimplementedFunc), + /* 1611 */ SyscallDesc("unused#1611", unimplementedFunc), + /* 1612 */ SyscallDesc("unused#1612", unimplementedFunc), + /* 1613 */ SyscallDesc("unused#1613", unimplementedFunc), + /* 1614 */ SyscallDesc("unused#1614", unimplementedFunc), + /* 1615 */ SyscallDesc("unused#1615", unimplementedFunc), + /* 1616 */ SyscallDesc("unused#1616", unimplementedFunc), + /* 1617 */ SyscallDesc("unused#1617", unimplementedFunc), + /* 1618 */ SyscallDesc("unused#1618", unimplementedFunc), + /* 1619 */ SyscallDesc("unused#1619", unimplementedFunc), + /* 1620 */ SyscallDesc("unused#1620", unimplementedFunc), + /* 1621 */ SyscallDesc("unused#1621", unimplementedFunc), + /* 1622 */ SyscallDesc("unused#1622", unimplementedFunc), + /* 1623 */ SyscallDesc("unused#1623", unimplementedFunc), + /* 1624 */ SyscallDesc("unused#1624", unimplementedFunc), + /* 1625 */ SyscallDesc("unused#1625", unimplementedFunc), + /* 1626 */ SyscallDesc("unused#1626", unimplementedFunc), + /* 1627 */ SyscallDesc("unused#1627", unimplementedFunc), + /* 1628 */ SyscallDesc("unused#1628", unimplementedFunc), + /* 1629 */ SyscallDesc("unused#1629", unimplementedFunc), + /* 1630 */ SyscallDesc("unused#1630", unimplementedFunc), + /* 1631 */ SyscallDesc("unused#1631", unimplementedFunc), + /* 1632 */ SyscallDesc("unused#1632", unimplementedFunc), + /* 1633 */ SyscallDesc("unused#1633", unimplementedFunc), + /* 1634 */ SyscallDesc("unused#1634", unimplementedFunc), + /* 1635 */ SyscallDesc("unused#1635", unimplementedFunc), + /* 1636 */ SyscallDesc("unused#1636", unimplementedFunc), + /* 1637 */ SyscallDesc("unused#1637", unimplementedFunc), + /* 1638 */ SyscallDesc("unused#1638", unimplementedFunc), + /* 1639 */ SyscallDesc("unused#1639", unimplementedFunc), + /* 1640 */ SyscallDesc("unused#1640", unimplementedFunc), + /* 1641 */ SyscallDesc("unused#1641", unimplementedFunc), + /* 1642 */ SyscallDesc("unused#1642", unimplementedFunc), + /* 1643 */ SyscallDesc("unused#1643", unimplementedFunc), + /* 1644 */ SyscallDesc("unused#1644", unimplementedFunc), + /* 1645 */ SyscallDesc("unused#1645", unimplementedFunc), + /* 1646 */ SyscallDesc("unused#1646", unimplementedFunc), + /* 1647 */ SyscallDesc("unused#1647", unimplementedFunc), + /* 1648 */ SyscallDesc("unused#1648", unimplementedFunc), + /* 1649 */ SyscallDesc("unused#1649", unimplementedFunc), + /* 1650 */ SyscallDesc("unused#1650", unimplementedFunc), + /* 1651 */ SyscallDesc("unused#1651", unimplementedFunc), + /* 1652 */ SyscallDesc("unused#1652", unimplementedFunc), + /* 1653 */ SyscallDesc("unused#1653", unimplementedFunc), + /* 1654 */ SyscallDesc("unused#1654", unimplementedFunc), + /* 1655 */ SyscallDesc("unused#1655", unimplementedFunc), + /* 1656 */ SyscallDesc("unused#1656", unimplementedFunc), + /* 1657 */ SyscallDesc("unused#1657", unimplementedFunc), + /* 1658 */ SyscallDesc("unused#1658", unimplementedFunc), + /* 1659 */ SyscallDesc("unused#1659", unimplementedFunc), + /* 1660 */ SyscallDesc("unused#1660", unimplementedFunc), + /* 1661 */ SyscallDesc("unused#1661", unimplementedFunc), + /* 1662 */ SyscallDesc("unused#1662", unimplementedFunc), + /* 1663 */ SyscallDesc("unused#1663", unimplementedFunc), + /* 1664 */ SyscallDesc("unused#1664", unimplementedFunc), + /* 1665 */ SyscallDesc("unused#1665", unimplementedFunc), + /* 1666 */ SyscallDesc("unused#1666", unimplementedFunc), + /* 1667 */ SyscallDesc("unused#1667", unimplementedFunc), + /* 1668 */ SyscallDesc("unused#1668", unimplementedFunc), + /* 1669 */ SyscallDesc("unused#1669", unimplementedFunc), + /* 1670 */ SyscallDesc("unused#1670", unimplementedFunc), + /* 1671 */ SyscallDesc("unused#1671", unimplementedFunc), + /* 1672 */ SyscallDesc("unused#1672", unimplementedFunc), + /* 1673 */ SyscallDesc("unused#1673", unimplementedFunc), + /* 1674 */ SyscallDesc("unused#1674", unimplementedFunc), + /* 1675 */ SyscallDesc("unused#1675", unimplementedFunc), + /* 1676 */ SyscallDesc("unused#1676", unimplementedFunc), + /* 1677 */ SyscallDesc("unused#1677", unimplementedFunc), + /* 1678 */ SyscallDesc("unused#1678", unimplementedFunc), + /* 1679 */ SyscallDesc("unused#1679", unimplementedFunc), + /* 1680 */ SyscallDesc("unused#1680", unimplementedFunc), + /* 1681 */ SyscallDesc("unused#1681", unimplementedFunc), + /* 1682 */ SyscallDesc("unused#1682", unimplementedFunc), + /* 1683 */ SyscallDesc("unused#1683", unimplementedFunc), + /* 1684 */ SyscallDesc("unused#1684", unimplementedFunc), + /* 1685 */ SyscallDesc("unused#1685", unimplementedFunc), + /* 1686 */ SyscallDesc("unused#1686", unimplementedFunc), + /* 1687 */ SyscallDesc("unused#1687", unimplementedFunc), + /* 1688 */ SyscallDesc("unused#1688", unimplementedFunc), + /* 1689 */ SyscallDesc("unused#1689", unimplementedFunc), + /* 1690 */ SyscallDesc("unused#1690", unimplementedFunc), + /* 1691 */ SyscallDesc("unused#1691", unimplementedFunc), + /* 1692 */ SyscallDesc("unused#1692", unimplementedFunc), + /* 1693 */ SyscallDesc("unused#1693", unimplementedFunc), + /* 1694 */ SyscallDesc("unused#1694", unimplementedFunc), + /* 1695 */ SyscallDesc("unused#1695", unimplementedFunc), + /* 1696 */ SyscallDesc("unused#1696", unimplementedFunc), + /* 1697 */ SyscallDesc("unused#1697", unimplementedFunc), + /* 1698 */ SyscallDesc("unused#1698", unimplementedFunc), + /* 1699 */ SyscallDesc("unused#1699", unimplementedFunc), + /* 1700 */ SyscallDesc("unused#1700", unimplementedFunc), + /* 1701 */ SyscallDesc("unused#1701", unimplementedFunc), + /* 1702 */ SyscallDesc("unused#1702", unimplementedFunc), + /* 1703 */ SyscallDesc("unused#1703", unimplementedFunc), + /* 1704 */ SyscallDesc("unused#1704", unimplementedFunc), + /* 1705 */ SyscallDesc("unused#1705", unimplementedFunc), + /* 1706 */ SyscallDesc("unused#1706", unimplementedFunc), + /* 1707 */ SyscallDesc("unused#1707", unimplementedFunc), + /* 1708 */ SyscallDesc("unused#1708", unimplementedFunc), + /* 1709 */ SyscallDesc("unused#1709", unimplementedFunc), + /* 1710 */ SyscallDesc("unused#1710", unimplementedFunc), + /* 1711 */ SyscallDesc("unused#1711", unimplementedFunc), + /* 1712 */ SyscallDesc("unused#1712", unimplementedFunc), + /* 1713 */ SyscallDesc("unused#1713", unimplementedFunc), + /* 1714 */ SyscallDesc("unused#1714", unimplementedFunc), + /* 1715 */ SyscallDesc("unused#1715", unimplementedFunc), + /* 1716 */ SyscallDesc("unused#1716", unimplementedFunc), + /* 1717 */ SyscallDesc("unused#1717", unimplementedFunc), + /* 1718 */ SyscallDesc("unused#1718", unimplementedFunc), + /* 1719 */ SyscallDesc("unused#1719", unimplementedFunc), + /* 1720 */ SyscallDesc("unused#1720", unimplementedFunc), + /* 1721 */ SyscallDesc("unused#1721", unimplementedFunc), + /* 1722 */ SyscallDesc("unused#1722", unimplementedFunc), + /* 1723 */ SyscallDesc("unused#1723", unimplementedFunc), + /* 1724 */ SyscallDesc("unused#1724", unimplementedFunc), + /* 1725 */ SyscallDesc("unused#1725", unimplementedFunc), + /* 1726 */ SyscallDesc("unused#1726", unimplementedFunc), + /* 1727 */ SyscallDesc("unused#1727", unimplementedFunc), + /* 1728 */ SyscallDesc("unused#1728", unimplementedFunc), + /* 1729 */ SyscallDesc("unused#1729", unimplementedFunc), + /* 1730 */ SyscallDesc("unused#1730", unimplementedFunc), + /* 1731 */ SyscallDesc("unused#1731", unimplementedFunc), + /* 1732 */ SyscallDesc("unused#1732", unimplementedFunc), + /* 1733 */ SyscallDesc("unused#1733", unimplementedFunc), + /* 1734 */ SyscallDesc("unused#1734", unimplementedFunc), + /* 1735 */ SyscallDesc("unused#1735", unimplementedFunc), + /* 1736 */ SyscallDesc("unused#1736", unimplementedFunc), + /* 1737 */ SyscallDesc("unused#1737", unimplementedFunc), + /* 1738 */ SyscallDesc("unused#1738", unimplementedFunc), + /* 1739 */ SyscallDesc("unused#1739", unimplementedFunc), + /* 1740 */ SyscallDesc("unused#1740", unimplementedFunc), + /* 1741 */ SyscallDesc("unused#1741", unimplementedFunc), + /* 1742 */ SyscallDesc("unused#1742", unimplementedFunc), + /* 1743 */ SyscallDesc("unused#1743", unimplementedFunc), + /* 1744 */ SyscallDesc("unused#1744", unimplementedFunc), + /* 1745 */ SyscallDesc("unused#1745", unimplementedFunc), + /* 1746 */ SyscallDesc("unused#1746", unimplementedFunc), + /* 1747 */ SyscallDesc("unused#1747", unimplementedFunc), + /* 1748 */ SyscallDesc("unused#1748", unimplementedFunc), + /* 1749 */ SyscallDesc("unused#1749", unimplementedFunc), + /* 1750 */ SyscallDesc("unused#1750", unimplementedFunc), + /* 1751 */ SyscallDesc("unused#1751", unimplementedFunc), + /* 1752 */ SyscallDesc("unused#1752", unimplementedFunc), + /* 1753 */ SyscallDesc("unused#1753", unimplementedFunc), + /* 1754 */ SyscallDesc("unused#1754", unimplementedFunc), + /* 1755 */ SyscallDesc("unused#1755", unimplementedFunc), + /* 1756 */ SyscallDesc("unused#1756", unimplementedFunc), + /* 1757 */ SyscallDesc("unused#1757", unimplementedFunc), + /* 1758 */ SyscallDesc("unused#1758", unimplementedFunc), + /* 1759 */ SyscallDesc("unused#1759", unimplementedFunc), + /* 1760 */ SyscallDesc("unused#1760", unimplementedFunc), + /* 1761 */ SyscallDesc("unused#1761", unimplementedFunc), + /* 1762 */ SyscallDesc("unused#1762", unimplementedFunc), + /* 1763 */ SyscallDesc("unused#1763", unimplementedFunc), + /* 1764 */ SyscallDesc("unused#1764", unimplementedFunc), + /* 1765 */ SyscallDesc("unused#1765", unimplementedFunc), + /* 1766 */ SyscallDesc("unused#1766", unimplementedFunc), + /* 1767 */ SyscallDesc("unused#1767", unimplementedFunc), + /* 1768 */ SyscallDesc("unused#1768", unimplementedFunc), + /* 1769 */ SyscallDesc("unused#1769", unimplementedFunc), + /* 1770 */ SyscallDesc("unused#1770", unimplementedFunc), + /* 1771 */ SyscallDesc("unused#1771", unimplementedFunc), + /* 1772 */ SyscallDesc("unused#1772", unimplementedFunc), + /* 1773 */ SyscallDesc("unused#1773", unimplementedFunc), + /* 1774 */ SyscallDesc("unused#1774", unimplementedFunc), + /* 1775 */ SyscallDesc("unused#1775", unimplementedFunc), + /* 1776 */ SyscallDesc("unused#1776", unimplementedFunc), + /* 1777 */ SyscallDesc("unused#1777", unimplementedFunc), + /* 1778 */ SyscallDesc("unused#1778", unimplementedFunc), + /* 1779 */ SyscallDesc("unused#1779", unimplementedFunc), + /* 1780 */ SyscallDesc("unused#1780", unimplementedFunc), + /* 1781 */ SyscallDesc("unused#1781", unimplementedFunc), + /* 1782 */ SyscallDesc("unused#1782", unimplementedFunc), + /* 1783 */ SyscallDesc("unused#1783", unimplementedFunc), + /* 1784 */ SyscallDesc("unused#1784", unimplementedFunc), + /* 1785 */ SyscallDesc("unused#1785", unimplementedFunc), + /* 1786 */ SyscallDesc("unused#1786", unimplementedFunc), + /* 1787 */ SyscallDesc("unused#1787", unimplementedFunc), + /* 1788 */ SyscallDesc("unused#1788", unimplementedFunc), + /* 1789 */ SyscallDesc("unused#1789", unimplementedFunc), + /* 1790 */ SyscallDesc("unused#1790", unimplementedFunc), + /* 1791 */ SyscallDesc("unused#1791", unimplementedFunc), + /* 1792 */ SyscallDesc("unused#1792", unimplementedFunc), + /* 1793 */ SyscallDesc("unused#1793", unimplementedFunc), + /* 1794 */ SyscallDesc("unused#1794", unimplementedFunc), + /* 1795 */ SyscallDesc("unused#1795", unimplementedFunc), + /* 1796 */ SyscallDesc("unused#1796", unimplementedFunc), + /* 1797 */ SyscallDesc("unused#1797", unimplementedFunc), + /* 1798 */ SyscallDesc("unused#1798", unimplementedFunc), + /* 1799 */ SyscallDesc("unused#1799", unimplementedFunc), + /* 1800 */ SyscallDesc("unused#1800", unimplementedFunc), + /* 1801 */ SyscallDesc("unused#1801", unimplementedFunc), + /* 1802 */ SyscallDesc("unused#1802", unimplementedFunc), + /* 1803 */ SyscallDesc("unused#1803", unimplementedFunc), + /* 1804 */ SyscallDesc("unused#1804", unimplementedFunc), + /* 1805 */ SyscallDesc("unused#1805", unimplementedFunc), + /* 1806 */ SyscallDesc("unused#1806", unimplementedFunc), + /* 1807 */ SyscallDesc("unused#1807", unimplementedFunc), + /* 1808 */ SyscallDesc("unused#1808", unimplementedFunc), + /* 1809 */ SyscallDesc("unused#1809", unimplementedFunc), + /* 1810 */ SyscallDesc("unused#1810", unimplementedFunc), + /* 1811 */ SyscallDesc("unused#1811", unimplementedFunc), + /* 1812 */ SyscallDesc("unused#1812", unimplementedFunc), + /* 1813 */ SyscallDesc("unused#1813", unimplementedFunc), + /* 1814 */ SyscallDesc("unused#1814", unimplementedFunc), + /* 1815 */ SyscallDesc("unused#1815", unimplementedFunc), + /* 1816 */ SyscallDesc("unused#1816", unimplementedFunc), + /* 1817 */ SyscallDesc("unused#1817", unimplementedFunc), + /* 1818 */ SyscallDesc("unused#1818", unimplementedFunc), + /* 1819 */ SyscallDesc("unused#1819", unimplementedFunc), + /* 1820 */ SyscallDesc("unused#1820", unimplementedFunc), + /* 1821 */ SyscallDesc("unused#1821", unimplementedFunc), + /* 1822 */ SyscallDesc("unused#1822", unimplementedFunc), + /* 1823 */ SyscallDesc("unused#1823", unimplementedFunc), + /* 1824 */ SyscallDesc("unused#1824", unimplementedFunc), + /* 1825 */ SyscallDesc("unused#1825", unimplementedFunc), + /* 1826 */ SyscallDesc("unused#1826", unimplementedFunc), + /* 1827 */ SyscallDesc("unused#1827", unimplementedFunc), + /* 1828 */ SyscallDesc("unused#1828", unimplementedFunc), + /* 1829 */ SyscallDesc("unused#1829", unimplementedFunc), + /* 1830 */ SyscallDesc("unused#1830", unimplementedFunc), + /* 1831 */ SyscallDesc("unused#1831", unimplementedFunc), + /* 1832 */ SyscallDesc("unused#1832", unimplementedFunc), + /* 1833 */ SyscallDesc("unused#1833", unimplementedFunc), + /* 1834 */ SyscallDesc("unused#1834", unimplementedFunc), + /* 1835 */ SyscallDesc("unused#1835", unimplementedFunc), + /* 1836 */ SyscallDesc("unused#1836", unimplementedFunc), + /* 1837 */ SyscallDesc("unused#1837", unimplementedFunc), + /* 1838 */ SyscallDesc("unused#1838", unimplementedFunc), + /* 1839 */ SyscallDesc("unused#1839", unimplementedFunc), + /* 1840 */ SyscallDesc("unused#1840", unimplementedFunc), + /* 1841 */ SyscallDesc("unused#1841", unimplementedFunc), + /* 1842 */ SyscallDesc("unused#1842", unimplementedFunc), + /* 1843 */ SyscallDesc("unused#1843", unimplementedFunc), + /* 1844 */ SyscallDesc("unused#1844", unimplementedFunc), + /* 1845 */ SyscallDesc("unused#1845", unimplementedFunc), + /* 1846 */ SyscallDesc("unused#1846", unimplementedFunc), + /* 1847 */ SyscallDesc("unused#1847", unimplementedFunc), + /* 1848 */ SyscallDesc("unused#1848", unimplementedFunc), + /* 1849 */ SyscallDesc("unused#1849", unimplementedFunc), + /* 1850 */ SyscallDesc("unused#1850", unimplementedFunc), + /* 1851 */ SyscallDesc("unused#1851", unimplementedFunc), + /* 1852 */ SyscallDesc("unused#1852", unimplementedFunc), + /* 1853 */ SyscallDesc("unused#1853", unimplementedFunc), + /* 1854 */ SyscallDesc("unused#1854", unimplementedFunc), + /* 1855 */ SyscallDesc("unused#1855", unimplementedFunc), + /* 1856 */ SyscallDesc("unused#1856", unimplementedFunc), + /* 1857 */ SyscallDesc("unused#1857", unimplementedFunc), + /* 1858 */ SyscallDesc("unused#1858", unimplementedFunc), + /* 1859 */ SyscallDesc("unused#1859", unimplementedFunc), + /* 1860 */ SyscallDesc("unused#1860", unimplementedFunc), + /* 1861 */ SyscallDesc("unused#1861", unimplementedFunc), + /* 1862 */ SyscallDesc("unused#1862", unimplementedFunc), + /* 1863 */ SyscallDesc("unused#1863", unimplementedFunc), + /* 1864 */ SyscallDesc("unused#1864", unimplementedFunc), + /* 1865 */ SyscallDesc("unused#1865", unimplementedFunc), + /* 1866 */ SyscallDesc("unused#1866", unimplementedFunc), + /* 1867 */ SyscallDesc("unused#1867", unimplementedFunc), + /* 1868 */ SyscallDesc("unused#1868", unimplementedFunc), + /* 1869 */ SyscallDesc("unused#1869", unimplementedFunc), + /* 1870 */ SyscallDesc("unused#1870", unimplementedFunc), + /* 1871 */ SyscallDesc("unused#1871", unimplementedFunc), + /* 1872 */ SyscallDesc("unused#1872", unimplementedFunc), + /* 1873 */ SyscallDesc("unused#1873", unimplementedFunc), + /* 1874 */ SyscallDesc("unused#1874", unimplementedFunc), + /* 1875 */ SyscallDesc("unused#1875", unimplementedFunc), + /* 1876 */ SyscallDesc("unused#1876", unimplementedFunc), + /* 1877 */ SyscallDesc("unused#1877", unimplementedFunc), + /* 1878 */ SyscallDesc("unused#1878", unimplementedFunc), + /* 1879 */ SyscallDesc("unused#1879", unimplementedFunc), + /* 1880 */ SyscallDesc("unused#1880", unimplementedFunc), + /* 1881 */ SyscallDesc("unused#1881", unimplementedFunc), + /* 1882 */ SyscallDesc("unused#1882", unimplementedFunc), + /* 1883 */ SyscallDesc("unused#1883", unimplementedFunc), + /* 1884 */ SyscallDesc("unused#1884", unimplementedFunc), + /* 1885 */ SyscallDesc("unused#1885", unimplementedFunc), + /* 1886 */ SyscallDesc("unused#1886", unimplementedFunc), + /* 1887 */ SyscallDesc("unused#1887", unimplementedFunc), + /* 1888 */ SyscallDesc("unused#1888", unimplementedFunc), + /* 1889 */ SyscallDesc("unused#1889", unimplementedFunc), + /* 1890 */ SyscallDesc("unused#1890", unimplementedFunc), + /* 1891 */ SyscallDesc("unused#1891", unimplementedFunc), + /* 1892 */ SyscallDesc("unused#1892", unimplementedFunc), + /* 1893 */ SyscallDesc("unused#1893", unimplementedFunc), + /* 1894 */ SyscallDesc("unused#1894", unimplementedFunc), + /* 1895 */ SyscallDesc("unused#1895", unimplementedFunc), + /* 1896 */ SyscallDesc("unused#1896", unimplementedFunc), + /* 1897 */ SyscallDesc("unused#1897", unimplementedFunc), + /* 1898 */ SyscallDesc("unused#1898", unimplementedFunc), + /* 1899 */ SyscallDesc("unused#1899", unimplementedFunc), + /* 1900 */ SyscallDesc("unused#1900", unimplementedFunc), + /* 1901 */ SyscallDesc("unused#1901", unimplementedFunc), + /* 1902 */ SyscallDesc("unused#1902", unimplementedFunc), + /* 1903 */ SyscallDesc("unused#1903", unimplementedFunc), + /* 1904 */ SyscallDesc("unused#1904", unimplementedFunc), + /* 1905 */ SyscallDesc("unused#1905", unimplementedFunc), + /* 1906 */ SyscallDesc("unused#1906", unimplementedFunc), + /* 1907 */ SyscallDesc("unused#1907", unimplementedFunc), + /* 1908 */ SyscallDesc("unused#1908", unimplementedFunc), + /* 1909 */ SyscallDesc("unused#1909", unimplementedFunc), + /* 1910 */ SyscallDesc("unused#1910", unimplementedFunc), + /* 1911 */ SyscallDesc("unused#1911", unimplementedFunc), + /* 1912 */ SyscallDesc("unused#1912", unimplementedFunc), + /* 1913 */ SyscallDesc("unused#1913", unimplementedFunc), + /* 1914 */ SyscallDesc("unused#1914", unimplementedFunc), + /* 1915 */ SyscallDesc("unused#1915", unimplementedFunc), + /* 1916 */ SyscallDesc("unused#1916", unimplementedFunc), + /* 1917 */ SyscallDesc("unused#1917", unimplementedFunc), + /* 1918 */ SyscallDesc("unused#1918", unimplementedFunc), + /* 1919 */ SyscallDesc("unused#1919", unimplementedFunc), + /* 1920 */ SyscallDesc("unused#1920", unimplementedFunc), + /* 1921 */ SyscallDesc("unused#1921", unimplementedFunc), + /* 1922 */ SyscallDesc("unused#1922", unimplementedFunc), + /* 1923 */ SyscallDesc("unused#1923", unimplementedFunc), + /* 1924 */ SyscallDesc("unused#1924", unimplementedFunc), + /* 1925 */ SyscallDesc("unused#1925", unimplementedFunc), + /* 1926 */ SyscallDesc("unused#1926", unimplementedFunc), + /* 1927 */ SyscallDesc("unused#1927", unimplementedFunc), + /* 1928 */ SyscallDesc("unused#1928", unimplementedFunc), + /* 1929 */ SyscallDesc("unused#1929", unimplementedFunc), + /* 1930 */ SyscallDesc("unused#1930", unimplementedFunc), + /* 1931 */ SyscallDesc("unused#1931", unimplementedFunc), + /* 1932 */ SyscallDesc("unused#1932", unimplementedFunc), + /* 1933 */ SyscallDesc("unused#1933", unimplementedFunc), + /* 1934 */ SyscallDesc("unused#1934", unimplementedFunc), + /* 1935 */ SyscallDesc("unused#1935", unimplementedFunc), + /* 1936 */ SyscallDesc("unused#1936", unimplementedFunc), + /* 1937 */ SyscallDesc("unused#1937", unimplementedFunc), + /* 1938 */ SyscallDesc("unused#1938", unimplementedFunc), + /* 1939 */ SyscallDesc("unused#1939", unimplementedFunc), + /* 1940 */ SyscallDesc("unused#1940", unimplementedFunc), + /* 1941 */ SyscallDesc("unused#1941", unimplementedFunc), + /* 1942 */ SyscallDesc("unused#1942", unimplementedFunc), + /* 1943 */ SyscallDesc("unused#1943", unimplementedFunc), + /* 1944 */ SyscallDesc("unused#1944", unimplementedFunc), + /* 1945 */ SyscallDesc("unused#1945", unimplementedFunc), + /* 1946 */ SyscallDesc("unused#1946", unimplementedFunc), + /* 1947 */ SyscallDesc("unused#1947", unimplementedFunc), + /* 1948 */ SyscallDesc("unused#1948", unimplementedFunc), + /* 1949 */ SyscallDesc("unused#1949", unimplementedFunc), + /* 1950 */ SyscallDesc("unused#1950", unimplementedFunc), + /* 1951 */ SyscallDesc("unused#1951", unimplementedFunc), + /* 1952 */ SyscallDesc("unused#1952", unimplementedFunc), + /* 1953 */ SyscallDesc("unused#1953", unimplementedFunc), + /* 1954 */ SyscallDesc("unused#1954", unimplementedFunc), + /* 1955 */ SyscallDesc("unused#1955", unimplementedFunc), + /* 1956 */ SyscallDesc("unused#1956", unimplementedFunc), + /* 1957 */ SyscallDesc("unused#1957", unimplementedFunc), + /* 1958 */ SyscallDesc("unused#1958", unimplementedFunc), + /* 1959 */ SyscallDesc("unused#1959", unimplementedFunc), + /* 1960 */ SyscallDesc("unused#1960", unimplementedFunc), + /* 1961 */ SyscallDesc("unused#1961", unimplementedFunc), + /* 1962 */ SyscallDesc("unused#1962", unimplementedFunc), + /* 1963 */ SyscallDesc("unused#1963", unimplementedFunc), + /* 1964 */ SyscallDesc("unused#1964", unimplementedFunc), + /* 1965 */ SyscallDesc("unused#1965", unimplementedFunc), + /* 1966 */ SyscallDesc("unused#1966", unimplementedFunc), + /* 1967 */ SyscallDesc("unused#1967", unimplementedFunc), + /* 1968 */ SyscallDesc("unused#1968", unimplementedFunc), + /* 1969 */ SyscallDesc("unused#1969", unimplementedFunc), + /* 1970 */ SyscallDesc("unused#1970", unimplementedFunc), + /* 1971 */ SyscallDesc("unused#1971", unimplementedFunc), + /* 1972 */ SyscallDesc("unused#1972", unimplementedFunc), + /* 1973 */ SyscallDesc("unused#1973", unimplementedFunc), + /* 1974 */ SyscallDesc("unused#1974", unimplementedFunc), + /* 1975 */ SyscallDesc("unused#1975", unimplementedFunc), + /* 1976 */ SyscallDesc("unused#1976", unimplementedFunc), + /* 1977 */ SyscallDesc("unused#1977", unimplementedFunc), + /* 1978 */ SyscallDesc("unused#1978", unimplementedFunc), + /* 1979 */ SyscallDesc("unused#1979", unimplementedFunc), + /* 1980 */ SyscallDesc("unused#1980", unimplementedFunc), + /* 1981 */ SyscallDesc("unused#1981", unimplementedFunc), + /* 1982 */ SyscallDesc("unused#1982", unimplementedFunc), + /* 1983 */ SyscallDesc("unused#1983", unimplementedFunc), + /* 1984 */ SyscallDesc("unused#1984", unimplementedFunc), + /* 1985 */ SyscallDesc("unused#1985", unimplementedFunc), + /* 1986 */ SyscallDesc("unused#1986", unimplementedFunc), + /* 1987 */ SyscallDesc("unused#1987", unimplementedFunc), + /* 1988 */ SyscallDesc("unused#1988", unimplementedFunc), + /* 1989 */ SyscallDesc("unused#1989", unimplementedFunc), + /* 1990 */ SyscallDesc("unused#1990", unimplementedFunc), + /* 1991 */ SyscallDesc("unused#1991", unimplementedFunc), + /* 1992 */ SyscallDesc("unused#1992", unimplementedFunc), + /* 1993 */ SyscallDesc("unused#1993", unimplementedFunc), + /* 1994 */ SyscallDesc("unused#1994", unimplementedFunc), + /* 1995 */ SyscallDesc("unused#1995", unimplementedFunc), + /* 1996 */ SyscallDesc("unused#1996", unimplementedFunc), + /* 1997 */ SyscallDesc("unused#1997", unimplementedFunc), + /* 1998 */ SyscallDesc("unused#1998", unimplementedFunc), + /* 1999 */ SyscallDesc("unused#1999", unimplementedFunc), + /* 2000 */ SyscallDesc("unused#2000", unimplementedFunc), + /* 2001 */ SyscallDesc("unused#2001", unimplementedFunc), + /* 2002 */ SyscallDesc("unused#2002", unimplementedFunc), + /* 2003 */ SyscallDesc("unused#2003", unimplementedFunc), + /* 2004 */ SyscallDesc("unused#2004", unimplementedFunc), + /* 2005 */ SyscallDesc("unused#2005", unimplementedFunc), + /* 2006 */ SyscallDesc("unused#2006", unimplementedFunc), + /* 2007 */ SyscallDesc("unused#2007", unimplementedFunc), + /* 2008 */ SyscallDesc("unused#2008", unimplementedFunc), + /* 2009 */ SyscallDesc("unused#2009", unimplementedFunc), + /* 2010 */ SyscallDesc("unused#2010", unimplementedFunc), + /* 2011 */ SyscallDesc("getmainvars", unimplementedFunc), + /* 2012 */ SyscallDesc("unused#2012", unimplementedFunc), + /* 2013 */ SyscallDesc("unused#2013", unimplementedFunc), + /* 2014 */ SyscallDesc("unused#2014", unimplementedFunc), + /* 2015 */ SyscallDesc("unused#2015", unimplementedFunc), + /* 2016 */ SyscallDesc("unused#2016", unimplementedFunc), + /* 2017 */ SyscallDesc("unused#2017", unimplementedFunc), + /* 2018 */ SyscallDesc("unused#2018", unimplementedFunc), + /* 2019 */ SyscallDesc("unused#2019", unimplementedFunc), + /* 2020 */ SyscallDesc("unused#2020", unimplementedFunc), + /* 2021 */ SyscallDesc("unused#2021", unimplementedFunc), + /* 2022 */ SyscallDesc("unused#2022", unimplementedFunc), + /* 2023 */ SyscallDesc("unused#2023", unimplementedFunc), + /* 2024 */ SyscallDesc("unused#2024", unimplementedFunc), + /* 2025 */ SyscallDesc("unused#2025", unimplementedFunc), + /* 2026 */ SyscallDesc("unused#2026", unimplementedFunc), + /* 2027 */ SyscallDesc("unused#2027", unimplementedFunc), + /* 2028 */ SyscallDesc("unused#2028", unimplementedFunc), + /* 2029 */ SyscallDesc("unused#2029", unimplementedFunc), + /* 2030 */ SyscallDesc("unused#2030", unimplementedFunc), + /* 2031 */ SyscallDesc("unused#2031", unimplementedFunc), + /* 2032 */ SyscallDesc("unused#2032", unimplementedFunc), + /* 2033 */ SyscallDesc("unused#2033", unimplementedFunc), + /* 2034 */ SyscallDesc("unused#2034", unimplementedFunc), + /* 2035 */ SyscallDesc("unused#2035", unimplementedFunc), + /* 2036 */ SyscallDesc("unused#2036", unimplementedFunc), + /* 2037 */ SyscallDesc("unused#2037", unimplementedFunc), + /* 2038 */ SyscallDesc("unused#2038", unimplementedFunc), + /* 2039 */ SyscallDesc("unused#2039", unimplementedFunc), + /* 2040 */ SyscallDesc("unused#2040", unimplementedFunc), + /* 2041 */ SyscallDesc("unused#2041", unimplementedFunc), + /* 2042 */ SyscallDesc("unused#2042", unimplementedFunc), + /* 2043 */ SyscallDesc("unused#2043", unimplementedFunc), + /* 2044 */ SyscallDesc("unused#2044", unimplementedFunc), + /* 2045 */ SyscallDesc("unused#2045", unimplementedFunc), + /* 2046 */ SyscallDesc("unused#2046", unimplementedFunc), + /* 2047 */ SyscallDesc("unused#2047", unimplementedFunc) +}; + +RiscvLinuxProcess::RiscvLinuxProcess(LiveProcessParams * params, + ObjectFile *objFile) + : RiscvLiveProcess(params, objFile), + Num_Syscall_Descs(sizeof(syscallDescs) / sizeof(SyscallDesc)) +{ } + +SyscallDesc* +RiscvLinuxProcess::getDesc(int callnum) +{ + if (callnum < 0 || callnum >= Num_Syscall_Descs) { + return NULL; + } else { + return &syscallDescs[callnum]; + } +} diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/locked_mem.hh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/locked_mem.hh Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2006 The Regents of The University of Michigan + * Copyright (c) 2007-2008 The Florida State University + * Copyright (c) 2009 The University of Edinburgh + * Copyright (c) 2014-2015 Sven Karlsson + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Steve Reinhardt + * Stephen Hines + * Timothy M. Jones + * Sven Karlsson + */ + +#ifndef __ARCH_RISCV_LOCKED_MEM_HH__ +#define __ARCH_RISCV_LOCKED_MEM_HH__ + +/** + * @file + * + * ISA-specific helper functions for locked memory accesses. + */ + +#include "mem/packet.hh" +#include "mem/request.hh" + +namespace RiscvISA +{ + +template inline void +handleLockedSnoop(XC *xc, PacketPtr pkt, Addr cacheBlockMask) +{} + +template inline void +handleLockedRead(XC *xc, Request *req) +{} + +template inline void +handleLockedSnoopHit(XC *xc) +{} + +template inline bool +handleLockedWrite(XC *xc, Request *req, Addr cacheBlockMask) +{ + return true; +} + +} // namespace RiscvISA + +#endif // __ARCH_RISCV_LOCKED_MEM_HH__ diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/microcode_rom.hh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/microcode_rom.hh Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2008 The Regents of The University of Michigan + * Copyright (c) 2009 The University of Edinburgh + * Copyright (c) 2014 - 2015 Sven Karlsson + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Gabe Black + * Timothy M. Jones + * Sven Karlsson + */ + +#ifndef __ARCH_RISCV_MICROCODE_ROM_HH__ +#define __ARCH_RISCV_MICROCODE_ROM_HH__ + +#include "sim/microcode_rom.hh" + +namespace RiscvISA +{ + using ::MicrocodeRom; +} // namespace RiscvISA + +#endif // __ARCH_RISCV_MICROCODE_ROM_HH__ diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/mmapped_ipr.hh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/mmapped_ipr.hh Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2006 The Regents of The University of Michigan + * Copyright (c) 2007-2008 The Florida State University + * Copyright (c) 2009 The University of Edinburgh + * Copyright (c) 2014-2015 Sven Karlsson + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Ali Saidi + * Stephen Hines + * Timothy M. Jones + * Sven Karlsson + */ + +#ifndef __ARCH_RISCV_MMAPPED_IPR_HH__ +#define __ARCH_RISCV_MMAPPED_IPR_HH__ + +/** + * @file + * + * ISA-specific helper functions for memory mapped IPR accesses. + */ + +#include "arch/generic/mmapped_ipr.hh" + +class ThreadContext; + +namespace RiscvISA +{ + using GenericISA::handleIprRead; + using GenericISA::handleIprWrite; +} // namespace RiscvISA + +#endif // __ARCH_RISCV_MMAPPED_IPR_HH__ diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/pagetable.hh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/pagetable.hh Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2002-2005 The Regents of The University of Michigan + * Copyright (c) 2007 MIPS Technologies, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Nathan Binkert + * Steve Reinhardt + * Jaidev Patwardhan + */ + +#ifndef __ARCH_RISCV_PAGETABLE_H__ +#define __ARCH_RISCV_PAGETABLE_H__ + +#include "base/misc.hh" +#include "base/types.hh" +#include "sim/serialize.hh" + +namespace RiscvISA { + +struct VAddr +{ +}; + +// ITB/DTB page table entry +struct PTE +{ + Addr Mask; + Addr VPN; + uint8_t asid; + + bool G; + + /* Contents of Entry Lo0 */ + Addr PFN0; // Physical Frame Number - Even + bool D0; // Even entry Dirty Bit + bool V0; // Even entry Valid Bit + uint8_t C0; // Cache Coherency Bits - Even + + /* Contents of Entry Lo1 */ + Addr PFN1; // Physical Frame Number - Odd + bool D1; // Odd entry Dirty Bit + bool V1; // Odd entry Valid Bit + uint8_t C1; // Cache Coherency Bits (3 bits) + + /* + * The next few variables are put in as optimizations to reduce + * TLB lookup overheads. For a given Mask, what is the address shift + * amount, and what is the OffsetMask + */ + int AddrShiftAmount; + int OffsetMask; + + bool Valid() { return (V0 | V1); }; + void serialize(CheckpointOut &cp) const; + void unserialize(CheckpointIn &cp); +}; + +// WARN: This particular TLB entry is not necessarily conformed to RISCV ISA +struct TlbEntry +{ + Addr _pageStart; + TlbEntry() {} + TlbEntry(Addr asn, Addr vaddr, Addr paddr, + bool uncacheable, bool read_only) + : _pageStart(paddr) + { + if (uncacheable || read_only) + warn("RISCV TlbEntry does not support uncacheable" + " or read-only mappings\n"); + } + + Addr pageStart() + { + return _pageStart; + } + + void + updateVaddr(Addr new_vaddr) {} + + void + serialize(CheckpointOut &cp) const + { + SERIALIZE_SCALAR(_pageStart); + } + + void + unserialize(CheckpointIn &cp) + { + UNSERIALIZE_SCALAR(_pageStart); + } + +}; + +}; +#endif // __ARCH_RISCV_PAGETABLE_H__ + diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/pagetable.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/pagetable.cc Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2002-2005 The Regents of The University of Michigan + * Copyright (c) 2007 MIPS Technologies, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Nathan Binkert + * Steve Reinhardt + * Jaidev Patwardhan + */ + +#include "arch/riscv/pagetable.hh" + +#include "sim/serialize.hh" + +namespace RiscvISA +{ + +void +PTE::serialize(CheckpointOut &cp) const +{ + SERIALIZE_SCALAR(Mask); + SERIALIZE_SCALAR(VPN); + SERIALIZE_SCALAR(asid); + SERIALIZE_SCALAR(G); + SERIALIZE_SCALAR(PFN0); + SERIALIZE_SCALAR(D0); + SERIALIZE_SCALAR(V0); + SERIALIZE_SCALAR(C0); + SERIALIZE_SCALAR(PFN1); + SERIALIZE_SCALAR(D1); + SERIALIZE_SCALAR(V1); + SERIALIZE_SCALAR(C1); + SERIALIZE_SCALAR(AddrShiftAmount); + SERIALIZE_SCALAR(OffsetMask); +} + +void +PTE::unserialize(CheckpointIn &cp) +{ + UNSERIALIZE_SCALAR(Mask); + UNSERIALIZE_SCALAR(VPN); + UNSERIALIZE_SCALAR(asid); + UNSERIALIZE_SCALAR(G); + UNSERIALIZE_SCALAR(PFN0); + UNSERIALIZE_SCALAR(D0); + UNSERIALIZE_SCALAR(V0); + UNSERIALIZE_SCALAR(C0); + UNSERIALIZE_SCALAR(PFN1); + UNSERIALIZE_SCALAR(D1); + UNSERIALIZE_SCALAR(V1); + UNSERIALIZE_SCALAR(C1); + UNSERIALIZE_SCALAR(AddrShiftAmount); + UNSERIALIZE_SCALAR(OffsetMask); +} + +} diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/pra_constants.hh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/pra_constants.hh Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,330 @@ +/* + * Copyright (c) 2007 MIPS Technologies, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Jaidev Patwardhan + */ + +#ifndef __ARCH_RISCV_PRA_CONSTANTS_HH__ +#define __ARCH_RISCV_PRA_CONSTANTS_HH__ + +#include "arch/riscv/types.hh" +#include "base/bitunion.hh" + +namespace RiscvISA +{ + +BitUnion32(IndexReg) + Bitfield<31> p; + // Need to figure out how to put in the TLB specific bits here + // For now, we assume that the entire length is used by the index + // field In reality, Index_HI = N-1, where + // N = Ceiling(log2(TLB Entries)) + Bitfield<30, 0> index; +EndBitUnion(IndexReg) + +BitUnion32(RandomReg) + // This has a problem similar to the IndexReg index field. We'll keep + // both consistent at 30 for now + Bitfield<30, 0> random; +EndBitUnion(RandomReg) + +BitUnion64(EntryLoReg) + Bitfield<63, 30> fill; + Bitfield<29, 6> pfn; // Page frame number + Bitfield<5, 3> c; // Coherency attribute + Bitfield<2> d; // Dirty Bit + Bitfield<1> v; // Valid Bit + Bitfield<0> g; // Global Bit +EndBitUnion(EntryLoReg) + +BitUnion64(ContextReg) + Bitfield<63, 23> pteBase; + Bitfield<22, 4> badVPN2; + // Bits 3-0 are 0 +EndBitUnion(ContextReg) + +BitUnion32(PageMaskReg) + // Bits 31-29 are 0 + Bitfield<28, 13> mask; + Bitfield<12, 11> maskx; + // Bits 10-0 are zero +EndBitUnion(PageMaskReg) + +BitUnion32(PageGrainReg) + Bitfield<31, 30> aseUp; + Bitfield<29> elpa; + Bitfield<28> esp; + // Bits 27-13 are zeros + Bitfield<12, 8> aseDn; + // Bits 7-0 are zeros +EndBitUnion(PageGrainReg) + +BitUnion32(WiredReg) + // See note on Index register above + Bitfield<30, 0> wired; +EndBitUnion(WiredReg) + +BitUnion32(HWREnaReg) + Bitfield<31, 30> impl; + Bitfield<3, 0> mask; +EndBitUnion(HWREnaReg) + +BitUnion64(EntryHiReg) + Bitfield<63, 62> r; + Bitfield<61, 40> fill; + Bitfield<39, 13> vpn2; + Bitfield<12, 11> vpn2x; + Bitfield<7, 0> asid; +EndBitUnion(EntryHiReg) + +BitUnion32(StatusReg) + SubBitUnion(cu, 31, 28) + Bitfield<31> cu3; + Bitfield<30> cu2; + Bitfield<29> cu1; + Bitfield<28> cu0; + EndSubBitUnion(cu) + Bitfield<27> rp; + Bitfield<26> fr; + Bitfield<25> re; + Bitfield<24> mx; + Bitfield<23> px; + Bitfield<22> bev; + Bitfield<21> ts; + Bitfield<20> sr; + Bitfield<19> nmi; + // Bit 18 is zero + Bitfield<17, 16> impl; + Bitfield<15, 10> ipl; + SubBitUnion(im, 15, 8) + Bitfield<15> im7; + Bitfield<14> im6; + Bitfield<13> im5; + Bitfield<12> im4; + Bitfield<11> im3; + Bitfield<10> im2; + Bitfield<9> im1; + Bitfield<8> im0; + EndSubBitUnion(im) + Bitfield<7> kx; + Bitfield<6> sx; + Bitfield<5> ux; + Bitfield<4, 3> ksu; + Bitfield<4> um; + Bitfield<3> r0; + Bitfield<2> erl; + Bitfield<1> exl; + Bitfield<0> ie; +EndBitUnion(StatusReg) + +BitUnion32(IntCtlReg) + Bitfield<31, 29> ipti; + Bitfield<28, 26> ippci; + // Bits 26-10 are zeros + Bitfield<9, 5> vs; + // Bits 4-0 are zeros +EndBitUnion(IntCtlReg) + +BitUnion32(SRSCtlReg) + // Bits 31-30 are zeros + Bitfield<29, 26> hss; + // Bits 25-22 are zeros + Bitfield<21, 18> eicss; + // Bits 17-16 are zeros + Bitfield<15, 12> ess; + // Bits 11-10 are zeros + Bitfield<9, 6> pss; + // Bits 5-4 are zeros + Bitfield<3, 0> css; +EndBitUnion(SRSCtlReg) + +BitUnion32(SRSMapReg) + Bitfield<31, 28> ssv7; + Bitfield<27, 24> ssv6; + Bitfield<23, 20> ssv5; + Bitfield<19, 16> ssv4; + Bitfield<15, 12> ssv3; + Bitfield<11, 8> ssv2; + Bitfield<7, 4> ssv1; + Bitfield<3, 0> ssv0; +EndBitUnion(SRSMapReg) + +BitUnion32(CauseReg) + Bitfield<31> bd; + Bitfield<30> ti; + Bitfield<29, 28> ce; + Bitfield<27> dc; + Bitfield<26> pci; + // Bits 25-24 are zeros + Bitfield<23> iv; + Bitfield<22> wp; + // Bits 21-16 are zeros + Bitfield<15, 10> ripl; + SubBitUnion(ip, 15, 8) + Bitfield<15> ip7; + Bitfield<14> ip6; + Bitfield<13> ip5; + Bitfield<12> ip4; + Bitfield<11> ip3; + Bitfield<10> ip2; + Bitfield<9> ip1; + Bitfield<8> ip0; + EndSubBitUnion(ip); + // Bit 7 is zero + Bitfield<6, 2> excCode; + // Bits 1-0 are zeros +EndBitUnion(CauseReg) + +BitUnion32(PRIdReg) + Bitfield<31, 24> coOp; + Bitfield<23, 16> coId; + Bitfield<15, 8> procId; + Bitfield<7, 0> rev; +EndBitUnion(PRIdReg) + +BitUnion32(EBaseReg) + // Bit 31 is one + // Bit 30 is zero + Bitfield<29, 12> exceptionBase; + // Bits 11-10 are zeros + Bitfield<9, 9> cpuNum; +EndBitUnion(EBaseReg) + +BitUnion32(ConfigReg) + Bitfield<31> m; + Bitfield<30, 28> k23; + Bitfield<27, 25> ku; + Bitfield<24, 16> impl; + Bitfield<15> be; + Bitfield<14, 13> at; + Bitfield<12, 10> ar; + Bitfield<9, 7> mt; + // Bits 6-4 are zeros + Bitfield<3> vi; + Bitfield<2, 0> k0; +EndBitUnion(ConfigReg) + +BitUnion32(Config1Reg) + Bitfield<31> m; + Bitfield<30, 25> mmuSize; + Bitfield<24, 22> is; + Bitfield<21, 19> il; + Bitfield<18, 16> ia; + Bitfield<15, 13> ds; + Bitfield<12, 10> dl; + Bitfield<9, 7> da; + Bitfield<6> c2; + Bitfield<5> md; + Bitfield<4> pc; + Bitfield<3> wr; + Bitfield<2> ca; + Bitfield<1> ep; + Bitfield<0> fp; +EndBitUnion(Config1Reg) + +BitUnion32(Config2Reg) + Bitfield<31> m; + Bitfield<30, 28> tu; + Bitfield<27, 24> ts; + Bitfield<23, 20> tl; + Bitfield<19, 16> ta; + Bitfield<15, 12> su; + Bitfield<11, 8> ss; + Bitfield<7, 4> sl; + Bitfield<3, 0> sa; +EndBitUnion(Config2Reg) + +BitUnion32(Config3Reg) + Bitfield<31> m; + // Bits 30-11 are zeros + Bitfield<10> dspp; + // Bits 9-8 are zeros + Bitfield<7> lpa; + Bitfield<6> veic; + Bitfield<5> vint; + Bitfield<4> sp; + // Bit 3 is zero + Bitfield<2> mt; + Bitfield<1> sm; + Bitfield<0> tl; +EndBitUnion(Config3Reg) + +BitUnion64(WatchLoReg) + Bitfield<63, 3> vaddr; + Bitfield<2> i; + Bitfield<1> r; + Bitfield<0> w; +EndBitUnion(WatchLoReg) + +BitUnion32(WatchHiReg) + Bitfield<31> m; + Bitfield<30> g; + // Bits 29-24 are zeros + Bitfield<23, 16> asid; + // Bits 15-12 are zeros + Bitfield<11, 3> mask; + Bitfield<2> i; + Bitfield<1> r; + Bitfield<0> w; +EndBitUnion(WatchHiReg) + +BitUnion32(PerfCntCtlReg) + Bitfield<31> m; + Bitfield<30> w; + // Bits 29-11 are zeros + Bitfield<10, 5> event; + Bitfield<4> ie; + Bitfield<3> u; + Bitfield<2> s; + Bitfield<1> k; + Bitfield<0> exl; +EndBitUnion(PerfCntCtlReg) + +BitUnion32(CacheErrReg) + Bitfield<31> er; + Bitfield<30> ec; + Bitfield<29> ed; + Bitfield<28> et; + Bitfield<27> es; + Bitfield<26> ee; + Bitfield<25> eb; + Bitfield<24, 22> impl; + Bitfield<22, 0> index; +EndBitUnion(CacheErrReg) + +BitUnion32(TagLoReg) + Bitfield<31, 8> pTagLo; + Bitfield<7, 6> pState; + Bitfield<5> l; + Bitfield<4, 3> impl; + // Bits 2-1 are zeros + Bitfield<0> p; +EndBitUnion(TagLoReg) + +} // namespace RiscvISA + +#endif diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/process.hh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/process.hh Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2006 The Regents of The University of Michigan + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Gabe Black + * Ali Saidi + */ + +#ifndef __RISCV_PROCESS_HH__ +#define __RISCV_PROCESS_HH__ + +#include +#include + +#include "sim/process.hh" + +class LiveProcess; +class ObjectFile; +class System; + +class RiscvLiveProcess : public LiveProcess +{ + protected: + RiscvLiveProcess(LiveProcessParams * params, ObjectFile *objFile); + + void initState(); + + template + void argsInit(int pageSize); + + public: + RiscvISA::IntReg getSyscallArg(ThreadContext *tc, int &i); + /// Explicitly import the otherwise hidden getSyscallArg + using LiveProcess::getSyscallArg; + void setSyscallArg(ThreadContext *tc, int i, RiscvISA::IntReg val); + void setSyscallReturn(ThreadContext *tc, SyscallReturn return_value); +}; + +/* No architectural page table defined for this ISA */ +typedef NoArchPageTable ArchPageTable; + + +#endif // __MIPS_PROCESS_HH__ diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/process.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/process.cc Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,237 @@ +/* + * Copyright (c) 2004-2005 The Regents of The University of Michigan + * Copyright (c) 2016 The University of Virginia + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Gabe Black + * Ali Saidi + * Korey Sewell + * Alec Roelke + */ +#include "arch/riscv/process.hh" + +#include + +#include "arch/riscv/isa_traits.hh" +#include "base/loader/elf_object.hh" +#include "base/loader/object_file.hh" +#include "base/misc.hh" +#include "cpu/thread_context.hh" +#include "debug/Loader.hh" +#include "mem/page_table.hh" +#include "sim/process.hh" +#include "sim/process_impl.hh" +#include "sim/system.hh" + +using namespace std; +using namespace RiscvISA; + +RiscvLiveProcess::RiscvLiveProcess(LiveProcessParams * params, + ObjectFile *objFile) + : LiveProcess(params, objFile) +{ + // Set up stack. On RISC-V, stack starts at the top of kuseg + // user address space. RISC-V stack grows down from here + stack_base = 0x7FFFFFFF; + + // Set pointer for next thread stack. Reserve 8M for main stack. + next_thread_stack_base = stack_base - (8*1024*1024); + + // Set up break point (Top of Heap) + brk_point = objFile->bssBase() + objFile->bssSize(); + + // Set up region for mmaps. Start it 1GB above the top of the heap. + mmap_end = brk_point + 0x40000000L; +} + +void +RiscvLiveProcess::initState() +{ + LiveProcess::initState(); + + argsInit(PageBytes); +} + +template void +RiscvLiveProcess::argsInit(int pageSize) +{ + updateBias(); + + // load object file into target memory + objFile->loadSections(initVirtMem); + + typedef AuxVector auxv_t; + vector auxv; + ElfObject * elfObject = dynamic_cast(objFile); + if (elfObject) { + // Set the system page size + auxv.push_back(auxv_t(M5_AT_PAGESZ, RiscvISA::PageBytes)); + // Set the frequency at which time() increments + auxv.push_back(auxv_t(M5_AT_CLKTCK, 100)); + // For statically linked executables, this is the virtual + // address of the program header tables if they appear in the + // executable image. + auxv.push_back(auxv_t(M5_AT_PHDR, elfObject->programHeaderTable())); + DPRINTF(Loader, "auxv at PHDR %08p\n", + elfObject->programHeaderTable()); + // This is the size of a program header entry from the elf file. + auxv.push_back(auxv_t(M5_AT_PHENT, elfObject->programHeaderSize())); + // This is the number of program headers from the original elf file. + auxv.push_back(auxv_t(M5_AT_PHNUM, elfObject->programHeaderCount())); + auxv.push_back(auxv_t(M5_AT_BASE, getBias())); + //The entry point to the program + auxv.push_back(auxv_t(M5_AT_ENTRY, objFile->entryPoint())); + //Different user and group IDs + auxv.push_back(auxv_t(M5_AT_UID, uid())); + auxv.push_back(auxv_t(M5_AT_EUID, euid())); + auxv.push_back(auxv_t(M5_AT_GID, gid())); + auxv.push_back(auxv_t(M5_AT_EGID, egid())); + } + + const IntType zero = 0; + IntType argc = htog((IntType)argv.size()); + int argv_array_size = sizeof(Addr)*argv.size(); + int arg_data_size = 0; + for (string arg: argv) + arg_data_size += arg.size() + 1; + int envp_array_size = sizeof(Addr)*envp.size(); + int env_data_size = 0; + for (string env: envp) + env_data_size += env.size() + 1; + int auxv_array_size = 2*sizeof(IntType)*auxv.size(); + + stack_size = sizeof(IntType) + argv_array_size + 2*sizeof(Addr) + + arg_data_size + + (envp.empty() ? 0 + : (2*sizeof(Addr) + envp_array_size + 2*sizeof(Addr) + + env_data_size)) + + (auxv.empty() ? 0 : (2*sizeof(Addr) + auxv_array_size)) + + 2*sizeof(Addr); + stack_min = roundDown(stack_base - stack_size, pageSize); + allocateMem(stack_min, roundUp(stack_size, pageSize)); + + Addr argv_array_base = stack_min + sizeof(IntType); + Addr arg_data_base = argv_array_base + argv_array_size + 2*sizeof(Addr); + Addr envp_array_base = arg_data_base + arg_data_size + + (envp.empty() ? 0 : 2*sizeof(Addr)); + Addr env_data_base = envp_array_base + envp_array_size + + (envp.empty() ? 0 : 2*sizeof(Addr)); + + vector arg_pointers; + if (!argv.empty()) { + arg_pointers.push_back(arg_data_base); + for (vector::size_type i = 0; i < argv.size() - 1; i++) { + arg_pointers.push_back(arg_pointers[i] + argv[i].size() + 1); + } + } + + vector env_pointers; + if (!envp.empty()) { + env_pointers.push_back(env_data_base); + for (vector::size_type i = 0; i < envp.size() - 1; i++) { + env_pointers.push_back(env_pointers[i] + envp[i].size() + 1); + } + } + + Addr sp = stack_min; + initVirtMem.writeBlob(sp, (uint8_t*)&argc, sizeof(IntType)); + sp += sizeof(IntType); + for (Addr arg_pointer: arg_pointers) { + initVirtMem.writeBlob(sp, (uint8_t*)&arg_pointer, sizeof(Addr)); + sp += sizeof(Addr); + } + for (int i = 0; i < 2; i++) { + initVirtMem.writeBlob(sp, (uint8_t*)&zero, sizeof(Addr)); + sp += sizeof(Addr); + } + for (vector::size_type i = 0; i < argv.size(); i++) { + initVirtMem.writeString(sp, argv[i].c_str()); + sp += argv[i].size() + 1; + } + if (!envp.empty()) { + for (int i = 0; i < 2; i++) { + initVirtMem.writeBlob(sp, (uint8_t*)&zero, sizeof(Addr)); + sp += sizeof(Addr); + } + } + for (Addr env_pointer: env_pointers) + initVirtMem.writeBlob(sp, (uint8_t*)&env_pointer, sizeof(Addr)); + if (!envp.empty()) { + for (int i = 0; i < 2; i++) { + initVirtMem.writeBlob(sp, (uint8_t*)&zero, sizeof(Addr)); + sp += sizeof(Addr); + } + } + for (vector::size_type i = 0; i < envp.size(); i++) { + initVirtMem.writeString(sp, envp[i].c_str()); + sp += envp[i].size() + 1; + } + if (!auxv.empty()) { + for (int i = 0; i < 2; i++) { + initVirtMem.writeBlob(sp, (uint8_t*)&zero, sizeof(Addr)); + sp += sizeof(Addr); + } + } + for (auxv_t aux: auxv) { + initVirtMem.writeBlob(sp, (uint8_t*)&aux.a_type, sizeof(IntType)); + initVirtMem.writeBlob(sp + sizeof(IntType), + (uint8_t*)&aux.a_val, sizeof(IntType)); + sp += 2*sizeof(IntType); + } + for (int i = 0; i < 2; i++) { + initVirtMem.writeBlob(sp, (uint8_t*)&zero, sizeof(Addr)); + sp += sizeof(Addr); + } + + ThreadContext *tc = system->getThreadContext(contextIds[0]); + tc->setIntReg(StackPointerReg, stack_min); + tc->pcState(getStartPC()); +} + +RiscvISA::IntReg +RiscvLiveProcess::getSyscallArg(ThreadContext *tc, int &i) +{ + return tc->readIntReg(SyscallArgumentRegs[i++]); +} + +void +RiscvLiveProcess::setSyscallArg(ThreadContext *tc, + int i, RiscvISA::IntReg val) +{ + tc->setIntReg(SyscallArgumentRegs[i], val); +} + +void +RiscvLiveProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret) +{ + if (sysret.successful()) { + // no error + tc->setIntReg(SyscallPseudoReturnReg, sysret.returnValue()); + } else { + // got an error, return details + tc->setIntReg(SyscallPseudoReturnReg, sysret.errnoValue()); + } +} diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/pseudo_inst.hh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/pseudo_inst.hh Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2014 Advanced Micro Devices, Inc. + * Copyright (c) 2015 Sven Karlsson + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Alexandru Dutu + * Sven Karlsson + */ + +#ifndef __ARCH_RISCV_PSEUDO_INST_HH__ +#define __ARCH_RISCV_PSEUDO_INST_HH__ + +#include "arch/generic/pseudo_inst.hh" +#include "base/misc.hh" + +class ThreadContext; + +namespace RiscvISA +{ + +using GenericISA::m5Syscall; +using GenericISA::m5PageFault; + +} + +#endif // __ARCH_RISCV_PSEUDO_INST_HH__ + diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/registers.hh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/registers.hh Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,181 @@ +/* + * Copyright (c) 2013 ARM Limited + * Copyright (c) 2014 - 2015 Sven Karlsson + * All rights reserved + * + * The license below extends only to copyright in the software and shall + * not be construed as granting a license to any other intellectual + * property including but not limited to intellectual property relating + * to a hardware implementation of the functionality of the software + * licensed hereunder. You may use the software subject to the license + * terms below provided that you ensure that this notice is replicated + * unmodified and in its entirety in all distributions of the software, + * modified or unmodified, in source code or in binary form. + * + * Copyright (c) 2016 The University of Virginia + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Andreas Hansson + * Sven Karlsson + * Alec Roelke + */ + +#ifndef __ARCH_RISCV_REGISTERS_HH__ +#define __ARCH_RISCV_REGISTERS_HH__ + +#include +#include + +#include "arch/riscv/generated/max_inst_regs.hh" +#include "base/types.hh" + +namespace RiscvISA { + +using RiscvISAInst::MaxInstSrcRegs; +using RiscvISAInst::MaxInstDestRegs; +const int MaxMiscDestRegs = 1; + +typedef uint_fast16_t RegIndex; +typedef uint64_t IntReg; +typedef uint64_t FloatRegBits; +typedef double FloatReg; +typedef uint8_t CCReg; // Not applicable to Riscv +typedef uint64_t MiscReg; + +const int NumIntArchRegs = 32; +const int NumMicroIntRegs = 1; +const int NumIntRegs = NumIntArchRegs + NumMicroIntRegs; +const int NumFloatRegs = 0; +const int NumCCRegs = 0; +const int NumMiscRegs = 4096; + +// These help enumerate all the registers for dependence tracking. +const int FP_Reg_Base = NumIntRegs; +const int CC_Reg_Base = FP_Reg_Base + NumFloatRegs; +const int Misc_Reg_Base = CC_Reg_Base + NumCCRegs; +const int Max_Reg_Index = Misc_Reg_Base + NumMiscRegs; + + +// Semantically meaningful register indices +const int ZeroReg = 0; +const int ReturnAddrReg = 1; +const int StackPointerReg = 2; +const int GlobalPointerReg = 3; +const int ThreadPointerReg = 4; +const int FramePointerReg = 8; +const int ReturnValueRegs[] = {10, 11}; +const int ReturnValueReg = ReturnValueRegs[0]; +const int ArgumentRegs[] = {10, 11, 12, 13, 14, 15, 16, 17}; +const int AMOTempReg = 32; + +const char* const RegisterNames[] = {"zero", "ra", "sp", "gp", + "tp", "t0", "t1", "t2", + "s0", "s1", "a0", "a1", + "a2", "a3", "a4", "a5", + "a6", "a7", "s2", "s3", + "s4", "s5", "s6", "s7", + "s8", "s9", "s10", "s11", + "t3", "t4", "t5", "t6"}; + +const int SyscallNumReg = ArgumentRegs[7]; +const int SyscallArgumentRegs[] = {ArgumentRegs[0], ArgumentRegs[1], + ArgumentRegs[2], ArgumentRegs[3]}; +const int SyscallPseudoReturnReg = ReturnValueRegs[0]; + +enum MiscRegIndex { + MISCREG_FFLAGS = 0x001, + MISCREG_FRM = 0x002, + MISCREG_FCSR = 0x003, + MISCREG_CYCLE = 0xC00, + MISCREG_TIME = 0xC01, + MISCREG_INSTRET = 0xC02, + MISCREG_CYCLEH = 0xC80, + MISCREG_TIMEH = 0xC81, + MISCREG_INSTRETH = 0xC82, + + MISCREG_SSTATUS = 0x100, + MISCREG_STVEC = 0x101, + MISCREG_SIE = 0x104, + MISCREG_STIMECMP = 0x121, + MISCREG_STIME = 0xD01, + MISCREG_STIMEH = 0xD81, + MISCREG_SSCRATCH = 0x140, + MISCREG_SEPC = 0x141, + MISCREG_SCAUSE = 0xD42, + MISCREG_SBADADDR = 0xD43, + MISCREG_SIP = 0x144, + MISCREG_SPTBR = 0x180, + MISCREG_SASID = 0x181, + MISCREG_CYCLEW = 0x900, + MISCREG_TIMEW = 0x901, + MISCREG_INSTRETW = 0x902, + MISCREG_CYCLEHW = 0x980, + MISCREG_TIMEHW = 0x981, + MISCREG_INSTRETHW = 0x982, + + MISCREG_HSTATUS = 0x200, + MISCREG_HTVEC = 0x201, + MISCREG_HTDELEG = 0x202, + MISCREG_HTIMECMP = 0x221, + MISCREG_HTIME = 0xE01, + MISCREG_HTIMEH = 0xE81, + MISCREG_HSCRATCH = 0x240, + MISCREG_HEPC = 0x241, + MISCREG_HCAUSE = 0x242, + MISCREG_HBADADDR = 0x243, + MISCREG_STIMEW = 0xA01, + MISCREG_STIMEHW = 0xA81, + + MISCREG_MCPUID = 0xF00, + MISCREG_MIMPID = 0xF01, + MISCREG_MHARTID = 0xF10, + MISCREG_MSTATUS = 0x300, + MISCREG_MTVEC = 0x301, + MISCREG_MTDELEG = 0x302, + MISCREG_MIE = 0x304, + MISCREG_MTIMECMP = 0x321, + MISCREG_MTIME = 0x701, + MISCREG_MTIMEH = 0x741, + MISCREG_MSCRATCH = 0x340, + MISCREG_MEPC = 0x341, + MISCREG_MCAUSE = 0x342, + MISCREG_MBADADDR = 0x343, + MISCREG_MIP = 0x344, + MISCREG_MBASE = 0x380, + MISCREG_MBOUND = 0x381, + MISCREG_MIBASE = 0x382, + MISCREG_MIBOUND = 0x383, + MISCREG_MDBASE = 0x384, + MISCREG_MDBOUND = 0x385, + MISCREG_HTIMEW = 0xB01, + MISCREG_HTIMEHW = 0xB81, + MISCREG_MTOHOST = 0x780, + MISCREG_MFROMHOST = 0x781 +}; + +} + +#endif // __ARCH_RISCV_REGISTERS_HH__ diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/remote_gdb.hh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/remote_gdb.hh Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2002-2005 The Regents of The University of Michigan + * Copyright (c) 2007-2008 The Florida State University + * Copyright (c) 2009 The University of Edinburgh + * Copyright (c) 2015 Sven Karlsson + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Nathan Binkert + * Stephen Hines + * Timothy M. Jones + * Sven Karlsson + */ + +#ifndef __ARCH_RISCV_REMOTE_GDB_HH__ +#define __ARCH_RISCV_REMOTE_GDB_HH__ + +#include "base/remote_gdb.hh" + +class System; +class ThreadContext; + +namespace RiscvISA +{ + +class RemoteGDB : public BaseRemoteGDB +{ + public: + RemoteGDB(System *system, ThreadContext *context); + + BaseGdbRegCache * + gdbRegs(); + + bool + acc(Addr, size_t); + + void + getregs(); + + void + setregs(); +}; + +} // namespace RiscvISA + +#endif /* __ARCH_RISCV_REMOTE_GDB_H__ */ diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/remote_gdb.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/remote_gdb.cc Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2002-2005 The Regents of The University of Michigan + * Copyright (c) 2007-2008 The Florida State University + * Copyright (c) 2009 The University of Edinburgh + * Copyright (c) 2015 Sven Karlsson + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Nathan Binkert + * Stephen Hines + * Timothy M. Jones + * Sven Karlsson + */ + + #include "base/remote_gdb.hh" + #include "arch/riscv/remote_gdb.hh" + #include "sim/system.hh" + +using namespace std; +using namespace RiscvISA; + +RemoteGDB::RemoteGDB(System *system, ThreadContext *context) + : BaseRemoteGDB(system, context) +{ +} + +RemoteGDB::BaseGdbRegCache* +RemoteGDB::gdbRegs() +{ + panic("gdbRegs not implemented for Riscv!"); +} + +bool +RemoteGDB::acc(Addr, size_t) +{ + panic("acc not implemented for Riscv!"); +} + +void +RemoteGDB::getregs() +{ + panic("getregs not implemented for Riscv!"); +} + +void +RemoteGDB::setregs() +{ + panic("setregs not implemented for Riscv!"); +} diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/stacktrace.hh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/stacktrace.hh Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2005 The Regents of The University of Michigan + * Copyright (c) 2007-2008 The Florida State University + * Copyright (c) 2009 The University of Edinburgh + * Copyright (c) 2014 - 2015 Sven Karlsson + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Ali Saidi + * Stephen Hines + * Timothy M. Jones + * Sven Karlsson + */ + +#ifndef __ARCH_RISCV_STACKTRACE_HH__ +#define __ARCH_RISCV_STACKTRACE_HH__ + +#include "base/trace.hh" +#include "cpu/static_inst.hh" +#include "debug/Stack.hh" + +class ThreadContext; +class StackTrace; + +namespace RiscvISA +{ + +class ProcessInfo +{ + public: + ProcessInfo(ThreadContext *_tc); + + Addr task(Addr ksp) const; + int pid(Addr ksp) const; + std::string name(Addr ksp) const; +}; + +class StackTrace +{ + protected: + typedef TheISA::MachInst MachInst; + private: + ThreadContext *tc; + std::vector stack; + + private: + bool isEntry(Addr addr); + bool decodePrologue(Addr sp, Addr callpc, Addr func, int &size, Addr &ra); + bool decodeSave(MachInst inst, int ®, int &disp); + bool decodeStack(MachInst inst, int &disp); + + void trace(ThreadContext *tc, bool is_call); + + public: + StackTrace(); + StackTrace(ThreadContext *tc, const StaticInstPtr &inst); + ~StackTrace(); + + void + clear() + { + tc = 0; + stack.clear(); + } + + bool + valid() const + { + return tc != NULL; + } + + bool trace(ThreadContext *tc, const StaticInstPtr &inst); + + public: + const std::vector & + getstack() const + { + return stack; + } + + static const int user = 1; + static const int console = 2; + static const int unknown = 3; + +#if TRACING_ON + private: + void dump(); + + public: + void + dprintf() + { + if (DTRACE(Stack)) + dump(); + } +#else + public: + void + dprintf() + { + } +#endif +}; + +inline bool +StackTrace::trace(ThreadContext *tc, const StaticInstPtr &inst) +{ + if (!inst->isCall() && !inst->isReturn()) + return false; + + if (valid()) + clear(); + + trace(tc, !inst->isReturn()); + return true; +} + +} // namespace RiscvISA + +#endif // __ARCH_RISCV_STACKTRACE_HH__ diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/stacktrace.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/stacktrace.cc Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2005 The Regents of The University of Michigan + * Copyright (c) 2015 Sven Karlsson + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Nathan Binkert + * Sven Karlsson + */ +#include "arch/riscv/stacktrace.hh" + +#include + +#include "base/trace.hh" + +using namespace std; + +namespace RiscvISA { + +ProcessInfo::ProcessInfo(ThreadContext *_tc) +{ + panic("ProcessInfo constructor not implemented.\n"); +} + +Addr +ProcessInfo::task(Addr ksp) const +{ + panic("ProcessInfo::task not implemented.\n"); + return 0; +} + +int +ProcessInfo::pid(Addr ksp) const +{ + panic("ProcessInfo::pid not implemented.\n"); + return 0; +} + +string +ProcessInfo::name(Addr ksp) const +{ + panic("ProcessInfo::name not implemented.\n"); + return ""; +} + +StackTrace::StackTrace() + : tc(0), stack(64) +{ + panic("StackTrace constructor not implemented.\n"); +} + +StackTrace::StackTrace(ThreadContext *_tc, const StaticInstPtr &inst) + : tc(0), stack(64) +{ + panic("StackTrace constructor not implemented.\n"); +} + +StackTrace::~StackTrace() +{ + panic("StackTrace destructor not implemented.\n"); +} + +void +StackTrace::trace(ThreadContext *_tc, bool is_call) +{ + panic("StackTrace::trace not implemented.\n"); +} + +bool +StackTrace::isEntry(Addr addr) +{ + panic("StackTrace::isEntry not implemented.\n"); + return false; +} + +bool +StackTrace::decodeStack(MachInst inst, int &disp) +{ + panic("StackTrace::decodeStack not implemented.\n"); + return false; +} + +bool +StackTrace::decodeSave(MachInst inst, int ®, int &disp) +{ + panic("StackTrace::decodeSave not implemented.\n"); + return true; +} + +/* + * Decode the function prologue for the function we're in, and note + * which registers are stored where, and how large the stack frame is. + */ +bool +StackTrace::decodePrologue(Addr sp, Addr callpc, Addr func, int &size, + Addr &ra) +{ + panic("StackTrace::decodePrologue not implemented.\n"); + return true; +} + +#if TRACING_ON +void +StackTrace::dump() +{ + panic("StackTrace::dump not implemented.\n"); +} +#endif + +} // namespace RiscvISA diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/system.hh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/system.hh Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2002-2005 The Regents of The University of Michigan + * Copyright (c) 2007 MIPS Technologies, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Ali Saidi + * Nathan Binkert + * Jaidev Patwardhan + */ + +#ifndef __ARCH_RISCV_SYSTEM_HH__ +#define __ARCH_RISCV_SYSTEM_HH__ + +#include +#include + +#include "base/loader/hex_file.hh" +#include "base/loader/symtab.hh" +#include "cpu/pc_event.hh" +#include "kern/system_events.hh" +#include "params/RiscvSystem.hh" +#include "sim/sim_object.hh" +#include "sim/system.hh" + +class RiscvSystem : public System +{ + public: + typedef RiscvSystemParams Params; + RiscvSystem(Params *p); + ~RiscvSystem(); + + virtual bool breakpoint(); + + public: + + /** + * Set the m5RiscvAccess pointer in the console + */ + void setRiscvAccess(Addr access); + + /** console symbol table */ + SymbolTable *consoleSymtab; + + /** Object pointer for the console code */ + ObjectFile *console; + + /** Used by some Bare Iron Configurations */ + HexFile *hexFile; + +#ifndef NDEBUG + /** Event to halt the simulator if the console calls panic() */ + BreakPCEvent *consolePanicEvent; +#endif + + protected: + const Params *params() const { return (const Params *)_params; } + + /** Add a function-based event to the console code. */ + template + T * + addConsoleFuncEvent(const char *lbl) + { + return addFuncEvent(consoleSymtab, lbl); + } + + virtual Addr fixFuncEventAddr(Addr addr); + +}; + +#endif + diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/system.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/system.cc Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2002-2005 The Regents of The University of Michigan + * Copyright (c) 2007 MIPS Technologies, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Ali Saidi + * Nathan Binkert + * Jaidev Patwardhan + */ + +#include "arch/riscv/system.hh" + +#include "arch/vtophys.hh" +#include "base/loader/hex_file.hh" +#include "base/loader/object_file.hh" +#include "base/loader/symtab.hh" +#include "base/trace.hh" +#include "mem/physical.hh" +#include "params/RiscvSystem.hh" +#include "sim/byteswap.hh" + +using namespace LittleEndianGuest; + +RiscvSystem::RiscvSystem(Params *p) : System(p) +{ +} + +RiscvSystem::~RiscvSystem() +{ +} + +Addr +RiscvSystem::fixFuncEventAddr(Addr addr) +{ + return addr; +} + +void +RiscvSystem::setRiscvAccess(Addr access) +{} + +bool +RiscvSystem::breakpoint() +{ + return 0; +} + +RiscvSystem * +RiscvSystemParams::create() +{ + return new RiscvSystem(this); +} + diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/tlb.hh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/tlb.hh Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2001-2005 The Regents of The University of Michigan + * Copyright (c) 2007 MIPS Technologies, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Nathan Binkert + * Steve Reinhardt + * Jaidev Patwardhan + * Korey Sewell + */ + +#ifndef __ARCH_RISCV_TLB_HH__ +#define __ARCH_RISCV_TLB_HH__ + +#include + +#include "arch/generic/tlb.hh" +#include "arch/riscv/isa_traits.hh" +#include "arch/riscv/pagetable.hh" +#include "arch/riscv/utility.hh" +#include "arch/riscv/vtophys.hh" +#include "base/statistics.hh" +#include "mem/request.hh" +#include "params/RiscvTLB.hh" +#include "sim/sim_object.hh" + +class ThreadContext; + +/* RISC-V does not distinguish between a DTLB and an ITLB -> unified TLB + However, to maintain compatibility with other architectures, we'll + simply create an ITLB and DTLB that will point to the real TLB */ +namespace RiscvISA { + +class TLB : public BaseTLB +{ + protected: + typedef std::multimap PageTable; + PageTable lookupTable; // Quick lookup into page table + + RiscvISA::PTE *table; // the Page Table + int size; // TLB Size + int nlu; // not last used entry (for replacement) + + void nextnlu() { if (++nlu >= size) nlu = 0; } + RiscvISA::PTE *lookup(Addr vpn, uint8_t asn) const; + + mutable Stats::Scalar read_hits; + mutable Stats::Scalar read_misses; + mutable Stats::Scalar read_acv; + mutable Stats::Scalar read_accesses; + mutable Stats::Scalar write_hits; + mutable Stats::Scalar write_misses; + mutable Stats::Scalar write_acv; + mutable Stats::Scalar write_accesses; + Stats::Formula hits; + Stats::Formula misses; + Stats::Formula accesses; + + public: + typedef RiscvTLBParams Params; + TLB(const Params *p); + + int probeEntry(Addr vpn,uint8_t) const; + RiscvISA::PTE *getEntry(unsigned) const; + virtual ~TLB(); + + void takeOverFrom(BaseTLB *otlb) override {} + + int smallPages; + int getsize() const { return size; } + + RiscvISA::PTE &index(bool advance = true); + void insert(Addr vaddr, RiscvISA::PTE &pte); + void insertAt(RiscvISA::PTE &pte, unsigned Index, int _smallPages); + void flushAll() override; + void demapPage(Addr vaddr, uint64_t asn) override + { + panic("demapPage unimplemented.\n"); + } + + // static helper functions... really + static bool validVirtualAddress(Addr vaddr); + + static Fault checkCacheability(RequestPtr &req); + + // Checkpointing + void serialize(CheckpointOut &cp) const override; + void unserialize(CheckpointIn &cp) override; + + void regStats() override; + + Fault translateAtomic(RequestPtr req, ThreadContext *tc, Mode mode); + void translateTiming(RequestPtr req, ThreadContext *tc, + Translation *translation, Mode mode); + + /** + * Function stub for CheckerCPU compilation issues. RISC-V does not + * support the Checker model at the moment. + */ + Fault translateFunctional(RequestPtr req, ThreadContext *tc, Mode mode); + Fault finalizePhysical(RequestPtr req, ThreadContext *tc, Mode mode) const; + + private: + Fault translateInst(RequestPtr req, ThreadContext *tc); + Fault translateData(RequestPtr req, ThreadContext *tc, bool write); +}; + +} + +#endif // __RISCV_MEMORY_HH__ diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/tlb.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/tlb.cc Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,360 @@ +/* + * Copyright (c) 2001-2005 The Regents of The University of Michigan + * Copyright (c) 2007 MIPS Technologies, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Nathan Binkert + * Steve Reinhardt + * Jaidev Patwardhan + * Zhengxing Li + * Deyuan Guo + */ +#include "arch/riscv/tlb.hh" + +#include +#include + +#include "arch/riscv/faults.hh" +#include "arch/riscv/pagetable.hh" +#include "arch/riscv/pra_constants.hh" +#include "arch/riscv/utility.hh" +#include "base/inifile.hh" +#include "base/str.hh" +#include "base/trace.hh" +#include "cpu/thread_context.hh" +#include "debug/RiscvTLB.hh" +#include "debug/TLB.hh" +#include "mem/page_table.hh" +#include "params/RiscvTLB.hh" +#include "sim/full_system.hh" +#include "sim/process.hh" + +using namespace std; +using namespace RiscvISA; + +/////////////////////////////////////////////////////////////////////// +// +// RISC-V TLB +// + +TLB::TLB(const Params *p) + : BaseTLB(p), size(p->size), nlu(0) +{ + table = new PTE[size]; + memset(table, 0, sizeof(PTE[size])); + smallPages = 0; +} + +TLB::~TLB() +{ + if (table) + delete [] table; +} + +// look up an entry in the TLB +RiscvISA::PTE * +TLB::lookup(Addr vpn, uint8_t asn) const +{ + // assume not found... + PTE *retval = NULL; + PageTable::const_iterator i = lookupTable.find(vpn); + if (i != lookupTable.end()) { + while (i->first == vpn) { + int index = i->second; + PTE *pte = &table[index]; + + /* 1KB TLB Lookup code - from MIPS ARM Volume III - Rev. 2.50 */ + Addr Mask = pte->Mask; + Addr InvMask = ~Mask; + Addr VPN = pte->VPN; + if (((vpn & InvMask) == (VPN & InvMask)) && + (pte->G || (asn == pte->asid))) { + // We have a VPN + ASID Match + retval = pte; + break; + } + ++i; + } + } + + DPRINTF(TLB, "lookup %#x, asn %#x -> %s ppn %#x\n", vpn, (int)asn, + retval ? "hit" : "miss", retval ? retval->PFN1 : 0); + return retval; +} + +RiscvISA::PTE* +TLB::getEntry(unsigned Index) const +{ + // Make sure that Index is valid + assert(Indexfirst == vpn) { + int index = i->second; + PTE *pte = &table[index]; + + /* 1KB TLB Lookup code - from MIPS ARM Volume III - Rev. 2.50 */ + Addr Mask = pte->Mask; + Addr InvMask = ~Mask; + Addr VPN = pte->VPN; + if (((vpn & InvMask) == (VPN & InvMask)) && + (pte->G || (asn == pte->asid))) { + // We have a VPN + ASID Match + Ind = index; + break; + } + ++i; + } + } + DPRINTF(RiscvTLB,"VPN: %x, asid: %d, Result of TLBP: %d\n",vpn,asn,Ind); + return Ind; +} + +inline Fault +TLB::checkCacheability(RequestPtr &req) +{ + Addr VAddrUncacheable = 0xA0000000; + // In RISC-V, cacheability is controlled by certain bits of the virtual + // address or by the TLB entry + if ((req->getVaddr() & VAddrUncacheable) == VAddrUncacheable) { + // mark request as uncacheable + req->setFlags(Request::UNCACHEABLE | Request::STRICT_ORDER); + } + return NoFault; +} + +void +TLB::insertAt(PTE &pte, unsigned Index, int _smallPages) +{ + smallPages = _smallPages; + if (Index > size) { + warn("Attempted to write at index (%d) beyond TLB size (%d)", + Index, size); + } else { + // Update TLB + DPRINTF(TLB, "TLB[%d]: %x %x %x %x\n", + Index, pte.Mask << 11, + ((pte.VPN << 11) | pte.asid), + ((pte.PFN0 << 6) | (pte.C0 << 3) | + (pte.D0 << 2) | (pte.V0 <<1) | pte.G), + ((pte.PFN1 <<6) | (pte.C1 << 3) | + (pte.D1 << 2) | (pte.V1 <<1) | pte.G)); + if (table[Index].V0 || table[Index].V1) { + // Previous entry is valid + PageTable::iterator i = lookupTable.find(table[Index].VPN); + lookupTable.erase(i); + } + table[Index]=pte; + // Update fast lookup table + lookupTable.insert(make_pair(table[Index].VPN, Index)); + } +} + +// insert a new TLB entry +void +TLB::insert(Addr addr, PTE &pte) +{ + fatal("TLB Insert not yet implemented\n"); +} + +void +TLB::flushAll() +{ + DPRINTF(TLB, "flushAll\n"); + memset(table, 0, sizeof(PTE[size])); + lookupTable.clear(); + nlu = 0; +} + +void +TLB::serialize(CheckpointOut &cp) const +{ + SERIALIZE_SCALAR(size); + SERIALIZE_SCALAR(nlu); + + for (int i = 0; i < size; i++) { + ScopedCheckpointSection sec(cp, csprintf("PTE%d", i)); + table[i].serialize(cp); + } +} + +void +TLB::unserialize(CheckpointIn &cp) +{ + UNSERIALIZE_SCALAR(size); + UNSERIALIZE_SCALAR(nlu); + + for (int i = 0; i < size; i++) { + ScopedCheckpointSection sec(cp, csprintf("PTE%d", i)); + table[i].unserialize(cp); + if (table[i].V0 || table[i].V1) { + lookupTable.insert(make_pair(table[i].VPN, i)); + } + } +} + +void +TLB::regStats() +{ + BaseTLB::regStats(); + + read_hits + .name(name() + ".read_hits") + .desc("DTB read hits") + ; + + read_misses + .name(name() + ".read_misses") + .desc("DTB read misses") + ; + + + read_accesses + .name(name() + ".read_accesses") + .desc("DTB read accesses") + ; + + write_hits + .name(name() + ".write_hits") + .desc("DTB write hits") + ; + + write_misses + .name(name() + ".write_misses") + .desc("DTB write misses") + ; + + + write_accesses + .name(name() + ".write_accesses") + .desc("DTB write accesses") + ; + + hits + .name(name() + ".hits") + .desc("DTB hits") + ; + + misses + .name(name() + ".misses") + .desc("DTB misses") + ; + + accesses + .name(name() + ".accesses") + .desc("DTB accesses") + ; + + hits = read_hits + write_hits; + misses = read_misses + write_misses; + accesses = read_accesses + write_accesses; +} + +Fault +TLB::translateInst(RequestPtr req, ThreadContext *tc) +{ + if (FullSystem) + panic("translateInst not implemented in RISC-V.\n"); + + Process * p = tc->getProcessPtr(); + + Fault fault = p->pTable->translate(req); + if (fault != NoFault) + return fault; + + return NoFault; +} + +Fault +TLB::translateData(RequestPtr req, ThreadContext *tc, bool write) +{ + if (FullSystem) + panic("translateData not implemented in RISC-V.\n"); + + Process * p = tc->getProcessPtr(); + + Fault fault = p->pTable->translate(req); + if (fault != NoFault) + return fault; + + return NoFault; +} + +Fault +TLB::translateAtomic(RequestPtr req, ThreadContext *tc, Mode mode) +{ + if (mode == Execute) + return translateInst(req, tc); + else + return translateData(req, tc, mode == Write); +} + +void +TLB::translateTiming(RequestPtr req, ThreadContext *tc, + Translation *translation, Mode mode) +{ + assert(translation); + translation->finish(translateAtomic(req, tc, mode), req, tc, mode); +} + +Fault +TLB::translateFunctional(RequestPtr req, ThreadContext *tc, Mode mode) +{ + panic("Not implemented\n"); + return NoFault; +} + +Fault +TLB::finalizePhysical(RequestPtr req, ThreadContext *tc, Mode mode) const +{ + return NoFault; +} + + +RiscvISA::PTE & +TLB::index(bool advance) +{ + PTE *pte = &table[nlu]; + + if (advance) + nextnlu(); + + return *pte; +} + +RiscvISA::TLB * +RiscvTLBParams::create() +{ + return new TLB(this); +} diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/types.hh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/types.hh Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2013 ARM Limited + * Copyright (c) 2014 Sven Karlsson + * All rights reserved + * + * The license below extends only to copyright in the software and shall + * not be construed as granting a license to any other intellectual + * property including but not limited to intellectual property relating + * to a hardware implementation of the functionality of the software + * licensed hereunder. You may use the software subject to the license + * terms below provided that you ensure that this notice is replicated + * unmodified and in its entirety in all distributions of the software, + * modified or unmodified, in source code or in binary form. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Andreas Hansson + * Sven Karlsson + */ + +#ifndef __ARCH_RISCV_TYPES_HH__ +#define __ARCH_RISCV_TYPES_HH__ + +#include "arch/generic/types.hh" + +namespace RiscvISA +{ +typedef uint32_t MachInst; +typedef uint64_t ExtMachInst; + +typedef GenericISA::SimplePCState PCState; +} + + +#endif // __ARCH_RISCV_TYPES_HH__ diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/utility.hh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/utility.hh Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2013 ARM Limited + * Copyright (c) 2014 - 2015 Sven Karlsson + * All rights reserved + * + * The license below extends only to copyright in the software and shall + * not be construed as granting a license to any other intellectual + * property including but not limited to intellectual property relating + * to a hardware implementation of the functionality of the software + * licensed hereunder. You may use the software subject to the license + * terms below provided that you ensure that this notice is replicated + * unmodified and in its entirety in all distributions of the software, + * modified or unmodified, in source code or in binary form. + * + * Copyright (c) 2016 The University of Virginia + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Andreas Hansson + * Sven Karlsson + * Alec Roelke + */ + +#ifndef __ARCH_RISCV_UTILITY_HH__ +#define __ARCH_RISCV_UTILITY_HH__ + +#include +#include + +#include "base/types.hh" +#include "cpu/static_inst.hh" +#include "cpu/thread_context.hh" + +namespace RiscvISA +{ + +inline PCState +buildRetPC(const PCState &curPC, const PCState &callPC) +{ + PCState retPC = callPC; + retPC.advance(); + retPC.pc(curPC.npc()); + return retPC; +} + +inline uint64_t +getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp) +{ + return 0; +} + +inline void startupCPU(ThreadContext *tc, int cpuId) +{ +} + +inline void +copyRegs(ThreadContext *src, ThreadContext *dest) +{ + // First loop through the integer registers. + for (int i = 0; i < NumIntRegs; ++i) + dest->setIntReg(i, src->readIntReg(i)); + + // Lastly copy PC/NPC + dest->pcState(src->pcState()); +} + +inline void +skipFunction(ThreadContext *tc) +{ + panic("Not Implemented for Riscv"); +} + +inline void +advancePC(PCState &pc, const StaticInstPtr &inst) +{ + inst->advancePC(pc); +} + +static inline bool +inUserMode(ThreadContext *tc) +{ + return true; +} + +inline uint64_t +getExecutingAsid(ThreadContext *tc) +{ + return 0; +} + +inline void +initCPU(ThreadContext *, int cpuId) +{ + panic("initCPU not implemented for Riscv.\n"); +} + +} // namespace RiscvISA + +#endif // __ARCH_RISCV_UTILITY_HH__ diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/vtophys.hh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/vtophys.hh Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2002-2005 The Regents of The University of Michigan + * Copyright (c) 2007-2008 The Florida State University + * Copyright (c) 2009 The University of Edinburgh + * Copyright (c) 2014-2015 Sven Karlsson + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Ali Saidi + * Nathan Binkert + * Stephen Hines + * Timothy M. Jones + * Sven Karlsson + */ + +#ifndef __ARCH_RISCV_VTOPHYS_HH__ +#define __ARCH_RISCV_VTOPHYS_HH__ + +#include "arch/riscv/isa_traits.hh" +#include "arch/riscv/utility.hh" + +class ThreadContext; + +namespace RiscvISA { + +inline Addr +vtophys(Addr vaddr) +{ + fatal("VTOPHYS: Unimplemented on RISC-V\n"); + return vaddr; +} + +inline Addr +vtophys(ThreadContext *tc, Addr vaddr) +{ + fatal("VTOPHYS: Unimplemented on RISC-V\n"); + return vtophys(vaddr); +} + +} // namespace RiscvISA + +#endif // __ARCH_RISCV_VTOPHYS_HH__ + diff -r 8bc53d5565ba -r cceb2cc47bdd src/base/loader/elf_object.cc --- a/src/base/loader/elf_object.cc Tue Sep 06 10:22:38 2016 +0100 +++ b/src/base/loader/elf_object.cc Thu Sep 15 20:52:22 2016 +0000 @@ -111,6 +111,8 @@ } else if (ehdr.e_machine == EM_AARCH64 && ehdr.e_ident[EI_CLASS] == ELFCLASS64) { arch = Arm64; + } else if (ehdr.e_machine == EM_RISCV) { + arch = Riscv; } else if (ehdr.e_machine == EM_PPC && ehdr.e_ident[EI_CLASS] == ELFCLASS32) { arch = Power; diff -r 8bc53d5565ba -r cceb2cc47bdd src/base/loader/object_file.hh --- a/src/base/loader/object_file.hh Tue Sep 06 10:22:38 2016 +0100 +++ b/src/base/loader/object_file.hh Thu Sep 15 20:52:22 2016 +0000 @@ -56,7 +56,8 @@ Arm64, Arm, Thumb, - Power + Power, + Riscv }; enum OpSys { diff -r 8bc53d5565ba -r cceb2cc47bdd src/cpu/BaseCPU.py --- a/src/cpu/BaseCPU.py Tue Sep 06 10:22:38 2016 +0100 +++ b/src/cpu/BaseCPU.py Thu Sep 15 20:52:22 2016 +0000 @@ -85,6 +85,11 @@ from PowerInterrupts import PowerInterrupts from PowerISA import PowerISA isa_class = PowerISA +elif buildEnv['TARGET_ISA'] == 'riscv': + from RiscvTLB import RiscvTLB + from RiscvInterrupts import RiscvInterrupts + from RiscvISA import RiscvISA + isa_class = RiscvISA class BaseCPU(MemObject): type = 'BaseCPU' @@ -185,6 +190,12 @@ interrupts = VectorParam.PowerInterrupts( [], "Interrupt Controller") isa = VectorParam.PowerISA([ isa_class() ], "ISA instance") + elif buildEnv['TARGET_ISA'] == 'riscv': + dtb = Param.RiscvTLB(RiscvTLB(), "Data TLB") + itb = Param.RiscvTLB(RiscvTLB(), "Instruction TLB") + interrupts = VectorParam.RiscvInterrupts( + [], "Interrupt Controller") + isa = VectorParam.RiscvISA([ isa_class() ], "ISA instance") else: print "Don't know what TLB to use for ISA %s" % \ buildEnv['TARGET_ISA'] @@ -242,6 +253,8 @@ self.interrupts = [ArmInterrupts() for i in xrange(self.numThreads)] elif buildEnv['TARGET_ISA'] == 'power': self.interrupts = [PowerInterrupts() for i in xrange(self.numThreads)] + elif buildEnv['TARGET_ISA'] == 'riscv': + self.interrupts = [RiscvInterrupts() for i in xrange(self.numThreads)] else: print "Don't know what Interrupt Controller to use for ISA %s" % \ buildEnv['TARGET_ISA'] diff -r 8bc53d5565ba -r cceb2cc47bdd src/sim/process.cc --- a/src/sim/process.cc Tue Sep 06 10:22:38 2016 +0100 +++ b/src/sim/process.cc Thu Sep 15 20:52:22 2016 +0000 @@ -83,6 +83,8 @@ #include "arch/x86/linux/process.hh" #elif THE_ISA == POWER_ISA #include "arch/power/linux/process.hh" +#elif THE_ISA == RISCV_ISA +#include "arch/riscv/linux/process.hh" #else #error "THE_ISA not set" #endif @@ -709,6 +711,19 @@ default: fatal("Unknown/unsupported operating system."); } +#elif THE_ISA == RISCV_ISA + if (objFile->getArch() != ObjectFile::Riscv) + fatal("Object file architecture does not match compiled ISA (RISCV)."); + switch (objFile->getOpSys()) { + case ObjectFile::UnknownOpSys: + warn("Unknown operating system; assuming Linux."); + // fall through + case ObjectFile::Linux: + process = new RiscvLinuxProcess(params, objFile); + break; + default: + fatal("Unknown/unsupported operating system."); + } #else #error "THE_ISA not set" #endif diff -r 8bc53d5565ba -r cceb2cc47bdd tests/test-progs/hello/bin/riscv/linux/hello Binary file tests/test-progs/hello/bin/riscv/linux/hello has changed diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/isa/main.isa --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/isa/main.isa Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,63 @@ +// -*- mode:c++ -*- + +// Copyright (c) 2015 Riscv Developers +// Copyright (c) 2016 The University of Virginia +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer; +// redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution; +// neither the name of the copyright holders nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Authors: Maxwell Walter +// Alec Roelke + +//////////////////////////////////////////////////////////////////// +// +// RISCV ISA description file. +// +//////////////////////////////////////////////////////////////////// + +//Include the C++ include directives +##include "includes.isa" + +//////////////////////////////////////////////////////////////////// +// +// Namespace statement. Everything below this line will be in the +// RiscvISAInst namespace. +// + +namespace RiscvISA; + +//Include the bitfield definitions +##include "bitfields.isa" + +//Include the operand_types and operand definitions +##include "operands.isa" + +//Include the base class for riscv instructions, and some support code +##include "base.isa" + +//Include the definitions for the instruction formats +##include "formats/formats.isa" + +//Include the decoder definition +##include "decoder.isa" diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/isa/operands.isa --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/isa/operands.isa Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,56 @@ +// -*- mode:c++ -*- + +// Copyright (c) 2015 Riscv Developers +// Copyright (c) 2016 The University of Virginia +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer; +// redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution; +// neither the name of the copyright holders nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Authors: Maxwell Walter +// Alec Roelke + +def operand_types {{ + 'sb' : 'int8_t', + 'ub' : 'uint8_t', + 'sh' : 'int16_t', + 'uh' : 'uint16_t', + 'sw' : 'int32_t', + 'uw' : 'uint32_t', + 'sd' : 'int64_t', + 'ud' : 'uint64_t', +}}; + +def operands {{ +#General Purpose Integer Reg Operands + 'Rd': ('IntReg', 'ud', 'RD', 'IsInteger', 1), + 'Rs1': ('IntReg', 'ud', 'RS1', 'IsInteger', 2), + 'Rs2': ('IntReg', 'ud', 'RS2', 'IsInteger', 3), + +#Memory Operand + 'Mem': ('Mem', 'ud', None, ('IsMemRef', 'IsLoad', 'IsStore'), 5), + +#Program Counter Operands + 'PC': ('PCState', 'ud', 'pc', (None, None, 'IsControl'), 7), + 'NPC': ('PCState', 'ud', 'npc', (None, None, 'IsControl'), 8), +}}; diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/isa_traits.hh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/isa_traits.hh Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2013 ARM Limited + * Copyright (c) 2014 - 2015 Sven Karlsson + * All rights reserved + * + * The license below extends only to copyright in the software and shall + * not be construed as granting a license to any other intellectual + * property including but not limited to intellectual property relating + * to a hardware implementation of the functionality of the software + * licensed hereunder. You may use the software subject to the license + * terms below provided that you ensure that this notice is replicated + * unmodified and in its entirety in all distributions of the software, + * modified or unmodified, in source code or in binary form. + * + * Copyright (c) 2016 The University of Virginia + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Andreas Hansson + * Sven Karlsson + * Alec Roelke + */ + +#ifndef __ARCH_RISCV_ISA_TRAITS_HH__ +#define __ARCH_RISCV_ISA_TRAITS_HH__ + +#include "arch/riscv/types.hh" +#include "base/types.hh" +#include "cpu/static_inst_fwd.hh" + +namespace LittleEndianGuest {} + +namespace RiscvISA +{ + +using namespace LittleEndianGuest; + +// Riscv does NOT have a delay slot +#define ISA_HAS_DELAY_SLOT 0 + +const Addr PageShift = 12; +const Addr PageBytes = ULL(1) << PageShift; + +// Memory accesses can not be unaligned +const bool HasUnalignedMemAcc = true; + +const bool CurThreadInfoImplemented = false; +const int CurThreadInfoReg = -1; + +} + +#endif //__ARCH_RISCV_ISA_TRAITS_HH__ diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/kernel_stats.hh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/kernel_stats.hh Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2004-2005 The Regents of The University of Michigan + * Copyright (c) 2014-2015 Sven Karlsson + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Gabe Black + * Sven Karlsson + */ + +#ifndef __ARCH_RISCV_KERNEL_STATS_HH__ +#define __ARCH_RISCV_KERNEL_STATS_HH__ + +#include "kern/kernel_stats.hh" + +namespace RiscvISA { +namespace Kernel { + +enum cpu_mode { hypervisor, kernel, user, idle, cpu_mode_num }; +extern const char *modestr[]; + +class Statistics : public ::Kernel::Statistics +{ + public: + Statistics(System *system) : ::Kernel::Statistics(system) + {} +}; + +} // namespace RiscvISA::Kernel +} // namespace RiscvISA + +#endif // __ARCH_RISCV_KERNEL_STATS_HH__ diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/linux/linux.hh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/linux/linux.hh Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,199 @@ +/* + * Copyright (c) 2006 The Regents of The University of Michigan + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Korey Sewell + */ + +#ifndef __ARCH_RISCV_LINUX_LINUX_HH__ +#define __ARCH_RISCV_LINUX_LINUX_HH__ + +#include "kern/linux/linux.hh" + +class RiscvLinux : public Linux +{ + public: + + static const int TGT_SIGHUP = 0x000001; + static const int TGT_SIGINT = 0x000002; + static const int TGT_SIGQUIT = 0x000003; + static const int TGT_SIGILL = 0x000004; + static const int TGT_SIGTRAP = 0x000005; + static const int TGT_SIGIOT = 0x000006; + static const int TGT_SIGABRT = 0x000006; + static const int TGT_SIGEMT = 0x000007; + static const int TGT_SIGFPE = 0x000008; + static const int TGT_SIGKILL = 0x000009; + static const int TGT_SIGBUS = 0x00000a; + static const int TGT_SIGSEGV = 0x00000b; + static const int TGT_SIGSYS = 0x00000c; + static const int TGT_SIGPIPE = 0x00000d; + static const int TGT_SIGALRM = 0x00000e; + static const int TGT_SIGTERM = 0x00000f; + static const int TGT_SIGUSR1 = 0x000010; + static const int TGT_SIGUSR2 = 0x000011; + static const int TGT_SIGCHLD = 0x000012; + static const int TGT_SIGCLD = 0x000012; + static const int TGT_SIGPWR = 0x000013; + static const int TGT_SIGWINCH = 0x000014; + static const int TGT_SIGURG = 0x000015; + static const int TGT_SIGIO = 0x000016; + static const int TGT_SIGPOLL = 0x000016; + static const int TGT_SIGSTOP = 0x000017; + static const int TGT_SIGTSTP = 0x000018; + static const int TGT_SIGCONT = 0x000019; + static const int TGT_SIGTTIN = 0x00001a; + static const int TGT_SIGTTOU = 0x00001b; + static const int TGT_SIGVTALRM = 0x00001c; + static const int TGT_SIGPROF = 0x00001d; + static const int TGT_SIGXCPU = 0x00001e; + static const int TGT_SIGXFSZ = 0x00001f; + + /// This table maps the target open() flags to the corresponding + /// host open() flags. + static SyscallFlagTransTable openFlagTable[]; + + /// Number of entries in openFlagTable[]. + static const int NUM_OPEN_FLAGS; + + //@{ + /// open(2) flag values. + static const int TGT_O_RDONLY = 0x00000000; //!< O_RDONLY + static const int TGT_O_WRONLY = 0x00000001; //!< O_WRONLY + static const int TGT_O_RDWR = 0x00000002; //!< O_RDWR + static const int TGT_O_CREAT = 0x00000100; //!< O_CREAT + static const int TGT_O_EXCL = 0x00000400; //!< O_EXCL + static const int TGT_O_NOCTTY = 0x00000800; //!< O_NOCTTY + static const int TGT_O_TRUNC = 0x00000200; //!< O_TRUNC + static const int TGT_O_APPEND = 0x00000008; //!< O_APPEND + static const int TGT_O_NONBLOCK = 0x00000080; //!< O_NONBLOCK + static const int TGT_O_DSYNC = 0x00000010; //!< O_DSYNC + static const int TGT_FASYNC = 0x00001000; //!< O_FASYNC + static const int TGT_O_DIRECT = 0x00008000; //!< O_DIRECT + static const int TGT_O_LARGEFILE = 0x00002000; //!< O_LARGEFILE + static const int TGT_O_DIRECTORY = 0x00010000; //!< O_DIRECTORY + static const int TGT_O_NOFOLLOW = 0x00020000; //!< O_NOFOLLOW + static const int TGT_O_NOATIME = 0x00040000; //!< O_NOATIME + static const int TGT_O_CLOEXEC = 0x00080000; //!< O_CLOEXEC + static const int TGT_O_SYNC = 0x00004010; //!< O_SYNC + static const int TGT_O_PATH = 0x00200000; //!< O_PATH + //@} + + static const unsigned TGT_MAP_SHARED = 0x00001; + static const unsigned TGT_MAP_PRIVATE = 0x00002; + static const unsigned TGT_MAP_ANON = 0x00800; + static const unsigned TGT_MAP_DENYWRITE = 0x02000; + static const unsigned TGT_MAP_EXECUTABLE = 0x04000; + static const unsigned TGT_MAP_FILE = 0x00000; + static const unsigned TGT_MAP_GROWSDOWN = 0x01000; + static const unsigned TGT_MAP_HUGETLB = 0x80000; + static const unsigned TGT_MAP_LOCKED = 0x08000; + static const unsigned TGT_MAP_NONBLOCK = 0x20000; + static const unsigned TGT_MAP_NORESERVE = 0x00400; + static const unsigned TGT_MAP_POPULATE = 0x10000; + static const unsigned TGT_MAP_STACK = 0x40000; + static const unsigned TGT_MAP_ANONYMOUS = 0x00800; + static const unsigned TGT_MAP_FIXED = 0x00010; + + static const unsigned NUM_MMAP_FLAGS; + + //@{ + /// For getsysinfo(). + static const unsigned GSI_PLATFORM_NAME = 103; //!< platform name as string + static const unsigned GSI_CPU_INFO = 59; //!< CPU information + static const unsigned GSI_PROC_TYPE = 60; //!< get proc_type + static const unsigned GSI_MAX_CPU = 30; //!< max # cpu's on this machine + static const unsigned GSI_CPUS_IN_BOX = 55; //!< number of CPUs in system + static const unsigned GSI_PHYSMEM = 19; //!< Physical memory in KB + static const unsigned GSI_CLK_TCK = 42; //!< clock freq in Hz + //@} + + //@{ + /// For setsysinfo(). + static const unsigned SSI_IEEE_FP_CONTROL = 14; //!< ieee_set_fp_control() + //@} + + //@{ + /// ioctl() command codes. + static const unsigned TGT_TCGETA = 0x5401; + static const unsigned TGT_TCSETAW = 0x5403; + static const unsigned TGT_TCGETS = 0x540d; + static const unsigned TGT_FIONREAD = 0x467f; + static const unsigned TGT_TIOCGETP = 0x7408; + static const unsigned TGT_TIOCSETP = 0x7409; + static const unsigned TGT_TIOCSETN = 0x740a; + //@} + + static bool + isTtyReq(unsigned req) + { + switch (req) { + case TGT_TIOCGETP: + case TGT_TIOCSETP: + case TGT_TIOCSETN: + case TGT_FIONREAD: + case TGT_TCGETS: + case TGT_TCGETA: + case TGT_TCSETAW: + return true; + default: + return false; + } + } + + /// For table(). + static const int TBL_SYSINFO = 12; + + /// Resource constants for getrlimit() (overide some generics). + static const unsigned TGT_RLIMIT_NPROC = 8; + static const unsigned TGT_RLIMIT_AS = 6; + static const unsigned TGT_RLIMIT_RSS = 7; + static const unsigned TGT_RLIMIT_NOFILE = 5; + static const unsigned TGT_RLIMIT_MEMLOCK = 9; + + /// Offset used to make sure that processes don't + /// assign themselves to process IDs reserved for + /// the root users. + static const int NUM_ROOT_PROCS = 2; + + typedef struct { + int32_t uptime; /* Seconds since boot */ + uint32_t loads[3]; /* 1, 5, and 15 minute load averages */ + uint32_t totalram; /* Total usable main memory size */ + uint32_t freeram; /* Available memory size */ + uint32_t sharedram; /* Amount of shared memory */ + uint32_t bufferram; /* Memory used by buffers */ + uint32_t totalswap; /* Total swap space size */ + uint32_t freeswap; /* swap space still available */ + uint16_t procs; /* Number of current processes */ + uint32_t totalhigh; /* Total high memory size */ + uint32_t freehigh; /* Available high memory size */ + uint32_t mem_unit; /* Memory unit size in bytes */ + } tgt_sysinfo; + +}; + +#endif diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/linux/linux.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/linux/linux.cc Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2006 The Regents of The University of Michigan + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Korey Sewell + */ + +#include "arch/riscv/linux/linux.hh" + +#include +#include + +#define TARGET RiscvLinux +#include "kern/linux/flag_tables.hh" diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/linux/process.hh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/linux/process.hh Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2004 The Regents of The University of Michigan + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Gabe Black + * Korey Sewell + */ + +#ifndef __MIPS_LINUX_PROCESS_HH__ +#define __MIPS_LINUX_PROCESS_HH__ + +#include "arch/riscv/linux/linux.hh" +#include "arch/riscv/process.hh" +#include "sim/eventq.hh" + +/// A process with emulated Riscv/Linux syscalls. +class RiscvLinuxProcess : public RiscvLiveProcess +{ + public: + /// Constructor. + RiscvLinuxProcess(LiveProcessParams * params, ObjectFile *objFile); + + virtual SyscallDesc* getDesc(int callnum); + + /// The target system's hostname. + static const char *hostname; + + /// ID of the thread group leader for the process + uint64_t __tgid; + + /// Array of syscall descriptors, indexed by call number. + static SyscallDesc syscallDescs[]; + const int Num_Syscall_Descs; +}; + +#endif // __MIPS_LINUX_PROCESS_HH__ diff -r 8bc53d5565ba -r cceb2cc47bdd build_opts/RISCV --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/build_opts/RISCV Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,3 @@ +TARGET_ISA = 'riscv' +CPU_MODELS = 'AtomicSimpleCPU' +PROTOCOL = 'MI_example' diff -r 8bc53d5565ba -r cceb2cc47bdd ext/libelf/elf_common.h --- a/ext/libelf/elf_common.h Tue Sep 06 10:22:38 2016 +0100 +++ b/ext/libelf/elf_common.h Thu Sep 15 20:52:22 2016 +0000 @@ -172,7 +172,8 @@ #define EM_TINYJ 61 /* Advanced Logic Corp. TinyJ processor. */ #define EM_X86_64 62 /* Advanced Micro Devices x86-64 */ #define EM_AMD64 EM_X86_64 /* Advanced Micro Devices x86-64 (compat) */ -#define EM_AARCH64 183 /* AArch64 64 bit ARM. */ +#define EM_AARCH64 183 /* AArch64 64 bit ARM. */ +#define EM_RISCV 243 /* Berkley RISC-V */ /* Non-standard or deprecated. */ #define EM_486 6 /* Intel i486. */ diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/RiscvISA.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/RiscvISA.py Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,49 @@ +# Copyright (c) 2012 ARM Limited +# Copyright (c) 2014 Sven Karlsson +# All rights reserved. +# +# The license below extends only to copyright in the software and shall +# not be construed as granting a license to any other intellectual +# property including but not limited to intellectual property relating +# to a hardware implementation of the functionality of the software +# licensed hereunder. You may use the software subject to the license +# terms below provided that you ensure that this notice is replicated +# unmodified and in its entirety in all distributions of the software, +# modified or unmodified, in source code or in binary form. +# +# Copyright (c) 2016 The University of Virginia +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer; +# redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution; +# neither the name of the copyright holders nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# Authors: Andreas Sandberg +# Sven Karlsson +# Alec Roelke + +from m5.SimObject import SimObject + +class RiscvISA(SimObject): + type = 'RiscvISA' + cxx_class = 'RiscvISA::ISA' + cxx_header = "arch/riscv/isa.hh" diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/RiscvInterrupts.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/RiscvInterrupts.py Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,38 @@ +# Copyright (c) 2008 The Regents of The University of Michigan +# Copyright (c) 2014 Sven Karlsson +# Copyright (c) 2016 The University of Virginia +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer; +# redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution; +# neither the name of the copyright holders nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# Authors: Gabe Black +# Sven Karlsson +# Alec Roelke + +from m5.SimObject import SimObject + +class RiscvInterrupts(SimObject): + type = 'RiscvInterrupts' + cxx_class = 'RiscvISA::Interrupts' + cxx_header = 'arch/riscv/interrupts.hh' diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/RiscvSystem.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/RiscvSystem.py Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,36 @@ +# -*- mode:python -*- + +# Copyright (c) 2016 The University of Virginia +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer; +# redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution; +# neither the name of the copyright holders nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# Authors: Alec Roelke + +from System import System + +class RiscvSystem(System): + type = 'RiscvSystem' + cxx_header = 'arch/riscv/system.hh' + load_addr_mask = 0xFFFFFFFFFFFFFFFF diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/RiscvTLB.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/RiscvTLB.py Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,42 @@ +# -*- mode:python -*- + +# Copyright (c) 2009 The University of Edinburgh +# Copyright (c) 2014 Sven Karlsson +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer; +# redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution; +# neither the name of the copyright holders nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# Authors: Timothy M. Jones +# Sven Karlsson + +from m5.SimObject import SimObject +from m5.params import * + +from BaseTLB import BaseTLB + +class RiscvTLB(BaseTLB): + type = 'RiscvTLB' + cxx_class = 'RiscvISA::TLB' + cxx_header = 'arch/riscv/tlb.hh' + size = Param.Int(64, "TLB size") diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/SConscript --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/SConscript Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,72 @@ +# -*- mode:python -*- + +# Copyright (c) 2013 ARM Limited +# Copyright (c) 2014 Sven Karlsson +# All rights reserved +# +# The license below extends only to copyright in the software and shall +# not be construed as granting a license to any other intellectual +# property including but not limited to intellectual property relating +# to a hardware implementation of the functionality of the software +# licensed hereunder. You may use the software subject to the license +# terms below provided that you ensure that this notice is replicated +# unmodified and in its entirety in all distributions of the software, +# modified or unmodified, in source code or in binary form. +# +# Copyright (c) 2016 The University of Virginia +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer; +# redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution; +# neither the name of the copyright holders nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# Authors: Andreas Hansson +# Sven Karlsson +# Alec Roelke + +Import('*') + +if env['TARGET_ISA'] == 'riscv': + Source('decoder.cc') + Source('faults.cc') + Source('isa.cc') + Source('interrupts.cc') + Source('process.cc') + Source('pagetable.cc') + Source('remote_gdb.cc') + Source('stacktrace.cc') + Source('tlb.cc') + Source('system.cc') + + Source('linux/process.cc') + Source('linux/linux.cc') + + SimObject('RiscvInterrupts.py') + SimObject('RiscvISA.py') + SimObject('RiscvTLB.py') + SimObject('RiscvSystem.py') + + DebugFlag('RiscvMisc') + DebugFlag('RiscvTLB') + + # Add in files generated by the ISA description. + env.ISADesc('isa/main.isa') diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/SConsopts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/SConsopts Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,44 @@ +# -*- mode:python -*- + +# Copyright (c) 2013 ARM Limited +# Copyright (c) 2014 Sven Karlsson +# All rights reserved +# +# The license below extends only to copyright in the software and shall +# not be construed as granting a license to any other intellectual +# property including but not limited to intellectual property relating +# to a hardware implementation of the functionality of the software +# licensed hereunder. You may use the software subject to the license +# terms below provided that you ensure that this notice is replicated +# unmodified and in its entirety in all distributions of the software, +# modified or unmodified, in source code or in binary form. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer; +# redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution; +# neither the name of the copyright holders nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# Authors: Andreas Hansson +# Sven Karlsson + +Import('*') + +all_isa_list.append('riscv') diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/decoder.hh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/decoder.hh Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2012 Google + * Copyright (c) 2014 - 2015 Sven Karlsson + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Gabe Black + * Sven Karlsson + */ + +#ifndef __ARCH_RISCV_DECODER_HH__ +#define __ARCH_RISCV_DECODER_HH__ + +#include "arch/generic/decode_cache.hh" +#include "arch/riscv/types.hh" +#include "base/misc.hh" +#include "base/types.hh" +#include "cpu/static_inst.hh" + +namespace RiscvISA +{ + +class ISA; +class Decoder +{ + protected: + // The extended machine instruction being generated + ExtMachInst emi; + bool instDone; + + public: + Decoder(ISA* isa=nullptr) : instDone(false) + {} + + void + process() + {} + + void + reset() + { + instDone = false; + } + + // Use this to give data to the predecoder. This should be used + // when there is control flow. + void + moreBytes(const PCState &pc, Addr fetchPC, MachInst inst) + { + emi = inst; + instDone = true; + } + + bool + needMoreBytes() + { + return true; + } + + bool + instReady() + { + return instDone; + } + + void + takeOverFrom(Decoder *old) {} + + protected: + /// A cache of decoded instruction objects. + static GenericISA::BasicDecodeCache defaultCache; + + public: + StaticInstPtr + decodeInst(ExtMachInst mach_inst); + + /// Decode a machine instruction. + /// @param mach_inst The binary instruction to decode. + /// @retval A pointer to the corresponding StaticInst object. + StaticInstPtr + decode(ExtMachInst mach_inst, Addr addr) + { + return defaultCache.decode(this, mach_inst, addr); + } + + StaticInstPtr + decode(RiscvISA::PCState &nextPC) + { + if (!instDone) + return NULL; + instDone = false; + return decode(emi, nextPC.instAddr()); + } +}; + +} // namespace RiscvISA + +#endif // __ARCH_RISCV_DECODER_HH__ diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/decoder.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/decoder.cc Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2011 Google + * Copyright (c) 2015 Sven Karlsson + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Gabe Black + * Sven Karlsson + */ + +#include "arch/riscv/decoder.hh" + +namespace RiscvISA +{ + +GenericISA::BasicDecodeCache Decoder::defaultCache; + +} diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/faults.hh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/faults.hh Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2016 The University of Virginia + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Alec Roelke + */ + +#ifndef __ARCH_RISCV_FAULTS_HH__ +#define __ARCH_RISCV_FAULTS_HH__ + +#include + +#include "cpu/thread_context.hh" +#include "sim/faults.hh" + +namespace RiscvISA +{ + +enum ExceptionCode { + INST_ADDR_MISALIGNED = 0, + INST_ACCESS = 1, + INST_ILLEGAL = 2, + BREAKPOINT = 3, + LOAD_ADDR_MISALIGNED = 4, + LOAD_ACCESS = 5, + STORE_ADDR_MISALINED = 6, + AMO_ADDR_MISALIGNED = 6, + STORE_ACCESS = 7, + AMO_ACCESS = 7, + ECALL_USER = 8, + ECALL_SUPER = 9, + ECALL_HYPER = 10, + ECALL_MACH = 11 +}; + +enum InterruptCode { + SOFTWARE, + TIMER +}; + +class RiscvFault : public FaultBase +{ + protected: + const FaultName _name; + const ExceptionCode _code; + const InterruptCode _int; + + RiscvFault(FaultName n, ExceptionCode c, InterruptCode i) + : _name(n), _code(c), _int(i) + {} + + FaultName + name() const + { + return _name; + } + + ExceptionCode + exception() const + { + return _code; + } + + InterruptCode + interrupt() const + { + return _int; + } + + virtual void + invoke_se(ThreadContext *tc, const StaticInstPtr &inst); + + void + invoke(ThreadContext *tc, const StaticInstPtr &inst); +}; + + +class UnknownInstFault : public RiscvFault +{ + public: + UnknownInstFault() : RiscvFault("Unknown instruction", INST_ILLEGAL, + SOFTWARE) + {} + + void + invoke_se(ThreadContext *tc, const StaticInstPtr &inst); +}; + +class UnimplementedFault : public RiscvFault +{ + private: + const std::string instName; + public: + UnimplementedFault(std::string name) + : RiscvFault("Unimplemented instruction", INST_ILLEGAL, SOFTWARE), + instName(name) + {} + + void + invoke_se(ThreadContext *tc, const StaticInstPtr &inst); +}; + +class BreakpointFault : public RiscvFault +{ +public: + BreakpointFault() : RiscvFault("Breakpoint", BREAKPOINT, SOFTWARE) + {} + + void + invoke_se(ThreadContext *tc, const StaticInstPtr &inst); +}; + +class SyscallFault : public RiscvFault +{ +public: + // TODO: replace ECALL_USER with the appropriate privilege level of the + // caller + SyscallFault() : RiscvFault("System call", ECALL_USER, SOFTWARE) + {} + + void + invoke_se(ThreadContext *tc, const StaticInstPtr &inst); +}; + +} // namespace RiscvISA + +#endif // __ARCH_RISCV_FAULTS_HH__ diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/faults.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/faults.cc Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2016 The University of Virginia + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Alec Roelke + */ +#include "arch/riscv/faults.hh" + +#include "arch/riscv/utility.hh" +#include "cpu/thread_context.hh" +#include "sim/debug.hh" +#include "sim/full_system.hh" + +using namespace RiscvISA; + +void +RiscvFault::invoke_se(ThreadContext *tc, const StaticInstPtr &inst) +{ + panic("Fault %s encountered at pc 0x%016llx.", name(), tc->pcState().pc()); +} + +void +RiscvFault::invoke(ThreadContext *tc, const StaticInstPtr &inst) +{ + if (FullSystem) { + panic("Full system mode not supported for RISC-V."); + } else { + invoke_se(tc, inst); + PCState pcState = tc->pcState(); + advancePC(pcState, inst); + tc->pcState(pcState); + } +} + +void +UnknownInstFault::invoke_se(ThreadContext *tc, const StaticInstPtr &inst) +{ + panic("Unknown instruction 0x%08x at pc 0x%016llx", inst->machInst, + tc->pcState().pc()); +} + +void +UnimplementedFault::invoke_se(ThreadContext *tc, + const StaticInstPtr &inst) +{ + panic("Unimplemented instruction %s at pc 0x%016llx", instName, + tc->pcState().pc()); +} + +void +BreakpointFault::invoke_se(ThreadContext *tc, const StaticInstPtr &inst) +{ + schedRelBreak(0); +} + +void +SyscallFault::invoke_se(ThreadContext *tc, const StaticInstPtr &inst) +{ + tc->syscall(tc->readIntReg(SyscallNumReg)); +} diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/idle_event.hh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/idle_event.hh Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2004-2005 The Regents of The University of Michigan + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Nathan Binkert + * Lisa Hsu + * Ali Saidi + */ + +#ifndef __KERN_RISCV_IDLE_EVENT_HH__ +#define __KERN_RISCV_IDLE_EVENT_HH__ + +#include "cpu/pc_event.hh" + +class IdleStartEvent : public PCEvent +{ + public: + IdleStartEvent(PCEventQueue *q, const std::string &desc, Addr addr) + : PCEvent(q, desc, addr) + {} + virtual void process(ThreadContext *tc); +}; + +#endif // __KERN_ALPHA_IDLE_EVENT_HH__ diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/idle_event.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/idle_event.cc Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2004-2005 The Regents of The University of Michigan + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Nathan Binkert + * Lisa Hsu + * Ali Saidi + */ + +#include "arch/riscv/idle_event.hh" +#include "arch/riscv/kernel_stats.hh" +#include "cpu/thread_context.hh" + +using namespace RiscvISA; + +void +IdleStartEvent::process(ThreadContext *tc) +{ + fatal("Idle Start Event Not Defined for RISCV ISA "); +} diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/interrupts.hh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/interrupts.hh Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2011 Google + * Copyright (c) 2014 Sven Karlsson + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Gabe Black + * Sven Karlsson + */ + +#ifndef __ARCH_RISCV_INTERRUPT_HH__ +#define __ARCH_RISCV_INTERRUPT_HH__ + +#include "base/misc.hh" +#include "params/RiscvInterrupts.hh" +#include "sim/sim_object.hh" + +class ThreadContext; + +namespace RiscvISA { + +class Interrupts : public SimObject +{ + private: + BaseCPU * cpu; + + public: + typedef RiscvInterruptsParams Params; + + const Params * + params() const + { + return dynamic_cast(_params); + } + + Interrupts(Params * p) : SimObject(p), cpu(NULL) + {} + + void + setCPU(BaseCPU * _cpu) + { + cpu = _cpu; + } + + void + post(int int_num, int index) + { + panic("Interrupts::post not implemented.\n"); + } + + void + clear(int int_num, int index) + { + panic("Interrupts::clear not implemented.\n"); + } + + void + clearAll() + { + panic("Interrupts::clearAll not implemented.\n"); + } + + bool + checkInterrupts(ThreadContext *tc) const + { + panic("Interrupts::checkInterrupts not implemented.\n"); + } + + Fault + getInterrupt(ThreadContext *tc) + { + panic("Interrupts::getInterrupt not implemented.\n"); + } + + void + updateIntrInfo(ThreadContext *tc) + { + panic("Interrupts::updateIntrInfo not implemented.\n"); + } +}; + +} // namespace RiscvISA + +#endif // __ARCH_RISCV_INTERRUPT_HH__ + diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/interrupts.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/interrupts.cc Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2011 Google + * Copyright (c) 2014 Sven Karlsson + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Gabe Black + * Sven Karlsson + */ + +#include "arch/riscv/interrupts.hh" + +RiscvISA::Interrupts * +RiscvInterruptsParams::create() +{ + return new RiscvISA::Interrupts(this); +} diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/isa.hh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/isa.hh Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2009 The Regents of The University of Michigan + * Copyright (c) 2009 The University of Edinburgh + * Copyright (c) 2014 Sven Karlsson + * Copyright (c) 2016 The University of Virginia + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Gabe Black + * Timothy M. Jones + * Sven Karlsson + * Alec Roelke + */ + +#ifndef __ARCH_RISCV_ISA_HH__ +#define __ARCH_RISCV_ISA_HH__ + +#include +#include + +#include "arch/riscv/registers.hh" +#include "arch/riscv/types.hh" +#include "base/misc.hh" +#include "sim/sim_object.hh" + +struct RiscvISAParams; +class ThreadContext; +class Checkpoint; +class EventManager; + +namespace RiscvISA +{ + +class ISA : public SimObject +{ + protected: + std::vector miscRegFile; + + public: + typedef RiscvISAParams Params; + static std::map miscRegNames; + + void + clear(); + + MiscReg + readMiscRegNoEffect(int misc_reg) const; + + MiscReg + readMiscReg(int misc_reg, ThreadContext *tc); + + void + setMiscRegNoEffect(int misc_reg, const MiscReg &val); + + void + setMiscReg(int misc_reg, const MiscReg &val, ThreadContext *tc); + + int + flattenIntIndex(int reg) const + { + return reg; + } + + int + flattenFloatIndex(int reg) const + { + return reg; + } + + // dummy + int + flattenCCIndex(int reg) const + { + return reg; + } + + int + flattenMiscIndex(int reg) const + { + return reg; + } + + void startup(ThreadContext *tc) {} + + /// Explicitly import the otherwise hidden startup + using SimObject::startup; + + const Params * + params() const; + + ISA(Params *p); +}; + +} // namespace RiscvISA + +#endif // __ARCH_RISCV_ISA_HH__ diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/isa.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/isa.cc Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,232 @@ +/* + * Copyright (c) 2016 The University of Virginia + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Alec Roelke + */ +#include "arch/riscv/isa.hh" + +#include +#include + +#include "arch/riscv/registers.hh" +#include "base/bitfield.hh" +#include "cpu/base.hh" +#include "debug/RiscvMisc.hh" +#include "params/RiscvISA.hh" +#include "sim/core.hh" +#include "sim/pseudo_inst.hh" + +namespace RiscvISA +{ + +std::map ISA::miscRegNames = { + {MISCREG_FFLAGS, "fflags"}, + {MISCREG_FRM, "frm"}, + {MISCREG_FCSR, "fcsr"}, + {MISCREG_CYCLE, "cycle"}, + {MISCREG_TIME, "time"}, + {MISCREG_INSTRET, "instret"}, + {MISCREG_CYCLEH, "cycleh"}, + {MISCREG_TIMEH, "timeh"}, + {MISCREG_INSTRETH, "instreth"}, + + {MISCREG_SSTATUS, "sstatus"}, + {MISCREG_STVEC, "stvec"}, + {MISCREG_SIE, "sie"}, + {MISCREG_STIMECMP, "stimecmp"}, + {MISCREG_STIME, "stime"}, + {MISCREG_STIMEH, "stimeh"}, + {MISCREG_SSCRATCH, "sscratch"}, + {MISCREG_SEPC, "sepc"}, + {MISCREG_SCAUSE, "scause"}, + {MISCREG_SBADADDR, "sbadaddr"}, + {MISCREG_SIP, "sip"}, + {MISCREG_SPTBR, "sptbr"}, + {MISCREG_SASID, "sasid"}, + {MISCREG_CYCLEW, "cyclew"}, + {MISCREG_TIMEW, "timew"}, + {MISCREG_INSTRETW, "instretw"}, + {MISCREG_CYCLEHW, "cyclehw"}, + {MISCREG_TIMEHW, "timehw"}, + {MISCREG_INSTRETHW, "instrethw"}, + + {MISCREG_HSTATUS, "hstatus"}, + {MISCREG_HTVEC, "htvec"}, + {MISCREG_HTDELEG, "htdeleg"}, + {MISCREG_HTIMECMP, "htimecmp"}, + {MISCREG_HTIME, "htime"}, + {MISCREG_HTIMEH, "htimeh"}, + {MISCREG_HSCRATCH, "hscratch"}, + {MISCREG_HEPC, "hepc"}, + {MISCREG_HCAUSE, "hcause"}, + {MISCREG_HBADADDR, "hbadaddr"}, + {MISCREG_STIMEW, "stimew"}, + {MISCREG_STIMEHW, "stimehw"}, + + {MISCREG_MCPUID, "mcpuid"}, + {MISCREG_MIMPID, "mimpid"}, + {MISCREG_MHARTID, "mhartid"}, + {MISCREG_MSTATUS, "mstatus"}, + {MISCREG_MTVEC, "mtvec"}, + {MISCREG_MTDELEG, "mtdeleg"}, + {MISCREG_MIE, "mie"}, + {MISCREG_MTIMECMP, "mtimecmp"}, + {MISCREG_MTIME, "mtime"}, + {MISCREG_MTIMEH, "mtimeh"}, + {MISCREG_MSCRATCH, "mscratch"}, + {MISCREG_MEPC, "mepc"}, + {MISCREG_MCAUSE, "mcause"}, + {MISCREG_MBADADDR, "mbadaddr"}, + {MISCREG_MIP, "mip"}, + {MISCREG_MBASE, "mbase"}, + {MISCREG_MBOUND, "mbound"}, + {MISCREG_MIBASE, "mibase"}, + {MISCREG_MIBOUND, "mibound"}, + {MISCREG_MDBASE, "mdbase"}, + {MISCREG_MDBOUND, "mdbound"}, + {MISCREG_HTIMEW, "htimew"}, + {MISCREG_HTIMEHW, "htimehw"}, + {MISCREG_MTOHOST, "mtohost"}, + {MISCREG_MFROMHOST, "mfromhost"} +}; + +ISA::ISA(Params *p) : SimObject(p) +{ + miscRegFile.resize(NumMiscRegs); + clear(); +} + +const RiscvISAParams * +ISA::params() const +{ + return dynamic_cast(_params); +} + +void ISA::clear() +{ + std::fill(miscRegFile.begin(), miscRegFile.end(), 0); +} + + +MiscReg +ISA::readMiscRegNoEffect(int misc_reg) const +{ + DPRINTF(RiscvMisc, "Reading CSR %s (0x%016llx).\n", miscRegNames[misc_reg], + miscRegFile[misc_reg]); + switch (misc_reg) { + case MISCREG_FFLAGS: + return bits(miscRegFile[MISCREG_FCSR], 4, 0); + case MISCREG_FRM: + return bits(miscRegFile[MISCREG_FCSR], 7, 5); + case MISCREG_FCSR: + return bits(miscRegFile[MISCREG_FCSR], 31, 0); + case MISCREG_CYCLE: + warn("Use readMiscReg to read the cycle CSR."); + return 0; + case MISCREG_TIME: + return std::time(nullptr); + case MISCREG_INSTRET: + warn("Use readMiscReg to read the instret CSR."); + return 0; + case MISCREG_CYCLEH: + warn("Use readMiscReg to read the cycleh CSR."); + return 0; + case MISCREG_TIMEH: + return std::time(nullptr) >> 32; + case MISCREG_INSTRETH: + warn("Use readMiscReg to read the instreth CSR."); + return 0; + default: + return miscRegFile[misc_reg]; + } +} + +MiscReg +ISA::readMiscReg(int misc_reg, ThreadContext *tc) +{ + switch (misc_reg) { + case MISCREG_INSTRET: + DPRINTF(RiscvMisc, "Reading CSR %s (0x%016llx).\n", + miscRegNames[misc_reg], miscRegFile[misc_reg]); + return tc->getCpuPtr()->totalInsts(); + case MISCREG_CYCLE: + DPRINTF(RiscvMisc, "Reading CSR %s (0x%016llx).\n", + miscRegNames[misc_reg], miscRegFile[misc_reg]); + return tc->getCpuPtr()->curCycle(); + case MISCREG_INSTRETH: + DPRINTF(RiscvMisc, "Reading CSR %s (0x%016llx).\n", + miscRegNames[misc_reg], miscRegFile[misc_reg]); + return tc->getCpuPtr()->totalInsts() >> 32; + case MISCREG_CYCLEH: + DPRINTF(RiscvMisc, "Reading CSR %s (0x%016llx).\n", + miscRegNames[misc_reg], miscRegFile[misc_reg]); + return tc->getCpuPtr()->curCycle() >> 32; + default: + return readMiscRegNoEffect(misc_reg); + } +} + +void +ISA::setMiscRegNoEffect(int misc_reg, const MiscReg &val) +{ + DPRINTF(RiscvMisc, "Setting CSR %s to 0x%016llx.\n", + miscRegNames[misc_reg], miscRegNames[misc_reg], val); + switch (misc_reg) { + case MISCREG_FFLAGS: + miscRegFile[MISCREG_FCSR] &= ~0x1F; + miscRegFile[MISCREG_FCSR] |= bits(val, 4, 0); + break; + case MISCREG_FRM: + miscRegFile[MISCREG_FCSR] &= ~0x70; + miscRegFile[MISCREG_FCSR] |= bits(val, 2, 0) << 5; + break; + case MISCREG_FCSR: + miscRegFile[MISCREG_FCSR] = bits(val, 7, 0); + break; + default: + miscRegFile[misc_reg] = val; + break; + } +} + +void +ISA::setMiscReg(int misc_reg, const MiscReg &val, ThreadContext *tc) +{ + if (bits((unsigned)misc_reg, 11, 10) == 0x3) { + warn("Ignoring write to read-only CSR."); + return; + } + setMiscRegNoEffect(misc_reg, val); +} + +} + +RiscvISA::ISA * +RiscvISAParams::create() +{ + return new RiscvISA::ISA(this); +} diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/isa/base.isa --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/isa/base.isa Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,78 @@ +// -*- mode:c++ -*- + +// Copyright (c) 2015 Riscv Developers +// Copyright (c) 2016 The University of Virginia +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer; +// redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution; +// neither the name of the copyright holders nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Authors: Maxwell Walter +// Alec Roelke + +//////////////////////////////////////////////////////////////////// +// +// Base class for Riscv instructions, and some support functions +// + +//Outputs to decoder.hh +output header {{ + using namespace RiscvISA; + + /** + * Base class for all RISC-V static instructions. + */ + class RiscvStaticInst : public StaticInst + { + protected: + // Constructor + RiscvStaticInst(const char *mnem, MachInst _machInst, OpClass __opClass) + : StaticInst(mnem, _machInst, __opClass){} + + std::string + regName(RegIndex reg) const; + + virtual std::string + generateDisassembly(Addr pc, const SymbolTable *symtab) const = 0; + + public: + void + advancePC(RiscvISA::PCState &pc) const + { + pc.advance(); + } + }; +}}; + +//Ouputs to decoder.cc +output decoder {{ + std::string + RiscvStaticInst::regName(RegIndex reg) const + { + if (reg < FP_Reg_Base) { + return std::string(RegisterNames[reg]); + } else { + return std::string("f") + std::to_string(reg - FP_Reg_Base); + } + } +}}; diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/isa/bitfields.isa --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/isa/bitfields.isa Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,77 @@ +// -*- mode:c++ -*- + +// Copyright (c) 2015 Riscv Developers +// Copyright (c) 2016 The University of Virginia +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer; +// redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution; +// neither the name of the copyright holders nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Authors: Maxwell Walter +// Alec Roelke + +//////////////////////////////////////////////////////////////////// +// +// Bitfield definitions. +// + +def bitfield OPCODE <6:0>; +def bitfield NONOPCODE <31:7>; + +// R-Type +def bitfield ALL <31:0>; +def bitfield RD <11:7>; +def bitfield FUNCT3 <14:12>; +def bitfield RS1 <19:15>; +def bitfield RS2 <24:20>; +def bitfield FUNCT7 <31:25>; + +// Bit shifts +def bitfield SRTYPE <30>; +def bitfield SHAMT5 <24:20>; +def bitfield SHAMT6 <25:20>; + +// I-Type +def bitfield IMM12 <31:20>; + +// S-Type +def bitfield IMM5 <11:7>; +def bitfield IMM7 <31:25>; + +// U-Type +def bitfield IMM20 <31:12>; + +// SB-Type +def bitfield BIMM12BIT11 <7>; +def bitfield BIMM12BITS4TO1<11:8>; +def bitfield IMMSIGN <31>; +def bitfield BIMM12BITS10TO5 <30:25>; + +// UJ-Type +def bitfield UJIMMBITS10TO1 <30:21>; +def bitfield UJIMMBIT11 <20>; +def bitfield UJIMMBITS19TO12 <19:12>; + +// System +def bitfield FUNCT12 <31:20>; +def bitfield ZIMM <19:15>; diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/isa/decoder.isa --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/isa/decoder.isa Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,338 @@ +// -*- mode:c++ -*- + +// Copyright (c) 2015 Riscv Developers +// Copyright (c) 2016 The University of Virginia +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer; +// redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution; +// neither the name of the copyright holders nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Authors: Maxwell Walter +// Alec Roelke + +//////////////////////////////////////////////////////////////////// +// +// The actual Riscv ISA decoder +// ----------------------------- +// + + +decode OPCODE default Unknown::unknown() { + 0x6f: UJOp::jal({{ + Rd = NPC; + NPC = PC + imm; + }}, IsDirectControl, IsUncondControl, IsCall); + + 0x23: decode FUNCT3 { + format Store { + 0x0: sb({{ + Mem_ub = Rs2_ub; + }}); + 0x1: sh({{ + Mem_uh = Rs2_uh; + }}); + 0x2: sw({{ + Mem_uw = Rs2_uw; + }}); + 0x3: sd({{ + Mem_ud = Rs2_ud; + }}); + } + } + + 0x13: decode FUNCT3 { + format IOp { + 0x0: addi({{ + Rd_sd = Rs1_sd + imm; + }}); + 0x1: slli({{ + Rd = Rs1 << SHAMT6; + }}); + 0x2: slti({{ + Rd = (Rs1_sd < imm) ? 1 : 0; + }}); + 0x3: sltiu({{ + Rd = (Rs1 < static_cast(imm)) ? 1 : 0; + }}); + 0x4: xori({{ + Rd = Rs1^static_cast(imm); + }}); + 0x5: decode SRTYPE { + 0x0: srli({{ + Rd = Rs1 >> SHAMT6; + }}); + 0x1: srai({{ + Rd_sd = Rs1_sd >> SHAMT6; + }}); + } + 0x6: ori({{ + Rd = Rs1 | static_cast(imm); + }}); + 0x7: andi({{ + Rd = Rs1&static_cast(imm); + }}); + } + } + + 0x1b: decode FUNCT3 { + format IOp { + 0x0: addiw({{ + Rd_sd = (int32_t)Rs1 + (int32_t)imm; + }}); + 0x1: slliw({{ + Rd_sd = Rs1_sw << SHAMT5; + }}); + 0x5: decode SRTYPE { + 0x0: srliw({{ + Rd = Rs1_uw >> SHAMT5; + }}); + 0x1: sraiw({{ + Rd_sd = Rs1_sw >> SHAMT5; + }}); + } + } + } + + 0xf: decode FUNCT3 { + format IOp { + 0x0: fence({{ + }}, IsNonSpeculative, IsMemBarrier, No_OpClass); + 0x1: fence_i({{ + }}, IsNonSpeculative, IsSerializeAfter, No_OpClass); + } + } + + 0x17: UOp::auipc({{ + Rd = PC + imm; + }}); + + 0x37: UOp::lui({{ + Rd = static_cast(imm); + }}); + + 0x33: decode FUNCT3 { + format ROp { + 0x0: decode FUNCT7 { + 0x0: add({{ + Rd = Rs1_sd + Rs2_sd; + }}); + 0x20: sub({{ + Rd = Rs1_sd - Rs2_sd; + }}); + } + 0x1: decode FUNCT7 { + 0x0: sll({{ + Rd = Rs1 << Rs2<5:0>; + }}); + } + 0x2: decode FUNCT7 { + 0x0: slt({{ + Rd = (Rs1_sd < Rs2_sd) ? 1 : 0; + }}); + } + 0x3: decode FUNCT7 { + 0x0: sltu({{ + Rd = (Rs1 < Rs2) ? 1 : 0; + }}); + } + 0x4: decode FUNCT7 { + 0x0: xor({{ + Rd = Rs1^Rs2; + }}); + } + 0x5: decode FUNCT7 { + 0x0: srl({{ + Rd = Rs1 >> Rs2<5:0>; + }}); + 0x20: sra({{ + Rd_sd = Rs1_sd >> Rs2<5:0>; + }}); + } + 0x6: decode FUNCT7 { + 0x0: or({{ + Rd = Rs1 | Rs2; + }}); + } + 0x7: decode FUNCT7 { + 0x0: and({{ + Rd = Rs1&Rs2; + }}); + } + } + } + + 0x3b: decode FUNCT3 { + format ROp { + 0x0: decode FUNCT7 { + 0x0: addw({{ + Rd_sd = Rs1_sw + Rs2_sw; + }}); + 0x1: mulw({{ + Rd_sd = (int32_t)(Rs1_sw*Rs2_sw); + }}, IntMultOp); + 0x20: subw({{ + Rd_sd = Rs1_sw - Rs2_sw; + }}); + } + 0x1: sllw({{ + Rd_sd = Rs1_sw << Rs2<4:0>; + }}); + 0x5: decode FUNCT7 { + 0x0: srlw({{ + Rd_uw = Rs1_uw >> Rs2<4:0>; + }}); + 0x20: sraw({{ + Rd_sd = Rs1_sw >> Rs2<4:0>; + }}); + } + } + } + + 0x67: decode FUNCT3 { + 0x0: Jump::jalr({{ + Rd = NPC; + NPC = (imm + Rs1)&(~0x1); + }}, IsIndirectControl, IsUncondControl, IsCall); + } + + 0x3: decode FUNCT3 { + format Load { + 0x0: lb({{ + Rd_sd = Mem_sb; + }}); + 0x1: lh({{ + Rd_sd = Mem_sh; + }}); + 0x2: lw({{ + Rd_sd = Mem_sw; + }}); + 0x3: ld({{ + Rd_sd = Mem_sd; + }}); + 0x4: lbu({{ + Rd = Mem_ub; + }}); + 0x5: lhu({{ + Rd = Mem_uh; + }}); + 0x6: lwu({{ + Rd = Mem_uw; + }}); + } + } + + 0x63: decode FUNCT3 { + format SBOp { + 0x0: beq({{ + if (Rs1 == Rs2) { + NPC = PC + imm; + } else { + NPC = NPC; + } + }}, IsDirectControl, IsCondControl); + 0x1: bne({{ + if (Rs1 != Rs2) { + NPC = PC + imm; + } else { + NPC = NPC; + } + }}, IsDirectControl, IsCondControl); + 0x4: blt({{ + if (Rs1_sd < Rs2_sd) { + NPC = PC + imm; + } else { + NPC = NPC; + } + }}, IsDirectControl, IsCondControl); + 0x5: bge({{ + if (Rs1_sd >= Rs2_sd) { + NPC = PC + imm; + } else { + NPC = NPC; + } + }}, IsDirectControl, IsCondControl); + 0x6: bltu({{ + if (Rs1 < Rs2) { + NPC = PC + imm; + } else { + NPC = NPC; + } + }}, IsDirectControl, IsCondControl); + 0x7: bgeu({{ + if (Rs1 >= Rs2) { + NPC = PC + imm; + } else { + NPC = NPC; + } + }}, IsDirectControl, IsCondControl); + } + } + + 0x73: decode FUNCT3 { + format IOp { + 0x0: decode FUNCT12 { + 0x0: ecall({{ + fault = std::make_shared(); + }}, IsSerializeAfter, IsNonSpeculative, IsSyscall, No_OpClass); + 0x1: ebreak({{ + fault = std::make_shared(); + }}, IsSerializeAfter, IsNonSpeculative, No_OpClass); + 0x100: eret({{ + fault = std::make_shared("eret"); + }}, No_OpClass); + } + 0x1: csrrw({{ + Rd = xc->readMiscReg(FUNCT12); + xc->setMiscReg(FUNCT12, Rs1); + }}, IsNonSpeculative, No_OpClass); + 0x2: csrrs({{ + Rd = xc->readMiscReg(FUNCT12); + if (Rs1 != 0) { + xc->setMiscReg(FUNCT12, Rd | Rs1); + } + }}, IsNonSpeculative, No_OpClass); + 0x3: csrrc({{ + Rd = xc->readMiscReg(FUNCT12); + if (Rs1 != 0) { + xc->setMiscReg(FUNCT12, Rd&~Rs1); + } + }}, IsNonSpeculative, No_OpClass); + 0x5: csrrwi({{ + Rd = xc->readMiscReg(FUNCT12); + xc->setMiscReg(FUNCT12, ZIMM); + }}, IsNonSpeculative, No_OpClass); + 0x6: csrrsi({{ + Rd = xc->readMiscReg(FUNCT12); + if (ZIMM != 0) { + xc->setMiscReg(FUNCT12, Rd | ZIMM); + } + }}, IsNonSpeculative, No_OpClass); + 0x7: csrrci({{ + Rd = xc->readMiscReg(FUNCT12); + if (ZIMM != 0) { + xc->setMiscReg(FUNCT12, Rd&~ZIMM); + } + }}, IsNonSpeculative, No_OpClass); + } + } +} diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/isa/formats/basic.isa --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/isa/formats/basic.isa Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,99 @@ +// -*- mode:c++ -*- + +// Copyright (c) 2015 Riscv Developers +// Copyright (c) 2016 The University of Virginia +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer; +// redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution; +// neither the name of the copyright holders nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Authors: Maxwell Walter +// Alec Roelke + +// Declarations for execute() methods. +def template BasicExecDeclare {{ + Fault execute(%(CPU_exec_context)s *, Trace::InstRecord *) const; +}}; + +// Basic instruction class declaration template. +def template BasicDeclare {{ + // + // Static instruction class for "%(mnemonic)s". + // + class %(class_name)s : public %(base_class)s + { + public: + /// Constructor. + %(class_name)s(MachInst machInst); + %(BasicExecDeclare)s + using %(base_class)s::generateDisassembly; + }; +}}; + +// Basic instruction class constructor template. +def template BasicConstructor {{ + %(class_name)s::%(class_name)s(MachInst machInst) + : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s) + { + %(constructor)s; + } +}}; + + +// Basic instruction class execute method template. +def template BasicExecute {{ + Fault + %(class_name)s::execute(CPU_EXEC_CONTEXT *xc, Trace::InstRecord *traceData) const + { + Fault fault = NoFault; + + %(op_decl)s; + %(op_rd)s; + if(fault == NoFault) { + %(code)s; + if(fault == NoFault) { + %(op_wb)s; + } + } + return fault; + } +}}; + +// Basic decode template. +def template BasicDecode {{ + return new %(class_name)s(machInst); +}}; + +// Basic decode template, passing mnemonic in as string arg to constructor. +def template BasicDecodeWithMnemonic {{ + return new %(class_name)s("%(mnemonic)s", machInst); +}}; + +// The most basic instruction format... +def format BasicOp(code, *flags) {{ + iop = InstObjParams(name, Name, 'RiscvStaticInst', code, flags) + header_output = BasicDeclare.subst(iop) + decoder_output = BasicConstructor.subst(iop) + decode_block = BasicDecode.subst(iop) + exec_output = BasicExecute.subst(iop) +}}; diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/isa/formats/formats.isa --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/isa/formats/formats.isa Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,42 @@ +// -*- mode:c++ -*- + +// Copyright (c) 2015 Riscv Developers +// Copyright (c) 2016 The University of Virginia +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer; +// redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution; +// neither the name of the copyright holders nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Authors: Maxwell Walter +// Alec Roelke + +// Include the basic format +##include "basic.isa" + +//Include the type formats +##include "type.isa" +##include "mem.isa" + +// Include the unknown +##include "unknown.isa" + diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/isa/formats/mem.isa --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/isa/formats/mem.isa Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,426 @@ +// -*- mode:c++ -*- + +// Copyright (c) 2015 Riscv Developers +// Copyright (c) 2016 The University of Virginia +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer; +// redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution; +// neither the name of the copyright holders nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Authors: Alec Roelke + +//////////////////////////////////////////////////////////////////// +// +// Memory operation instructions +// +output header {{ + class Load : public RiscvStaticInst + { + public: + /// Displacement for EA calculation (signed). + int64_t ldisp; + + protected: + /// Memory request flags. See mem_req_base.hh. + Request::Flags memAccessFlags; + + /// Constructor + Load(const char *mnem, ExtMachInst _machInst, OpClass __opClass) + : RiscvStaticInst(mnem, _machInst, __opClass), ldisp(IMM12) + { + if(IMMSIGN > 0) + ldisp |= ~((uint64_t)0xFFF); + } + + std::string + generateDisassembly(Addr pc, const SymbolTable *symtab) const; + }; + + class Store : public RiscvStaticInst + { + public: + /// Displacement for EA calculation (signed). + int64_t sdisp; + + protected: + /// Memory request flags. See mem_req_base.hh. + Request::Flags memAccessFlags; + + /// Constructor + Store(const char *mnem, ExtMachInst _machInst, OpClass __opClass) + : RiscvStaticInst(mnem, _machInst, __opClass), sdisp(IMM5) + { + sdisp |= IMM7 << 5; + if(IMMSIGN > 0) + sdisp |= ~((uint64_t)0xFFF); + } + + std::string + generateDisassembly(Addr pc, const SymbolTable *symtab) const; + }; + +}}; + + +output decoder {{ + std::string + Load::generateDisassembly(Addr pc, const SymbolTable *symtab) const + { + std::stringstream ss; + ss << mnemonic << ' ' << regName(_destRegIdx[0]) << ", " << ldisp + << '(' << regName(_srcRegIdx[0]) << ')'; + return ss.str(); + } + + std::string + Store::generateDisassembly(Addr pc, const SymbolTable *symtab) const + { + std::stringstream ss; + ss << mnemonic << ' ' << regName(_srcRegIdx[1]) << ", " << sdisp << '(' + << regName(_srcRegIdx[0]) << ')'; + return ss.str(); + } +}}; + +def template LoadStoreDeclare {{ + /** + * Static instruction class for "%(mnemonic)s". + */ + class %(class_name)s : public %(base_class)s + { + public: + /// Constructor. + %(class_name)s(ExtMachInst machInst); + + %(BasicExecDeclare)s + + %(EACompDeclare)s + + %(InitiateAccDeclare)s + + %(CompleteAccDeclare)s + }; +}}; + +def template EACompDeclare {{ + Fault + eaComp(%(CPU_exec_context)s *, Trace::InstRecord *) const; +}}; + +def template InitiateAccDeclare {{ + Fault + initiateAcc(%(CPU_exec_context)s *, Trace::InstRecord *) const; +}}; + + +def template CompleteAccDeclare {{ + Fault + completeAcc(PacketPtr, %(CPU_exec_context)s *, Trace::InstRecord *) const; +}}; + +def template LoadStoreConstructor {{ + %(class_name)s::%(class_name)s(ExtMachInst machInst): + %(base_class)s("%(mnemonic)s", machInst, %(op_class)s) + { + %(constructor)s; + } +}}; + +def template EACompExecute {{ + Fault + %(class_name)s::eaComp(CPU_EXEC_CONTEXT *xc, Trace::InstRecord *traceData) const + { + Addr EA; + Fault fault = NoFault; + + %(op_decl)s; + %(op_rd)s; + %(ea_code)s; + + if (fault == NoFault) { + %(op_wb)s; + xc->setEA(EA); + } + + return fault; + } +}}; + +let {{ +def LoadStoreBase(name, Name, ea_code, memacc_code, mem_flags, inst_flags, + base_class, postacc_code='', decode_template=BasicDecode, + exec_template_base=''): + # Make sure flags are in lists (convert to lists if not). + mem_flags = makeList(mem_flags) + inst_flags = makeList(inst_flags) # + ['IsNonSpeculative'] + + iop = InstObjParams(name, Name, base_class, + { 'ea_code':ea_code, 'memacc_code':memacc_code, + 'postacc_code':postacc_code }, inst_flags) + + if mem_flags: + mem_flags = [ 'Request::%s' % flag for flag in mem_flags ] + s = '\n\tmemAccessFlags = ' + string.join(mem_flags, '|') + ';' + iop.constructor += s + + # select templates + + # The InitiateAcc template is the same for StoreCond templates as the + # corresponding Store template.. + StoreCondInitiateAcc = StoreInitiateAcc + + fullExecTemplate = eval(exec_template_base + 'Execute') + initiateAccTemplate = eval(exec_template_base + 'InitiateAcc') + completeAccTemplate = eval(exec_template_base + 'CompleteAcc') + + # (header_output, decoder_output, decode_block, exec_output) + return (LoadStoreDeclare.subst(iop), + LoadStoreConstructor.subst(iop), + decode_template.subst(iop), + fullExecTemplate.subst(iop) + + EACompExecute.subst(iop) + + initiateAccTemplate.subst(iop) + + completeAccTemplate.subst(iop)) +}}; + +def template LoadExecute {{ + Fault + %(class_name)s::execute(CPU_EXEC_CONTEXT *xc, Trace::InstRecord *traceData) const + { + Addr EA; + Fault fault = NoFault; + + %(op_decl)s; + %(op_rd)s; + %(ea_code)s; + + if (fault == NoFault) { + fault = readMemAtomic(xc, traceData, EA, Mem, memAccessFlags); + %(memacc_code)s; + } + + if (fault == NoFault) { + %(op_wb)s; + } + + return fault; + } +}}; + +def template LoadInitiateAcc {{ + Fault + %(class_name)s::initiateAcc(CPU_EXEC_CONTEXT *xc, + Trace::InstRecord *traceData) const + { + Addr EA; + Fault fault = NoFault; + + %(op_src_decl)s; + %(op_rd)s; + %(ea_code)s; + + if (fault == NoFault) { + fault = initiateMemRead(xc, traceData, EA, Mem, memAccessFlags); + } + + return fault; + } +}}; + +def template LoadCompleteAcc {{ + Fault + %(class_name)s::completeAcc(PacketPtr pkt, CPU_EXEC_CONTEXT *xc, + Trace::InstRecord *traceData) const + { + Fault fault = NoFault; + + %(op_decl)s; + %(op_rd)s; + + getMem(pkt, Mem, traceData); + + if (fault == NoFault) { + %(memacc_code)s; + } + + if (fault == NoFault) { + %(op_wb)s; + } + + return fault; + } +}}; + +def template StoreExecute {{ + Fault + %(class_name)s::execute(CPU_EXEC_CONTEXT *xc, Trace::InstRecord *traceData) const + { + Addr EA; + Fault fault = NoFault; + + %(op_decl)s; + %(op_rd)s; + %(ea_code)s; + + if (fault == NoFault) { + %(memacc_code)s; + } + + if (fault == NoFault) { + fault = writeMemAtomic(xc, traceData, Mem, EA, + memAccessFlags, NULL); + } + + if (fault == NoFault) { + %(postacc_code)s; + } + + if (fault == NoFault) { + %(op_wb)s; + } + + return fault; + } +}}; + +def template StoreInitiateAcc {{ + Fault + %(class_name)s::initiateAcc(CPU_EXEC_CONTEXT *xc, + Trace::InstRecord *traceData) const + { + Addr EA; + Fault fault = NoFault; + + %(op_decl)s; + %(op_rd)s; + %(ea_code)s; + + if (fault == NoFault) { + %(memacc_code)s; + } + + if (fault == NoFault) { + fault = writeMemTiming(xc, traceData, Mem, EA, + memAccessFlags, NULL); + } + + if (fault == NoFault) { + %(op_wb)s; + } + + return fault; + } +}}; + +def template StoreCompleteAcc {{ + Fault + %(class_name)s::completeAcc(PacketPtr pkt, CPU_EXEC_CONTEXT *xc, + Trace::InstRecord *traceData) const + { + return NoFault; + } +}}; + +def template StoreCondExecute {{ + Fault + %(class_name)s::execute(CPU_EXEC_CONTEXT *xc, Trace::InstRecord *traceData) const + { + Addr EA; + Fault fault = NoFault; + uint64_t result; + + %(op_decl)s; + %(op_rd)s; + %(ea_code)s; + + if (fault == NoFault) { + %(memacc_code)s; + } + + if (fault == NoFault) { + fault = writeMemAtomic(xc, traceData, Mem, EA, memAccessFlags, + &result); + } + + if (fault == NoFault) { + %(postacc_code)s; + } + + if (fault == NoFault) { + %(op_wb)s; + } + + return fault; + } +}}; + +def template StoreCondCompleteAcc {{ + Fault + %(class_name)s::completeAcc(Packet *pkt, CPU_EXEC_CONTEXT *xc, + Trace::InstRecord *traceData) const + { + Fault fault = NoFault; + + %(op_dest_decl)s; + + uint64_t result = pkt->req->getExtraData(); + + if (fault == NoFault) { + %(postacc_code)s; + } + + if (fault == NoFault) { + %(op_wb)s; + } + + return fault; + } +}}; + +def format Load(memacc_code, ea_code = {{EA = Rs1 + ldisp;}}, mem_flags=[], + inst_flags=[]) {{ + (header_output, decoder_output, decode_block, exec_output) = \ + LoadStoreBase(name, Name, ea_code, memacc_code, mem_flags, + inst_flags, 'Load', exec_template_base='Load') +}}; + +def format Store(memacc_code, ea_code={{EA = Rs1 + sdisp;}}, mem_flags=[], + inst_flags=[]) {{ + (header_output, decoder_output, decode_block, exec_output) = \ + LoadStoreBase(name, Name, ea_code, memacc_code, mem_flags, + inst_flags, 'Store', exec_template_base='Store') +}}; + +def format StoreCond(memacc_code, postacc_code, ea_code={{EA = Rs1;}}, + mem_flags=[], inst_flags=[]) {{ + (header_output, decoder_output, decode_block, exec_output) = \ + LoadStoreBase(name, Name, ea_code, memacc_code, mem_flags, + inst_flags, 'Store', postacc_code, exec_template_base='StoreCond') +}}; + +def format LoadReserved(memacc_code, ea_code={{EA = Rs1;}}, mem_flags=[], + inst_flags=[]) {{ + (header_output, decoder_output, decode_block, exec_output) = \ + LoadStoreBase(name, Name, ea_code, memacc_code, mem_flags, + inst_flags, 'Load', exec_template_base='Load') +}}; diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/isa/formats/type.isa --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/isa/formats/type.isa Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,319 @@ +// -*- mode:c++ -*- + +// Copyright (c) 2015 Riscv Developers +// Copyright (c) 2016 The University of Virginia +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer; +// redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution; +// neither the name of the copyright holders nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Authors: Alec Roelke + +//////////////////////////////////////////////////////////////////// +// +// Integer instructions +// +output header {{ + #include + /** + * Base class for R-type operations + */ + class ROp : public RiscvStaticInst + { + protected: + /// Constructor + ROp(const char *mnem, MachInst _machInst, OpClass __opClass) + : RiscvStaticInst(mnem, _machInst, __opClass) + {} + + std::string + generateDisassembly(Addr pc, const SymbolTable *symtab) const; + }; + + /** + * Base class for I-type operations + */ + class IOp : public RiscvStaticInst + { + protected: + int64_t imm; + + /// Constructor + IOp(const char *mnem, MachInst _machInst, OpClass __opClass) + : RiscvStaticInst(mnem, _machInst, __opClass),imm(IMM12) + { + if (IMMSIGN > 0) + imm |= ~((uint64_t)0x7FF); + } + + std::string + generateDisassembly(Addr pc, const SymbolTable *symtab) const; + }; + + /** + * Class for jalr instructions + */ + class Jump : public IOp + { + protected: + Jump(const char *mnem, MachInst _machInst, OpClass __opClass) + : IOp(mnem, _machInst, __opClass) + {} + + RiscvISA::PCState + branchTarget(ThreadContext *tc) const; + + using StaticInst::branchTarget; + using IOp::generateDisassembly; + }; + + /** + * Base class for S-type operations + */ + class SOp : public RiscvStaticInst + { + protected: + int64_t imm; + + /// Constructor + SOp(const char *mnem, MachInst _machInst, OpClass __opClass) + : RiscvStaticInst(mnem, _machInst, __opClass),imm(0) + { + imm |= IMM5; + imm |= IMM7 << 5; + if(IMMSIGN > 0) + imm |= ~((uint64_t)0x7FF); + } + + std::string + generateDisassembly(Addr pc, const SymbolTable *symtab) const; + }; + + /** + * Base class for SB-type operations + */ + class SBOp : public RiscvStaticInst + { + protected: + int64_t imm; + + /// Constructor + SBOp(const char *mnem, MachInst _machInst, OpClass __opClass) + : RiscvStaticInst(mnem, _machInst, __opClass),imm(0) + { + imm |= BIMM12BIT11 << 11; + imm |= BIMM12BITS4TO1 << 1; + imm |= BIMM12BITS10TO5 << 5; + if(IMMSIGN > 0) + imm |= ~((uint64_t)0xFFF); + } + + RiscvISA::PCState + branchTarget(const RiscvISA::PCState &branchPC) const; + + using StaticInst::branchTarget; + + std::string + generateDisassembly(Addr pc, const SymbolTable *symtab) const; + }; + + /** + * Base class for U-type operations + */ + class UOp : public RiscvStaticInst + { + protected: + int64_t imm; + + /// Constructor + UOp(const char *mnem, MachInst _machInst, OpClass __opClass) + : RiscvStaticInst(mnem, _machInst, __opClass), imm(0) + { + int32_t temp = IMM20 << 12; + imm = temp; + } + + std::string + generateDisassembly(Addr pc, const SymbolTable *symtab) const; + }; + + /** + * Base class for UJ-type operations + */ + class UJOp : public RiscvStaticInst + { + protected: + int64_t imm; + + /// Constructor + UJOp(const char *mnem, MachInst _machInst, OpClass __opClass) + : RiscvStaticInst(mnem, _machInst, __opClass),imm(0) + { + imm |= UJIMMBITS19TO12 << 12; + imm |= UJIMMBIT11 << 11; + imm |= UJIMMBITS10TO1 << 1; + if(IMMSIGN > 0) + imm |= ~((uint64_t)0xFFFFF); + } + + RiscvISA::PCState + branchTarget(const RiscvISA::PCState &branchPC) const; + + using StaticInst::branchTarget; + + std::string + generateDisassembly(Addr pc, const SymbolTable *symtab) const; + }; +}}; + +//Outputs to decoder.cc +output decoder {{ + std::string + ROp::generateDisassembly(Addr pc, const SymbolTable *symtab) const + { + std::stringstream ss; + ss << mnemonic << ' ' << regName(_destRegIdx[0]) << ", " + << regName(_srcRegIdx[0]) << ", " << regName(_srcRegIdx[1]); + return ss.str(); + } + + std::string + IOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const + { + std::stringstream ss; + ss << mnemonic << ' ' << regName(_destRegIdx[0]) << ", " + << regName(_srcRegIdx[0]) << ", " << imm; + return ss.str(); + } + + RiscvISA::PCState + Jump::branchTarget(ThreadContext *tc) const + { + PCState pc = tc->pcState(); + IntReg Rs1 = tc->readIntReg(_srcRegIdx[0]); + pc.set((Rs1 + imm)&~0x1); + return pc; + } + + std::string + SOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const + { + std::stringstream ss; + ss << mnemonic << ' ' << regName(_srcRegIdx[1]) << ", " + << imm << '(' << regName(_srcRegIdx[0]) << ')'; + return ss.str(); + } + + RiscvISA::PCState + SBOp::branchTarget(const RiscvISA::PCState &branchPC) const + { + return branchPC.pc() + imm; + } + + std::string + SBOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const + { + std::stringstream ss; + ss << mnemonic << ' ' << regName(_srcRegIdx[0]) << ", " + << regName(_srcRegIdx[1]) << ", " << imm; + return ss.str(); + } + + std::string + UOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const + { + std::stringstream ss; + ss << mnemonic << ' ' << regName(_destRegIdx[0]) << ", " << imm; + return ss.str(); + } + + RiscvISA::PCState + UJOp::branchTarget(const RiscvISA::PCState &branchPC) const + { + return branchPC.pc() + imm; + } + + std::string + UJOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const + { + std::stringstream ss; + ss << mnemonic << ' ' << regName(_destRegIdx[0]) << ", " << imm; + return ss.str(); + } +}}; + +def format ROp(code, *opt_flags) {{ + iop = InstObjParams(name, Name, 'ROp', code, opt_flags) + header_output = BasicDeclare.subst(iop) + decoder_output = BasicConstructor.subst(iop) + decode_block = BasicDecode.subst(iop) + exec_output = BasicExecute.subst(iop) +}}; + +def format IOp(code, *opt_flags) {{ + iop = InstObjParams(name, Name, 'IOp', code, opt_flags) + header_output = BasicDeclare.subst(iop) + decoder_output = BasicConstructor.subst(iop) + decode_block = BasicDecode.subst(iop) + exec_output = BasicExecute.subst(iop) +}}; + +def format Jump(code, *opt_flags) {{ + iop = InstObjParams(name, Name, 'Jump', code, opt_flags) + header_output = BasicDeclare.subst(iop) + decoder_output = BasicConstructor.subst(iop) + decode_block = BasicDecode.subst(iop) + exec_output = BasicExecute.subst(iop) +}}; + +def format SOp(code, *opt_flags) {{ + iop = InstObjParams(name, Name, 'SOp', code, opt_flags) + header_output = BasicDeclare.subst(iop) + decoder_output = BasicConstructor.subst(iop) + decode_block = BasicDecode.subst(iop) + exec_output = BasicExecute.subst(iop) +}}; + +def format SBOp(code, *opt_flags) {{ + iop = InstObjParams(name, Name, 'SBOp', code, opt_flags) + header_output = BasicDeclare.subst(iop) + decoder_output = BasicConstructor.subst(iop) + decode_block = BasicDecode.subst(iop) + exec_output = BasicExecute.subst(iop) +}}; + +def format UOp(code, *opt_flags) {{ + iop = InstObjParams(name, Name, 'UOp', code, opt_flags) + header_output = BasicDeclare.subst(iop) + decoder_output = BasicConstructor.subst(iop) + decode_block = BasicDecode.subst(iop) + exec_output = BasicExecute.subst(iop) +}}; + +def format UJOp(code, *opt_flags) {{ + iop = InstObjParams(name, Name, 'UJOp', code, opt_flags) + header_output = BasicDeclare.subst(iop) + decoder_output = BasicConstructor.subst(iop) + decode_block = BasicDecode.subst(iop) + exec_output = BasicExecute.subst(iop) +}}; diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/isa/formats/unknown.isa --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/isa/formats/unknown.isa Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,80 @@ +// -*- mode:c++ -*- + +// Copyright (c) 2015 Riscv Developers +// Copyright (c) 2016 The University of Virginia +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer; +// redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution; +// neither the name of the copyright holders nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Authors: Maxwell Walter +// Alec Roelke + +//////////////////////////////////////////////////////////////////// +// +// Unknown instructions +// + +output header {{ + /** + * Static instruction class for unknown (illegal) instructions. + * These cause simulator termination if they are executed in a + * non-speculative mode. This is a leaf class. + */ + class Unknown : public RiscvStaticInst + { + public: + /// Constructor + Unknown(MachInst _machInst) + : RiscvStaticInst("unknown", _machInst, No_OpClass) + { + flags[IsNonSpeculative] = true; + } + + %(BasicExecDeclare)s + + std::string + generateDisassembly(Addr pc, const SymbolTable *symtab) const; + }; +}}; + +output decoder {{ + std::string + Unknown::generateDisassembly(Addr pc, const SymbolTable *symtab) const + { + return csprintf("unknown opcode 0x%02x", OPCODE); + } +}}; + +output exec {{ + Fault + Unknown::execute(CPU_EXEC_CONTEXT *xc, Trace::InstRecord *traceData) const + { + Fault fault = std::make_shared(); + return fault; + } +}}; + +def format Unknown() {{ + decode_block = 'return new Unknown(machInst);\n' +}}; diff -r 8bc53d5565ba -r cceb2cc47bdd src/arch/riscv/isa/includes.isa --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/riscv/isa/includes.isa Thu Sep 15 20:52:22 2016 +0000 @@ -0,0 +1,90 @@ +// -*- mode:c++ -*- + +// Copyright (c) 2015 Riscv Developers +// Copyright (c) 2016 The University of Virginia +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer; +// redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution; +// neither the name of the copyright holders nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Authors: Maxwell Walter +// Alec Roelke + +//////////////////////////////////////////////////////////////////// +// +// Output include file directives. +// + +output header {{ +#include +#include +#include +#include +#include + +#include "cpu/static_inst.hh" +#include "mem/packet.hh" +#include "mem/request.hh" +}}; + +output decoder {{ +#include "arch/riscv/decoder.hh" + +#include +#include +#include +#include + +#include "arch/riscv/tlb.hh" +#include "arch/riscv/faults.hh" +#include "base/loader/symtab.hh" +#include "base/cprintf.hh" +#include "cpu/thread_context.hh" +#include "mem/packet.hh" +#include "mem/request.hh" +#include "sim/full_system.hh" + +using namespace RiscvISA; +}}; + +output exec {{ +#include +#include + +#include "sim/system.hh" +#include "arch/generic/memhelpers.hh" +#include "arch/riscv/registers.hh" +#include "arch/riscv/faults.hh" +#include "base/condcodes.hh" +#include "cpu/base.hh" +#include "cpu/exetrace.hh" +#include "mem/packet.hh" +#include "mem/packet_access.hh" +#include "mem/request.hh" +#include "sim/eventq.hh" +#include "sim/full_system.hh" +#include "sim/sim_events.hh" +#include "sim/sim_exit.hh" + +using namespace RiscvISA; +}};