| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: exec.c,v 1.23 2021/10/06 10:13:19 jmcneill Exp $ */ | | 1 | /* $NetBSD: exec.c,v 1.24 2023/06/14 10:26:45 rin Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2019 Jason R. Thorpe | | 4 | * Copyright (c) 2019 Jason R. Thorpe |
5 | * Copyright (c) 2018 Jared McNeill <jmcneill@invisible.ca> | | 5 | * Copyright (c) 2018 Jared McNeill <jmcneill@invisible.ca> |
6 | * All rights reserved. | | 6 | * All rights reserved. |
7 | * | | 7 | * |
8 | * Redistribution and use in source and binary forms, with or without | | 8 | * Redistribution and use in source and binary forms, with or without |
9 | * modification, are permitted provided that the following conditions | | 9 | * modification, are permitted provided that the following conditions |
10 | * are met: | | 10 | * are met: |
11 | * 1. Redistributions of source code must retain the above copyright | | 11 | * 1. Redistributions of source code must retain the above copyright |
12 | * notice, this list of conditions and the following disclaimer. | | 12 | * notice, this list of conditions and the following disclaimer. |
13 | * 2. Redistributions in binary form must reproduce the above copyright | | 13 | * 2. Redistributions in binary form must reproduce the above copyright |
14 | * notice, this list of conditions and the following disclaimer in the | | 14 | * notice, this list of conditions and the following disclaimer in the |
| @@ -99,27 +99,27 @@ load_file(const char *path, u_long extra | | | @@ -99,27 +99,27 @@ load_file(const char *path, u_long extra |
99 | close(fd); | | 99 | close(fd); |
100 | *paddr = 0; | | 100 | *paddr = 0; |
101 | return ENOMEM; | | 101 | return ENOMEM; |
102 | } | | 102 | } |
103 | | | 103 | |
104 | printf("boot: loading %s ", path); | | 104 | printf("boot: loading %s ", path); |
105 | len = read(fd, (void *)(uintptr_t)*paddr, expectedlen); | | 105 | len = read(fd, (void *)(uintptr_t)*paddr, expectedlen); |
106 | close(fd); | | 106 | close(fd); |
107 | | | 107 | |
108 | if (len != expectedlen) { | | 108 | if (len != expectedlen) { |
109 | if (len < 0) { | | 109 | if (len < 0) { |
110 | printf(": %s\n", strerror(errno)); | | 110 | printf(": %s\n", strerror(errno)); |
111 | } else { | | 111 | } else { |
112 | printf(": returned %ld (expected %ld)\n", len, | | 112 | printf(": returned %zd (expected %zd)\n", len, |
113 | expectedlen); | | 113 | expectedlen); |
114 | } | | 114 | } |
115 | return EIO; | | 115 | return EIO; |
116 | } | | 116 | } |
117 | | | 117 | |
118 | printf("done.\n"); | | 118 | printf("done.\n"); |
119 | | | 119 | |
120 | efi_dcache_flush(*paddr, *psize); | | 120 | efi_dcache_flush(*paddr, *psize); |
121 | | | 121 | |
122 | return 0; | | 122 | return 0; |
123 | } | | 123 | } |
124 | | | 124 | |
125 | static void | | 125 | static void |