mirror of
				https://gitlab.com/qemu-project/qboot.git
				synced 2024-02-13 08:33:40 +08:00 
			
		
		
		
	 96842c5a64
			
		
	
	96842c5a64
	
	
	
		
			
			inttypes.h is not part of the subset of standard headers for freestanding environments. Replace it with stdint.h. Also include string.h with quotes, since we provide it. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
		
			
				
	
	
		
			22 lines
		
	
	
		
			433 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			433 B
		
	
	
	
		
			C
		
	
	
	
	
	
| #include <stdint.h>
 | |
| #include "string.h"
 | |
| #include "bios.h"
 | |
| 
 | |
| static uint8_t *fseg_base = &edata;
 | |
| static uint8_t *malloc_top = &stext;
 | |
| 
 | |
| void *malloc_align(int n, int align)
 | |
| {
 | |
| 	malloc_top = (uint8_t *) ((uintptr_t)(malloc_top - n) & -align);
 | |
| 	return malloc_top;
 | |
| }
 | |
| 
 | |
| void *malloc_fseg_align(int n, int align)
 | |
| {
 | |
| 	void *p;
 | |
| 	fseg_base = (uint8_t *) (((uintptr_t)fseg_base + align - 1) & -align);
 | |
| 	p = fseg_base;
 | |
| 	fseg_base += n;
 | |
| 	return p;
 | |
| }
 |