Skip to content

undefined reference to `ksceKernelCpuDcacheAndL2WritebackRange' #33

@MirrichWangD

Description

@MirrichWangD

These are the errors I get during compilation:

[  4%] Building C object CMakeFiles/modoru_kernel.dir/kernel.c.obj
/root/modoru/kernel.c: In function 'ksceKernelStartPreloadedModulesPatched':
/root/modoru/kernel.c:87:3: warning: implicit declaration of function 'ksceKernelSysrootGetProcessTitleId'; did you mean 'ksceKernelGetProcessId'? [-Wimplicit-function-declaration]
   87 |   ksceKernelSysrootGetProcessTitleId(pid, titleid, sizeof(titleid));
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |   ksceKernelGetProcessId
/root/modoru/kernel.c: In function 'nzero32':
/root/modoru/kernel.c:148:51: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
  148 |   cargs.list.lv1[0].addr = cargs.list.lv1[1].addr = 0x50000000;
      |                                                   ^
/root/modoru/kernel.c: In function 'ksceSblSmCommCallFuncPatched':
/root/modoru/kernel.c:178:11: warning: implicit declaration of function 'ksceKernelCpuDcacheAndL2WritebackRange' [-Wimplicit-function-declaration]
  178 |           ksceKernelCpuDcacheAndL2WritebackRange(spkg_header, sizeof(SpkgHeader));
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/root/modoru/kernel.c: In function 'k_modoru_get_factory_firmware':
/root/modoru/kernel.c:375:19: warning: implicit declaration of function 'ksceKernelSysrootGetKblParam' [-Wimplicit-function-declaration]
  375 |   void* sysroot = ksceKernelSysrootGetKblParam();
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/root/modoru/kernel.c:375:19: warning: initialization of 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
In file included from /usr/local/vitasdk/arm-vita-eabi/include/psp2kern/kernel/sysmem.h:19,
                 from /root/modoru/kernel.c:12:
/root/modoru/kernel.c: In function 'k_modoru_ctrl_peek_buffer_positive':
/root/modoru/kernel.c:402:32: warning: passing argument 1 of 'ksceKernelCopyToUser' makes pointer from integer without a cast [-Wint-conversion]
  402 |   ksceKernelMemcpyKernelToUser((uintptr_t)pad_data, &pad, sizeof(SceCtrlData));
      |                                ^
      |                                |
      |                                unsigned int
/usr/local/vitasdk/arm-vita-eabi/include/psp2kern/kernel/sysmem/data_transfers.h:69:32: note: expected 'void *' but argument is of type 'unsigned int'
   69 | int ksceKernelCopyToUser(void *dst, const void *src, SceSize len);
      |                          ~~~~~~^~~
[  8%] Linking C executable modoru_kernel
/usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.3.0/../../../../arm-vita-eabi/bin/ld: CMakeFiles/modoru_kernel.dir/kernel.c.obj: in function `ksceSblSmCommCallFuncPatched':
kernel.c:(.text+0x274): undefined reference to `ksceKernelCpuDcacheAndL2WritebackRange'
/usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.3.0/../../../../arm-vita-eabi/bin/ld: CMakeFiles/modoru_kernel.dir/spkg.c.obj: in function `decrypt_spkg':
spkg.c:(.text+0x3e6): undefined reference to `ksceKernelCpuDcacheAndL2WritebackRange'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/modoru_kernel.dir/build.make:113: modoru_kernel] Error 1
make[1]: *** [CMakeFiles/Makefile2:277: CMakeFiles/modoru_kernel.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

I think this is because the function ksceKernelCpuDcacheAndL2WritebackRange is not defined in psp2kern? Or is it because my version of vitasdk is too new that this function is not available? How can I solve this problem?

どうもありがとう

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions