tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: allocating memory during kernel startup



> I recently ran into this problem - there is no easy way to determine  
> wether it is safe to call kmem_alloc() yet ( as in, are we far enough  
> through startup ) and when we call it too early the whole thing just  
> hangs.
> Any chance to just have kmem_alloc() immediately return NULL if it  
> isn't ready yet so we can fail gracefully instead of hanging?

I guess you need it on console initialization.

Some ports have own flags that indicate malloc is safe
for early bus_space(9) ops:
 sys/arch/arc/arc/machdep.c:cpu_startup()
 sys/arch/arc/arc/bus_space.c:arc_bus_space_extent_malloc_flag()
etc.

I have no idea if we should have a more generic flag.
---
Izumi Tsutsui


Home | Main Index | Thread Index | Old Index