forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

vshBridge questions

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
phobox



Joined: 24 Mar 2008
Posts: 140

PostPosted: Sun Jul 12, 2009 7:54 am    Post subject: vshBridge questions Reply with quote

vshBridge is a wrapper for functions..

most of the exported functions (maybe all of them :)) do 3 particular things

1) check if the value returned by sceKernelGetUserLevel is < 4.
2) backup k1 and set k1 = k1 >> 16
3) call the original function and restore the k1

I have two questions:
what does it mean to have the value returned by sceKernelGetUserLevel less than 4?

and what happens by setting k1 = k1 >> 16?

whe use to set k1 to 0 to wrap kernel mode function to user mode app....

(a full list of vshBridge function and the corresponding sce* one coming soon)
_________________
Ciao! from Italy
Back to top
View user's profile Send private message
ab5000



Joined: 06 May 2008
Posts: 74

PostPosted: Sun Jul 12, 2009 9:13 pm    Post subject: Reply with quote

I'm sure step 1 checks if the calling thread can do that thing.
I saw the k1 = k1 >> 16 in most kernel functions. Probably the effective K1 is stored like this (shifted 16-bit right). When using k1 = 0 you don't notice this because 0 >> 16 = 0. (Just some guessing!).

Bye,
ab5000.
_________________
Code:
%:include<stdio.h>
int _(int __,int ___,int ____,int _____)
<%for(;____<___;_____=_____*__,____++);
return _____;%>main()<%printf
("%d\n",_(2,5,0,1));%>
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group