Chromium Code Reviews| Index: utility/fmap.c |
| diff --git a/utility/fmap.c b/utility/fmap.c |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..b9308b52e0d89dd6b88d5e7488a9838997104294 |
| --- /dev/null |
| +++ b/utility/fmap.c |
| @@ -0,0 +1,23 @@ |
| +/* |
|
Randall Spangler
2011/02/09 19:42:14
Move this to host/lib
Or firmware/lib if you're u
Che-Liang Chiou
2011/02/10 09:11:03
Done.
|
| + * Copyright (c) 2011 The Chromium OS Authors. All rights reserved. |
| + * Use of this source code is governed by a BSD-style license that can be |
| + * found in the LICENSE file. |
| + */ |
| + |
| +#include <errno.h> |
| +#include <stdio.h> |
| +#include <string.h> |
| + |
| +#include "fmap.h" |
| + |
| +/* Return NULL if fail */ |
| +char *find_fmap(char *ptr, size_t size) |
|
gauravsh
2011/02/09 19:58:22
since this is just a library, move to */lib
Che-Liang Chiou
2011/02/10 09:11:03
Done.
|
| +{ |
| + size_t i; |
| + for (i=0; i<size; i += FMAP_SEARCH_STRIDE) { |
| + if (0 == strncmp(ptr, "__FMAP__", 8)) |
| + return ptr; |
| + ptr += FMAP_SEARCH_STRIDE; |
| + } |
| + return NULL; |
| +} |