protected void mapAndBindSyscalls(Class<?> cls) {
		BidiMap<Long, String> mapNames =
			new DualHashBidiMap<>(EmuSyscallLibrary.loadSyscallNumberMap(program));
		Map<Long, PrototypeModel> mapConventions =
			EmuSyscallLibrary.loadSyscallConventionMap(program);
		Set<Method> methods = collectSyscalls(cls);
		for (Method m : methods) {
			String name = m.getAnnotation(EmuSyscall.class).value();
			Long number = mapNames.getKey(name);
			if (number == null) {
				Msg.warn(cls, "Syscall " + name + " has no number");
				continue;
			}
			PcodeUseropDefinition<T> opdef = getUserops().get(m.getName());
			if (opdef == null) {
				throw new IllegalArgumentException("Method " + m.getName() +
					" annotated with @" + EmuSyscall.class.getSimpleName() +
					" must also be a p-code userop");
			}
			PrototypeModel convention = mapConventions.get(number);
			EmuSyscallDefinition<T> existed =
				syscallMap.put(number, newBoundSyscall(opdef, convention));
			if (existed != null) {
				throw new IllegalArgumentException("Duplicate @" +
					EmuSyscall.class.getSimpleName() + " annotated methods with name " + name);
			}
		}
	}
Export a userop as a system call

@param opdef the userop
@return the syscall definition
Ghidra/Features/SystemEmulation/src/main/java/ghidra/pcode/emu/sys/AnnotatedEmuSyscallUseropLibrary.java