mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-10 17:54:13 +00:00
m1n1.utils: Add align_pot()
Signed-off-by: Asahi Lina <lina@asahilina.net>
This commit is contained in:
parent
7b63613945
commit
e4810a452d
1 changed files with 6 additions and 0 deletions
|
@ -13,6 +13,12 @@ align = align_up
|
|||
def align_down(v, a=16384):
|
||||
return v & ~(a - 1)
|
||||
|
||||
def align_pot(v):
|
||||
out = 1
|
||||
while out < v:
|
||||
out *= 2
|
||||
return out
|
||||
|
||||
def hexdump(s, sep=" "):
|
||||
return sep.join(["%02x"%x for x in s])
|
||||
|
||||
|
|
Loading…
Reference in a new issue