j
: Next unread message k
: Previous unread message j a
: Jump to all threads
j l
: Jump to MailingList overview
Author: mcayland Date: Sun Feb 16 17:26:37 2014 New Revision: 1266 URL: http://tracker.coreboot.org/trac/openbios/changeset/1266
Log: SPARC32: implement obp_dumb_memfree()
Signed-off-by: Olivier Danet odanet@caramail.com Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk
Modified: trunk/openbios-devel/arch/sparc32/lib.c trunk/openbios-devel/arch/sparc32/romvec.h
Modified: trunk/openbios-devel/arch/sparc32/lib.c ============================================================================== --- trunk/openbios-devel/arch/sparc32/lib.c Sun Feb 16 17:26:34 2014 (r1265) +++ trunk/openbios-devel/arch/sparc32/lib.c Sun Feb 16 17:26:37 2014 (r1266) @@ -239,10 +239,18 @@ return obp_memalloc(va, size, align); }
-void obp_dumb_memfree(__attribute__((unused))char *va, - __attribute__((unused))unsigned sz) +void obp_dumb_memfree(char *va, unsigned size) { - DPRINTF("obp_dumb_memfree 0x%p (size %d)\n", va, sz); + phys_addr_t phys; + ucell cellmode; + + DPRINTF("obp_dumb_memfree: virta 0x%x, sz %d\n", (unsigned int)va, size); + + phys = ofmem_translate(pointer2cell(va), &cellmode); + + ofmem_unmap(pointer2cell(va), size); + ofmem_release_virt(pointer2cell(va), size); + ofmem_release_phys(phys, size); }
/* Data fault handling routines */
Modified: trunk/openbios-devel/arch/sparc32/romvec.h ============================================================================== --- trunk/openbios-devel/arch/sparc32/romvec.h Sun Feb 16 17:26:34 2014 (r1265) +++ trunk/openbios-devel/arch/sparc32/romvec.h Sun Feb 16 17:26:37 2014 (r1266) @@ -31,8 +31,8 @@ int obp_inst2pkg_handler(int dev_desc); char *obp_dumb_memalloc(char *va, unsigned int size); char *obp_dumb_memalloc_handler(char *va, unsigned int size); -void obp_dumb_memfree(__attribute__((unused))char *va, __attribute__((unused))unsigned sz); -void obp_dumb_memfree_handler(__attribute__((unused))char *va, __attribute__((unused))unsigned sz); +void obp_dumb_memfree(char *va, unsigned size); +void obp_dumb_memfree_handler(char *va, unsigned size); char *obp_dumb_mmap(char *va, int which_io, unsigned int pa, unsigned int size); char *obp_dumb_mmap_handler(char *va, int which_io, unsigned int pa, unsigned int size); void obp_dumb_munmap(__attribute__((unused)) char *va, __attribute__((unused)) unsigned int size);