Carl-Daniel Hailfinger wrote: > yhlu wrote: > >>just let the the uncompress take more parameter for the properties >>buf, and every cpu find the correct buffer in RAM in BSP should be >>OK...because the RAM on first node is ready at that time. > > > How about > > int uncompress_generic(void *src, void *dst, void *buf, int bufsize); > > and uncompress_generic can assume that buf can be treated like RAM. > If bufsize is too small, it can return an error. An additional function > > int needed_bufsize(void *src); > > could be written to compute the minimum buffer size for a given > compressed image. > > What do you think? > > > Regards, > Carl-Danie
int needed_bufsize(void *src); good. And in most cases it is: size = *(unsigned long *)src; int uncompress_generic(void *src, void *dst, void *buf) if the programmer is too stupid to call needed_bufsize, they're probably too stupid to pass in a correct bufsize to this function, I think it is not needed. ron -- linuxbios mailing list [email protected] http://www.openbios.org/mailman/listinfo/linuxbios
