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 

sceKernelAllocateFpl ?

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



Joined: 12 Jun 2008
Posts: 22
Location: Berkeley, CA

PostPosted: Fri Aug 29, 2008 9:54 pm    Post subject: sceKernelAllocateFpl ? Reply with quote

I sort of know it is used after sceKernelCreateFpl(), can anyone tell me where does this function allocate memory from? from the kernel memory or the user memory? If someone can point me to more infos about this function would be awesome, thinks!
Back to top
View user's profile Send private message
moonlight



Joined: 26 Oct 2005
Posts: 567

PostPosted: Fri Aug 29, 2008 11:23 pm    Post subject: Reply with quote

The second param indicates the partition, usually PSP_MEMORY_PARTITION_USER or PSP_MEMORY_PARTITION_KERNEL. It has no much secrets, the main difference of this function with others, is that this one enters in lock state until the memory can be allocated (or until an optional timeout has passed).

Allocate 4096 bytes:

Code:

void *buf;
SceUID fpl = sceKernelCreateFpl("MyFPL", PSP_MEMORY_PARTITION_USER, 0, 4096, 1, NULL);

if (fpl < 0)
   //handle error;

sceKernelAllocateFpl(fpl, &buf, NULL);
Back to top
View user's profile Send private message
sauron_le_noir



Joined: 05 Jul 2008
Posts: 229

PostPosted: Sat Aug 30, 2008 3:42 am    Post subject: Reply with quote

what is the advantage of using sceKernelAllocateFpl instead of malloc or sbrk ? Partition 2 for user mem is always present with the maximun memory or am i wrong
Back to top
View user's profile Send private message Send e-mail MSN Messenger
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