GithubHelp home page GithubHelp logo

Comments (12)

DaveeFTW avatar DaveeFTW commented on June 24, 2024 2

Ok I've given this some thought and think I'll write this to begin some discussion by laying out some ideas. Since we've already established headers and names for user types (so far), we should exclude them from these discussions and opt in for compatibility with existing homebrew.
Kernel API is a blank canvas for us, we're still in beta(tm) and can change as much as we want. So I suggest for kernel:

  • wherever possible take inspiration from user mode equivalents and suffix ForKernel. e.g, sceIoOpen to sceIoOpenForKernel. We would not use the ForDriver suffix.

For new contributions:

  • if we have an "official" name we will use it only for reference.
  • names will begin with sce prefix, followed by a reasonable* name or abbreviation for the module it belongs to.
  • names will be camelCaseStyle.

As such, all sce prefixes will be reserved by SDK.

  • I'm not sure what reasonable is, maybe we should create a table? The obvious exception is using sceKernel when it comes to the various `ForKernel`` libraries.

from vita-headers.

DaveeFTW avatar DaveeFTW commented on June 24, 2024 2

We could do two prefixes:

  • ksce for kernel functions
  • sce for user functions

This would make it very clear that the developer is using the intended function.

from vita-headers.

yifanlu avatar yifanlu commented on June 24, 2024 1

Another thing to consider is that some modules export for a ForDriver and ForKernel library with similar/same functionalities. Sometimes the NIDs are the same so it doesn't matter. But there might be (can't think of examples right now) functions whose NIDs are different but functionalities are the same.

from vita-headers.

173210 avatar 173210 commented on June 24, 2024

There are some other symbols which have different prefixes such as vsh. We may make clear what prefixes are reserved by the SDK.

from vita-headers.

d3m3vilurr avatar d3m3vilurr commented on June 24, 2024

how about just use k prefix or suffix for the kernel function?(like kSceIoOpen or sceIoOpenK)
ForKernel is too long suffix.

from vita-headers.

DaveeFTW avatar DaveeFTW commented on June 24, 2024

For the record: adding a kernel prefix is not a technical limitation but a purposeful constraint to clearly convey to the developer which library they're attempting to use. Otherwise a misguided developer may link their kernel plugin against the user stubs.

from vita-headers.

yifanlu avatar yifanlu commented on June 24, 2024

My two cents: I have no problems with verbosity (especially in the age of auto-complete) if it makes the intention obvious. However one problem I run into with the ForKernel stuff is in modulemgr when I have functions called "sceKernelLoadModuleForPidForKernel" where "ForPid" denotes who I am loading for (in terms of context) and "ForKernel" denotes who is doing the loading. That's confusing and "ksceKernelLoadModuleForPid" seems cleaner.

from vita-headers.

yifanlu avatar yifanlu commented on June 24, 2024

in terms of the k prefix, is it recommended that developers exporting functions follow suit? For example should I change it to ktaiHookForImport?

from vita-headers.

DaveeFTW avatar DaveeFTW commented on June 24, 2024

I would advise developers to have the k prefix for consistency, but of course not required. You bring a good point about auto-complete: it would be very effective using k prefix for this also.

from vita-headers.

DaveeFTW avatar DaveeFTW commented on June 24, 2024

I'm trying to not close your argument into a corner, but I think we'll need to find some sort of evidence to support that. In support/related, there are many kernel exports that are just wrappers for another export (be it ForKernel or ForDriver). How do we approach this?

from vita-headers.

frangarcj avatar frangarcj commented on June 24, 2024

I like the forkernel but maybe for auto completion is better to have a prefix
I won't remove the sce
And for the _ if there are no collisions I would remove it

from vita-headers.

yifanlu avatar yifanlu commented on June 24, 2024

Implemented in #99

from vita-headers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.