Compare commits
20 Commits
cherry-053
...
cherry-ccd
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1390c2ca1c | ||
|
|
6c0d08792a | ||
|
|
6abf0ca903 | ||
|
|
e2a14bdfdf | ||
|
|
e3a71c2b97 | ||
|
|
5029b8c91b | ||
|
|
205d4bc100 | ||
|
|
158eed28be | ||
|
|
9f80c4e055 | ||
|
|
f90fcc5d04 | ||
|
|
43f6682069 | ||
|
|
f592f31464 | ||
|
|
66a84bd92f | ||
|
|
6c01706217 | ||
|
|
7fcfe1cf74 | ||
|
|
009d7a540c | ||
|
|
da2dc9c0b5 | ||
|
|
6dd5a2b06b | ||
|
|
1523771f10 | ||
|
|
38a2583258 |
203
.pickman-history
203
.pickman-history
@@ -1,5 +1,75 @@
|
||||
## 2025-12-15: us/next
|
||||
|
||||
Branch: cherry-e5565c24bb4
|
||||
|
||||
Commits:
|
||||
- e5565c24bb4 pinctrl: exynos: fix type of count integer
|
||||
- 57e77dc80e0 arm: dts: e850-96: Remove TRNG node from appended dts
|
||||
- 895b54998e5 configs: khadas-vim3{l}: fix userdata size
|
||||
- ea2273911d3 arm: dts: meson: remove meson-a1.dtsi
|
||||
- a5ed242ba6a dt-bindings: remove a1 bindings from include/
|
||||
- 827edb6c00b dt-bindings: remove axg bindings from include/
|
||||
- 1cdb4e03e68 dt-bindings: interrupt-controller: remove arm-gic.h from include/
|
||||
- 030ec147af0 Merge tag 'u-boot-amlogic-next-20241113' of https://source.denx.de/u-boot/custodians/u-boot-amlogic into next
|
||||
|
||||
### Conversation log
|
||||
Let me find the repository first:
|
||||
|
||||
The repository has uncommitted changes. Let me stash them first, then proceed with the cherry-pick operation:
|
||||
|
||||
Now let me create and checkout the new branch based on ci/master:
|
||||
|
||||
Now let me cherry-pick the first commit:
|
||||
|
||||
The commit is empty (likely already applied to master). Let me skip it and move on:
|
||||
|
||||
Now cherry-pick the second commit:
|
||||
|
||||
Now the final commit is a merge commit, so we need to use `-m 1`:
|
||||
|
||||
All cherry-picks were empty (the commits are already in master). Let me verify with git log:
|
||||
|
||||
The branch shows no new commits were added because all 8 commits were already present in ci/master (they showed as empty cherry-picks). Let me verify this by checking the status vs ci/master:
|
||||
|
||||
Let me verify the commits are indeed in ci/master by checking if those commits exist in the history:
|
||||
|
||||
All 8 commits are already in ci/master. Let me run the build verification anyway since the branch is at ci/master state:
|
||||
|
||||
## Final Status Report
|
||||
|
||||
### Cherry-Pick Summary
|
||||
|
||||
All 8 commits were **SKIPPED** because they are already present in `ci/master`:
|
||||
|
||||
| Commit | Subject | Status |
|
||||
|--------|---------|--------|
|
||||
| e5565c24bb4 | pinctrl: exynos: fix type of count integer | Already in master |
|
||||
| 57e77dc80e0 | arm: dts: e850-96: Remove TRNG node from appended dts | Already in master |
|
||||
| 895b54998e5 | configs: khadas-vim3{l}: fix userdata size | Already in master |
|
||||
| ea2273911d3 | arm: dts: meson: remove meson-a1.dtsi | Already in master |
|
||||
| a5ed242ba6a | dt-bindings: remove a1 bindings from include/ | Already in master |
|
||||
| 827edb6c00b | dt-bindings: remove axg bindings from include/ | Already in master |
|
||||
| 1cdb4e03e68 | dt-bindings: interrupt-controller: remove arm-gic.h from include/ | Already in master |
|
||||
| 030ec147af0 | Merge tag 'u-boot-amlogic-next-20241113' | Already in master |
|
||||
|
||||
### Branch Status
|
||||
- **Branch `cherry-e5565c24bb4`** was created but is identical to `ci/master` (0 commits ahead)
|
||||
- No new commits to push since all cherry-picks were empty
|
||||
|
||||
### Build Result
|
||||
- **Build: OK** ✓
|
||||
- sandbox built successfully with no warnings or errors
|
||||
|
||||
### Fix-ups Made
|
||||
- None required
|
||||
|
||||
### Notes
|
||||
The requested commits have already been merged into `ci/master` previously, so there are no new changes to cherry-pick. The branch `cherry-e5565c24bb4` is left at `ci/master` HEAD.
|
||||
|
||||
---
|
||||
|
||||
## 2025-12-15: us/next
|
||||
|
||||
Branch: cherry-a8c07ac4970
|
||||
|
||||
Commits:
|
||||
@@ -303,129 +373,80 @@ Branch `cherry-6e18eec9080` is ready for pushing and is ahead of `ci/master` by
|
||||
|
||||
## 2025-12-16: us/next
|
||||
|
||||
Branch: cherry-e5565c24bb4
|
||||
Branch: cherry-05396fb7245
|
||||
|
||||
Commits:
|
||||
- e5565c24bb4 pinctrl: exynos: fix type of count integer
|
||||
- 57e77dc80e0 arm: dts: e850-96: Remove TRNG node from appended dts
|
||||
- 65b38a519b0 Revert "efi_memory: do not add U-Boot memory to the memory map"
|
||||
- a37064cb2e4 net: lwip: wget: fix legacy syntax
|
||||
- 57b6fb7eb1f Makefile: avoid non-standard sed expressions
|
||||
- 6e3e72ed4e9 arm: dts: socfpga: remove spurious execute permission from dt files
|
||||
- 12fcb982575 powerpc/t2080qds: remove spurious x permission from README file
|
||||
- 03e57244bc2 binman: Avoid skipping binman_init()
|
||||
- 924a5e4e41e Revert "global_data: Drop spl_handoff"
|
||||
- acab6e78aca common: relocate fdt_blob in global_data for FDTSRC_EMBED case
|
||||
- 0bbc17f06bf configs: e850-96: Disable PSCI reset
|
||||
- f96e5133184 Merge branch 'master' of https://gitlab.denx.de/u-boot/custodians/u-boot-samsung
|
||||
- 05396fb7245 efi_loader: Check for a valid fw_name before auto generating GUIDs
|
||||
- 1d9aa4a283d lmb: Fix the allocation of overlapping memory areas with !LMB_NONE
|
||||
- ac3428fcc7b Merge tag 'efi-master-05122024' of https://source.denx.de/u-boot/custodians/u-boot-tpm
|
||||
|
||||
### Conversation log
|
||||
The working tree is clean. Now let me create and checkout the new branch based on ci/master:
|
||||
The repository is clean (untracked files don't affect cherry-picking). Now let me create and checkout a new branch based on ci/master:
|
||||
|
||||
Now let me cherry-pick each commit in order. Let me start with the first one:
|
||||
Now let me check the commit messages to determine which are merge commits:
|
||||
|
||||
The first commit is already included in ci/master. Let me commit it as empty to preserve the history:
|
||||
The first two are regular commits, and the third one (ac3428fcc7b) is a merge commit. Let me cherry-pick them one at a time:
|
||||
|
||||
There's a conflict. Let me look at the conflicting file:
|
||||
**Cherry-pick 1: 05396fb7245 (regular commit)**
|
||||
|
||||
Let me examine the full context to understand the conflict better:
|
||||
There's a conflict. Let me examine it:
|
||||
|
||||
I see the conflict. The HEAD already has the code wrapped in `if (!IS_ENABLED(CONFIG_SANDBOX))`. The incoming commit (the revert) wants to add the U-Boot code unconditionally. The conflict is that HEAD has the SANDBOX check which is a more refined version, but the incoming commit removes the SANDBOX check.
|
||||
I see the conflict. The base branch has `gen_v5_guid_le` with a different formatting, while the incoming commit uses `gen_v5_guid` with `uint16_t`. Let me check what version is in the base:
|
||||
|
||||
Looking at the intent: the revert commit is trying to restore the original behavior of adding U-Boot to the memory map (unconditionally). However, HEAD has a newer fix that adds the SANDBOX check. The incoming code after the markers also adds the U-Boot code unconditionally.
|
||||
The base already has the fix (fw_name check and early return). The incoming commit introduces the same check but with a different function name (`gen_v5_guid` vs `gen_v5_guid_le`) and type (`uint16_t` vs `u16`). The base version (`gen_v5_guid_le` with `u16`) is the correct one to keep. This commit's primary change (the fw_name check) is already present. Let me resolve this by keeping the HEAD version:
|
||||
|
||||
This would result in duplicate code if both are kept. The correct resolution is to accept the incoming changes (the revert) which removes the SANDBOX check for the "Add U-Boot" section, since that's what the revert is meant to do, but we already have an improved version in HEAD.
|
||||
The cherry-pick is empty because the changes are already applied in the base. Since the changes are already present, I'll skip this commit as it adds nothing new:
|
||||
|
||||
Looking more carefully:
|
||||
- HEAD code: has the SANDBOX check wrapping the U-Boot add
|
||||
- Incoming (revert): wants to add U-Boot unconditionally (no SANDBOX check)
|
||||
**Cherry-pick 2: 1d9aa4a283d (regular commit)**
|
||||
|
||||
Since the base already has the improved SANDBOX check, and the "revert" wants to undo some changes - the safest resolution is to keep HEAD's version which has the proper SANDBOX wrapper. Let me check what the original commit being reverted was doing:
|
||||
Second commit applied successfully.
|
||||
|
||||
Now I understand. The revert is adding back the "Add U-Boot" code. In HEAD (ci/master), there's already code that does this but wrapped with `if (!IS_ENABLED(CONFIG_SANDBOX))`. The revert would add the code unconditionally.
|
||||
**Cherry-pick 3: ac3428fcc7b (merge commit)**
|
||||
|
||||
Since ci/master already has a version of this change with a proper SANDBOX check (which is arguably better), and this revert would result in duplicate code if both sections remain, the best resolution is to keep only HEAD's version. The functional effect of the revert (adding U-Boot to memory map) is already achieved by HEAD's code, just with a better SANDBOX guard.
|
||||
There's a conflict in the merge commit. Let me examine it:
|
||||
|
||||
Let me resolve the conflict by keeping HEAD's version (which already has the functionality that the revert was supposed to add back):
|
||||
Same conflict as before. The HEAD version with `gen_v5_guid_le` and `u16` is the correct one. Let me resolve it:
|
||||
|
||||
This is a more complex conflict due to refactoring. The code style changed from `init_sequence_f[]` array to `INITCALL()` macros. Let me look at the full context:
|
||||
The merge commit is empty after resolution, but as instructed, I must preserve merge commits even if empty for history tracking:
|
||||
|
||||
I see. The HEAD version uses the new `INITCALL()` macro style and already has `INITCALL(setup_spl_handoff);` after the `#endif`. The incoming commit (the revert) is in the old array style and is trying to add `setup_spl_handoff,` and `bloblist_maybe_init,`.
|
||||
Now let me verify the results:
|
||||
|
||||
Looking at what the revert is trying to do - it wants to:
|
||||
1. Change `bloblist_init` to `bloblist_maybe_init`
|
||||
2. Add `setup_spl_handoff` call
|
||||
I see only 2 of the 3 commits are present. The first commit (05396fb7245 - efi_loader) was skipped because it was already fully applied. Let me verify this is correct:
|
||||
|
||||
The HEAD version already has `setup_spl_handoff` call, but uses `bloblist_init` instead of `bloblist_maybe_init`. Let me check if `bloblist_maybe_init` exists:
|
||||
Confirmed - commit 05396fb7245 already exists in ci/master as 0bdbf20cbfc. This is why the cherry-pick was empty.
|
||||
|
||||
Now I understand. The revert adds:
|
||||
1. The `setup_spl_handoff()` function definition (around line 305)
|
||||
2. Adds `setup_spl_handoff` call to the init sequence
|
||||
3. Uses `bloblist_maybe_init` (old name)
|
||||
Now let me run the build verification:
|
||||
|
||||
HEAD already has `INITCALL(setup_spl_handoff)` but the revert wanted to add it. The HEAD version uses `bloblist_init` while the revert uses `bloblist_maybe_init`.
|
||||
Build completed successfully. Let me check for any warnings:
|
||||
|
||||
Let me check if HEAD has the `setup_spl_handoff` function and what bloblist function is correct:
|
||||
Build completed successfully with no errors.
|
||||
|
||||
HEAD has `setup_spl_handoff` function and both old array style (line 908 within the conflict markers) and new INITCALL style (line 913).
|
||||
---
|
||||
|
||||
Let me look at the actual file to understand the context better:
|
||||
## Final Status Report
|
||||
|
||||
I see lines 900 and 907 showing both `INITCALL(bloblist_init)` and `bloblist_maybe_init`. The conflict shows both versions in the conflict markers.
|
||||
### Cherry-pick Summary
|
||||
|
||||
Let me resolve this conflict. The key changes from the revert are:
|
||||
1. Add `setup_spl_handoff` function - already present in HEAD
|
||||
2. Add `setup_spl_handoff` call - already present in HEAD as `INITCALL(setup_spl_handoff)`
|
||||
3. The revert uses `bloblist_maybe_init` while HEAD uses `bloblist_init`
|
||||
|
||||
Since HEAD already has both the function and the call to `setup_spl_handoff`, the key difference is just the bloblist function name. Let me check what's the correct one:
|
||||
|
||||
There is no `bloblist_maybe_init` function in HEAD - only `bloblist_init` exists. This is because HEAD has a newer codebase where the function was renamed/consolidated. The revert is for an older version.
|
||||
|
||||
Since HEAD already incorporates the essential change (adding `setup_spl_handoff`), I should keep HEAD's version. The resolution is to accept HEAD's code:
|
||||
|
||||
Now the last one is a merge commit. Let me cherry-pick it with `-m 1 --allow-empty`:
|
||||
|
||||
All cherry-picks are complete. Let me verify with `git log`:
|
||||
|
||||
All 12 commits have been cherry-picked successfully. Now let me run the build verification:
|
||||
|
||||
The build completed successfully. Let me provide a final summary:
|
||||
|
||||
## Summary
|
||||
|
||||
### Cherry-pick Results
|
||||
|
||||
All 12 commits were successfully cherry-picked from `us/next` to the new branch `cherry-e5565c24bb4`:
|
||||
|
||||
| # | Commit | Subject | Status |
|
||||
|---|--------|---------|--------|
|
||||
| 1 | e5565c24bb4 | pinctrl: exynos: fix type of count integer | Empty (already in ci/master) |
|
||||
| 2 | 57e77dc80e0 | arm: dts: e850-96: Remove TRNG node from appended dts | Empty (already in ci/master) |
|
||||
| 3 | 65b38a519b0 | Revert "efi_memory: do not add U-Boot memory to the memory map" | Empty - conflict resolved, ci/master already has this with SANDBOX check |
|
||||
| 4 | a37064cb2e4 | net: lwip: wget: fix legacy syntax | Empty (already in ci/master) |
|
||||
| 5 | 57b6fb7eb1f | Makefile: avoid non-standard sed expressions | ✅ Applied |
|
||||
| 6 | 6e3e72ed4e9 | arm: dts: socfpga: remove spurious execute permission from dt files | ✅ Applied |
|
||||
| 7 | 12fcb982575 | powerpc/t2080qds: remove spurious x permission from README file | ✅ Applied |
|
||||
| 8 | 03e57244bc2 | binman: Avoid skipping binman_init() | Empty (already in ci/master) |
|
||||
| 9 | 924a5e4e41e | Revert "global_data: Drop spl_handoff" | Empty - conflict resolved, ci/master already has setup_spl_handoff |
|
||||
| 10 | acab6e78aca | common: relocate fdt_blob in global_data for FDTSRC_EMBED case | ✅ Applied |
|
||||
| 11 | 0bbc17f06bf | configs: e850-96: Disable PSCI reset | ✅ Applied |
|
||||
| 12 | f96e5133184 | Merge branch 'master' of u-boot-samsung | Empty (merge commit preserved) |
|
||||
|
||||
### Conflicts Resolved
|
||||
|
||||
1. **lib/efi_loader/efi_memory.c** (commit 65b38a519b0): ci/master already had the same fix with an improved SANDBOX check. Resolved by keeping ci/master version.
|
||||
|
||||
2. **common/board_f.c** (commit 924a5e4e41e): ci/master already had `setup_spl_handoff` function and call with updated INITCALL style. Resolved by keeping ci/master version.
|
||||
| Commit | Subject | Status |
|
||||
|--------|---------|--------|
|
||||
| 05396fb7245 | efi_loader: Check for a valid fw_name before auto generating GUIDs | **SKIPPED** - Already present in ci/master as 0bdbf20cbfc |
|
||||
| 1d9aa4a283d | lmb: Fix the allocation of overlapping memory areas with !LMB_NONE | **SUCCESS** - Applied as 253acd465e2 |
|
||||
| ac3428fcc7b | Merge tag 'efi-master-05122024' | **SUCCESS** - Applied as 86002525021 (empty commit preserved for history) |
|
||||
|
||||
### Build Result
|
||||
**OK** - Build completed successfully with no warnings or errors.
|
||||
|
||||
✅ **Build OK** - sandbox board built successfully with no errors or warnings.
|
||||
### Fix-ups Made
|
||||
- **05396fb7245**: Conflict in `lib/efi_loader/efi_firmware.c` - resolved by keeping HEAD version (commit already present in ci/master)
|
||||
- **ac3428fcc7b**: Conflict in `lib/efi_loader/efi_firmware.c` - resolved by keeping HEAD version. Commit preserved as empty to maintain merge history.
|
||||
|
||||
### Branch Status
|
||||
### Current Branch State
|
||||
```
|
||||
Branch: cherry-05396fb7245
|
||||
Commits ahead of ci/master: 2
|
||||
```
|
||||
|
||||
The branch `cherry-e5565c24bb4` is ready for pushing with 12 commits ahead of `ci/master`.
|
||||
The branch is ready for pushing.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -248,6 +248,7 @@
|
||||
#include <g_dnl.h>
|
||||
#include <dm/devres.h>
|
||||
#include <linux/bug.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
#include <linux/err.h>
|
||||
#include <linux/usb/ch9.h>
|
||||
@@ -278,10 +279,11 @@ static const char fsg_string_interface[] = "Mass Storage";
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
#define GFP_ATOMIC ((gfp_t) 0)
|
||||
#define PAGE_CACHE_SHIFT 12
|
||||
#define PAGE_CACHE_SIZE (1 << PAGE_CACHE_SHIFT)
|
||||
#ifndef kthread_create
|
||||
#define kthread_create(...) __builtin_return_address(0)
|
||||
#endif
|
||||
#define wait_for_completion(...) do {} while (0)
|
||||
|
||||
struct kref {int x; };
|
||||
|
||||
@@ -605,7 +605,9 @@ static inline ino_t parent_ino(struct dentry *dentry)
|
||||
|
||||
/* debug.c */
|
||||
|
||||
#ifndef module_param_named
|
||||
#define module_param_named(...)
|
||||
#endif
|
||||
|
||||
/* misc.h */
|
||||
#define mutex_lock_nested(...)
|
||||
|
||||
27
include/linux/capability.h
Normal file
27
include/linux/capability.h
Normal file
@@ -0,0 +1,27 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* This is <linux/capability.h>
|
||||
*
|
||||
* Andrew G. Morgan <morgan@kernel.org>
|
||||
* Alexander Kjeldaas <astor@guardian.no>
|
||||
* with help from Aleph1, Roland Buresund and Andrew Main.
|
||||
*
|
||||
* Stub definitions for Linux kernel capabilities.
|
||||
* U-Boot doesn't implement capability checks.
|
||||
*/
|
||||
#ifndef _LINUX_CAPABILITY_H
|
||||
#define _LINUX_CAPABILITY_H
|
||||
|
||||
#define CAP_SYS_RESOURCE 24
|
||||
|
||||
static inline bool capable(int cap)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline bool ns_capable(void *ns, int cap)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif /* _LINUX_CAPABILITY_H */
|
||||
@@ -11,7 +11,22 @@
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/cred.h>
|
||||
#include <linux/export.h>
|
||||
#include <linux/freezer.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/kthread.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/random.h>
|
||||
#include <linux/rwsem.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/timer.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/vmalloc.h>
|
||||
#include <linux/wait.h>
|
||||
#include <linux/workqueue.h>
|
||||
|
||||
#ifdef CONFIG_XEN
|
||||
#include <xen/events.h>
|
||||
@@ -20,71 +35,6 @@
|
||||
struct unused {};
|
||||
typedef struct unused unused_t;
|
||||
|
||||
struct p_current{
|
||||
int pid;
|
||||
};
|
||||
|
||||
extern struct p_current *current;
|
||||
|
||||
#define GFP_ATOMIC ((gfp_t) 0)
|
||||
#define GFP_KERNEL ((gfp_t) 0)
|
||||
#define GFP_NOFS ((gfp_t) 0)
|
||||
#define GFP_USER ((gfp_t) 0)
|
||||
#define __GFP_NOWARN ((gfp_t) 0)
|
||||
#define __GFP_ZERO ((__force gfp_t)0x8000u) /* Return zeroed page on success */
|
||||
|
||||
void *kmalloc(size_t size, int flags);
|
||||
|
||||
static inline void *kzalloc(size_t size, gfp_t flags)
|
||||
{
|
||||
return kmalloc(size, flags | __GFP_ZERO);
|
||||
}
|
||||
|
||||
static inline void *kmalloc_array(size_t n, size_t size, gfp_t flags)
|
||||
{
|
||||
if (size != 0 && n > SIZE_MAX / size)
|
||||
return NULL;
|
||||
return kmalloc(n * size, flags | __GFP_ZERO);
|
||||
}
|
||||
|
||||
static inline void *kcalloc(size_t n, size_t size, gfp_t flags)
|
||||
{
|
||||
return kmalloc_array(n, size, flags | __GFP_ZERO);
|
||||
}
|
||||
|
||||
#define vmalloc(size) kmalloc(size, 0)
|
||||
#define __vmalloc(size, flags, pgsz) kmalloc(size, flags)
|
||||
static inline void *vzalloc(unsigned long size)
|
||||
{
|
||||
return kzalloc(size, 0);
|
||||
}
|
||||
static inline void kfree(const void *block)
|
||||
{
|
||||
free((void *)block);
|
||||
}
|
||||
static inline void vfree(const void *addr)
|
||||
{
|
||||
free((void *)addr);
|
||||
}
|
||||
|
||||
struct kmem_cache { int sz; };
|
||||
|
||||
struct kmem_cache *get_mem(int element_sz);
|
||||
#define kmem_cache_create(a, sz, c, d, e) get_mem(sz)
|
||||
void *kmem_cache_alloc(struct kmem_cache *obj, int flag);
|
||||
static inline void kmem_cache_free(struct kmem_cache *cachep, void *obj)
|
||||
{
|
||||
free(obj);
|
||||
}
|
||||
static inline void kmem_cache_destroy(struct kmem_cache *cachep)
|
||||
{
|
||||
free(cachep);
|
||||
}
|
||||
|
||||
#define DECLARE_WAITQUEUE(...) do { } while (0)
|
||||
#define add_wait_queue(...) do { } while (0)
|
||||
#define remove_wait_queue(...) do { } while (0)
|
||||
|
||||
#ifndef CONFIG_XEN
|
||||
#define eventchn_poll()
|
||||
#endif
|
||||
@@ -138,8 +88,6 @@ static inline void kmem_cache_destroy(struct kmem_cache *cachep)
|
||||
#define PAGE_SIZE 4096
|
||||
#endif
|
||||
|
||||
/* drivers/char/random.c */
|
||||
#define get_random_bytes(...)
|
||||
|
||||
/* include/linux/leds.h */
|
||||
struct led_trigger {};
|
||||
@@ -176,23 +124,6 @@ typedef unsigned long sector_t;
|
||||
typedef unsigned long blkcnt_t;
|
||||
#endif
|
||||
|
||||
/* module */
|
||||
#define THIS_MODULE 0
|
||||
#define try_module_get(...) 1
|
||||
#define module_put(...) do { } while (0)
|
||||
#define module_init(...)
|
||||
#define module_exit(...)
|
||||
#define EXPORT_SYMBOL(...)
|
||||
#define EXPORT_SYMBOL_GPL(...)
|
||||
#define module_param(...)
|
||||
#define module_param_call(...)
|
||||
#define MODULE_PARM_DESC(...)
|
||||
#define MODULE_VERSION(...)
|
||||
#define MODULE_DESCRIPTION(...)
|
||||
#define MODULE_AUTHOR(...)
|
||||
#define MODULE_LICENSE(...)
|
||||
#define MODULE_ALIAS(...)
|
||||
#define __module_get(...)
|
||||
|
||||
/* character device */
|
||||
#define MKDEV(...) 0
|
||||
@@ -213,8 +144,6 @@ typedef unsigned long blkcnt_t;
|
||||
|
||||
#define blocking_notifier_call_chain(...) 0
|
||||
|
||||
#define __initdata
|
||||
#define late_initcall(...)
|
||||
|
||||
#define dev_set_name(...) do { } while (0)
|
||||
#define device_register(...) 0
|
||||
@@ -222,29 +151,12 @@ typedef unsigned long blkcnt_t;
|
||||
#define volume_sysfs_init(...) 0
|
||||
#define volume_sysfs_close(...) do { } while (0)
|
||||
|
||||
#define init_waitqueue_head(...) do { } while (0)
|
||||
#define wait_event_interruptible(...) 0
|
||||
#define wake_up_interruptible(...) do { } while (0)
|
||||
#define dump_stack(...) do { } while (0)
|
||||
|
||||
#define task_pid_nr(x) 0
|
||||
#define set_freezable(...) do { } while (0)
|
||||
#define try_to_freeze(...) 0
|
||||
#define set_current_state(...) do { } while (0)
|
||||
#define kthread_should_stop(...) 0
|
||||
|
||||
#define setup_timer(timer, func, data) do {} while (0)
|
||||
#define del_timer_sync(timer) do {} while (0)
|
||||
#define schedule_work(work) do {} while (0)
|
||||
#define INIT_WORK(work, fun) do {} while (0)
|
||||
|
||||
struct work_struct {};
|
||||
|
||||
unsigned long copy_from_user(void *dest, const void *src,
|
||||
unsigned long count);
|
||||
|
||||
typedef unused_t spinlock_t;
|
||||
typedef int wait_queue_head_t;
|
||||
|
||||
#define spin_lock_init(lock) do {} while (0)
|
||||
#define spin_lock(lock) do {} while (0)
|
||||
@@ -257,33 +169,9 @@ typedef int wait_queue_head_t;
|
||||
#define mutex_lock(...)
|
||||
#define mutex_unlock(...)
|
||||
|
||||
#define init_rwsem(...) do { } while (0)
|
||||
#define down_read(...) do { } while (0)
|
||||
#define down_write(...) do { } while (0)
|
||||
#define down_write_trylock(...) 1
|
||||
#define up_read(...) do { } while (0)
|
||||
#define up_write(...) do { } while (0)
|
||||
|
||||
#define cond_resched() do { } while (0)
|
||||
#define yield() do { } while (0)
|
||||
|
||||
#define __init
|
||||
#define __exit
|
||||
#define __devinit
|
||||
#define __devinitdata
|
||||
#define __devinitconst
|
||||
#define __initconst
|
||||
#define __initdata
|
||||
|
||||
#define kthread_create(...) __builtin_return_address(0)
|
||||
#define kthread_stop(...) do { } while (0)
|
||||
#define wake_up_process(...) do { } while (0)
|
||||
|
||||
struct rw_semaphore { int i; };
|
||||
#define down_write(...) do { } while (0)
|
||||
#define up_write(...) do { } while (0)
|
||||
#define down_read(...) do { } while (0)
|
||||
#define up_read(...) do { } while (0)
|
||||
struct device {
|
||||
struct device *parent;
|
||||
struct class *class;
|
||||
@@ -304,15 +192,7 @@ struct cdev {
|
||||
#define cdev_add(...) 0
|
||||
#define cdev_del(...) do { } while (0)
|
||||
|
||||
#define prandom_u32(...) 0
|
||||
|
||||
typedef struct {
|
||||
uid_t val;
|
||||
} kuid_t;
|
||||
|
||||
typedef struct {
|
||||
gid_t val;
|
||||
} kgid_t;
|
||||
|
||||
/* from include/linux/types.h */
|
||||
|
||||
@@ -360,11 +240,9 @@ struct writeback_control {
|
||||
unsigned for_sync:1; /* sync(2) WB_SYNC_ALL writeback */
|
||||
};
|
||||
|
||||
void *kmemdup(const void *src, size_t len, gfp_t gfp);
|
||||
|
||||
typedef int irqreturn_t;
|
||||
|
||||
struct timer_list {};
|
||||
struct notifier_block {};
|
||||
|
||||
typedef unsigned long dmaaddr_t;
|
||||
|
||||
53
include/linux/cred.h
Normal file
53
include/linux/cred.h
Normal file
@@ -0,0 +1,53 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
/* Credentials management - see Documentation/security/credentials.rst
|
||||
*
|
||||
* Copyright (C) 2008 Red Hat, Inc. All Rights Reserved.
|
||||
* Written by David Howells (dhowells@redhat.com)
|
||||
*/
|
||||
#ifndef _LINUX_CRED_H
|
||||
#define _LINUX_CRED_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
/*
|
||||
* Stub definitions for Linux kernel credentials.
|
||||
* U-Boot doesn't implement user credentials.
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
uid_t val;
|
||||
} kuid_t;
|
||||
|
||||
typedef struct {
|
||||
gid_t val;
|
||||
} kgid_t;
|
||||
|
||||
struct cred {
|
||||
kuid_t uid;
|
||||
kgid_t gid;
|
||||
kuid_t fsuid;
|
||||
kgid_t fsgid;
|
||||
};
|
||||
|
||||
#define current_cred() NULL
|
||||
#define current_uid() ((kuid_t){0})
|
||||
#define current_gid() ((kgid_t){0})
|
||||
#define current_fsuid() ((kuid_t){0})
|
||||
#define current_fsgid() ((kgid_t){0})
|
||||
|
||||
#define from_kuid(ns, uid) ((uid).val)
|
||||
#define from_kgid(ns, gid) ((gid).val)
|
||||
#define make_kuid(ns, uid) ((kuid_t){uid})
|
||||
#define make_kgid(ns, gid) ((kgid_t){gid})
|
||||
|
||||
#define uid_eq(a, b) ((a).val == (b).val)
|
||||
#define gid_eq(a, b) ((a).val == (b).val)
|
||||
#define uid_valid(uid) ((uid).val != (uid_t)-1)
|
||||
#define gid_valid(gid) ((gid).val != (gid_t)-1)
|
||||
|
||||
#define GLOBAL_ROOT_UID ((kuid_t){0})
|
||||
#define GLOBAL_ROOT_GID ((kgid_t){0})
|
||||
#define INVALID_UID ((kuid_t){-1})
|
||||
#define INVALID_GID ((kgid_t){-1})
|
||||
|
||||
#endif /* _LINUX_CRED_H */
|
||||
14
include/linux/export.h
Normal file
14
include/linux/export.h
Normal file
@@ -0,0 +1,14 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#ifndef _LINUX_EXPORT_H
|
||||
#define _LINUX_EXPORT_H
|
||||
|
||||
/*
|
||||
* Stub definitions for Linux kernel module exports.
|
||||
* U-Boot doesn't use modules, so these are no-ops.
|
||||
*/
|
||||
#define EXPORT_SYMBOL(sym)
|
||||
#define EXPORT_SYMBOL_GPL(sym)
|
||||
#define EXPORT_SYMBOL_NS(sym, ns)
|
||||
#define EXPORT_SYMBOL_NS_GPL(sym, ns)
|
||||
|
||||
#endif /* _LINUX_EXPORT_H */
|
||||
29
include/linux/file.h
Normal file
29
include/linux/file.h
Normal file
@@ -0,0 +1,29 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Wrapper functions for accessing the file_struct fd array.
|
||||
*/
|
||||
#ifndef _LINUX_FILE_H
|
||||
#define _LINUX_FILE_H
|
||||
|
||||
/*
|
||||
* Stub definitions for Linux kernel file handling.
|
||||
*/
|
||||
|
||||
struct file;
|
||||
struct fd {
|
||||
struct file *file;
|
||||
unsigned int flags;
|
||||
};
|
||||
|
||||
#define EMPTY_FD ((struct fd){ NULL, 0 })
|
||||
|
||||
static inline struct fd fdget(unsigned int fd)
|
||||
{
|
||||
return EMPTY_FD;
|
||||
}
|
||||
|
||||
static inline void fdput(struct fd fd)
|
||||
{
|
||||
}
|
||||
|
||||
#endif /* _LINUX_FILE_H */
|
||||
17
include/linux/freezer.h
Normal file
17
include/linux/freezer.h
Normal file
@@ -0,0 +1,17 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/* Freezer declarations
|
||||
*
|
||||
* Stub definitions for Linux kernel freezer (suspend/hibernate).
|
||||
* U-Boot doesn't support process freezing.
|
||||
*/
|
||||
#ifndef _LINUX_FREEZER_H
|
||||
#define _LINUX_FREEZER_H
|
||||
|
||||
#define set_freezable() do { } while (0)
|
||||
#define try_to_freeze() 0
|
||||
#define freezing(task) 0
|
||||
#define frozen(task) 0
|
||||
#define freezable_schedule() do { } while (0)
|
||||
#define freezable_schedule_timeout(t) 0
|
||||
|
||||
#endif /* _LINUX_FREEZER_H */
|
||||
49
include/linux/init.h
Normal file
49
include/linux/init.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* These macros are used to mark some functions or initialized data
|
||||
* as 'initialization' functions. The kernel can take this as hint
|
||||
* that the function is used only during the initialization phase
|
||||
* and free up used memory resources after.
|
||||
*
|
||||
* Stub definitions for Linux kernel initialization macros.
|
||||
* U-Boot has its own initialization mechanism.
|
||||
*/
|
||||
#ifndef _LINUX_INIT_H
|
||||
#define _LINUX_INIT_H
|
||||
|
||||
/* Section markers - these are no-ops in U-Boot */
|
||||
#define __init
|
||||
#define __exit
|
||||
#define __initdata
|
||||
#define __exitdata
|
||||
#define __initconst
|
||||
#define __exitconst
|
||||
#define __devinit
|
||||
#define __devexit
|
||||
#define __devinitdata
|
||||
#define __devexitdata
|
||||
#define __devinitconst
|
||||
#define __devexitconst
|
||||
|
||||
/* Initcall levels - no-ops in U-Boot */
|
||||
#define pure_initcall(fn)
|
||||
#define core_initcall(fn)
|
||||
#define core_initcall_sync(fn)
|
||||
#define postcore_initcall(fn)
|
||||
#define postcore_initcall_sync(fn)
|
||||
#define arch_initcall(fn)
|
||||
#define arch_initcall_sync(fn)
|
||||
#define subsys_initcall(fn)
|
||||
#define subsys_initcall_sync(fn)
|
||||
#define fs_initcall(fn)
|
||||
#define fs_initcall_sync(fn)
|
||||
#define rootfs_initcall(fn)
|
||||
#define device_initcall(fn)
|
||||
#define device_initcall_sync(fn)
|
||||
#define late_initcall(fn)
|
||||
#define late_initcall_sync(fn)
|
||||
|
||||
#define __initcall(fn)
|
||||
#define __exitcall(fn)
|
||||
|
||||
#endif /* _LINUX_INIT_H */
|
||||
28
include/linux/kthread.h
Normal file
28
include/linux/kthread.h
Normal file
@@ -0,0 +1,28 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/* Simple interface for creating and stopping kernel threads without mess.
|
||||
*
|
||||
* Stub definitions for Linux kernel thread support.
|
||||
* U-Boot doesn't have multi-threading.
|
||||
*/
|
||||
#ifndef _LINUX_KTHREAD_H
|
||||
#define _LINUX_KTHREAD_H
|
||||
|
||||
struct task_struct;
|
||||
|
||||
#define kthread_create(fn, data, fmt, ...) \
|
||||
((struct task_struct *)__builtin_return_address(0))
|
||||
#define kthread_run(fn, data, fmt, ...) \
|
||||
((struct task_struct *)__builtin_return_address(0))
|
||||
#define kthread_stop(task) do { } while (0)
|
||||
#define kthread_should_stop() 0
|
||||
#define kthread_should_park() 0
|
||||
#define kthread_park(task) 0
|
||||
#define kthread_unpark(task) do { } while (0)
|
||||
#define kthread_parkme() do { } while (0)
|
||||
|
||||
#define wake_up_process(task) do { } while (0)
|
||||
#define set_current_state(state) do { } while (0)
|
||||
|
||||
#define task_pid_nr(task) 0
|
||||
|
||||
#endif /* _LINUX_KTHREAD_H */
|
||||
37
include/linux/module.h
Normal file
37
include/linux/module.h
Normal file
@@ -0,0 +1,37 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Dynamic loading of modules into the kernel.
|
||||
*
|
||||
* Rewritten by Richard Henderson <rth@tamu.edu> Dec 1996
|
||||
* Rewritten again by Rusty Russell, 2002
|
||||
*
|
||||
* Stub definitions for Linux kernel module support.
|
||||
* U-Boot doesn't use loadable modules.
|
||||
*/
|
||||
#ifndef _LINUX_MODULE_H
|
||||
#define _LINUX_MODULE_H
|
||||
|
||||
struct module;
|
||||
|
||||
#define THIS_MODULE 0
|
||||
#define try_module_get(...) 1
|
||||
#define module_put(...) do { } while (0)
|
||||
#define __module_get(...) do { } while (0)
|
||||
|
||||
#define module_init(fn)
|
||||
#define module_exit(fn)
|
||||
|
||||
#define module_param(name, type, perm)
|
||||
#define module_param_call(name, set, get, arg, perm)
|
||||
#define module_param_named(name, var, type, perm)
|
||||
|
||||
#define MODULE_PARM_DESC(name, desc)
|
||||
#define MODULE_VERSION(ver)
|
||||
#define MODULE_DESCRIPTION(desc)
|
||||
#define MODULE_AUTHOR(author)
|
||||
#define MODULE_LICENSE(license)
|
||||
#define MODULE_ALIAS(alias)
|
||||
#define MODULE_SOFTDEP(dep)
|
||||
#define MODULE_INFO(tag, info)
|
||||
|
||||
#endif /* _LINUX_MODULE_H */
|
||||
16
include/linux/part_stat.h
Normal file
16
include/linux/part_stat.h
Normal file
@@ -0,0 +1,16 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Stub definitions for partition statistics.
|
||||
* U-Boot doesn't track I/O statistics.
|
||||
*/
|
||||
#ifndef _LINUX_PART_STAT_H
|
||||
#define _LINUX_PART_STAT_H
|
||||
|
||||
#define STAT_READ 0
|
||||
#define STAT_WRITE 1
|
||||
|
||||
#define part_stat_read(bdev, field) 0
|
||||
#define part_stat_inc(bdev, field) do { } while (0)
|
||||
#define part_stat_add(bdev, field, val) do { } while (0)
|
||||
|
||||
#endif /* _LINUX_PART_STAT_H */
|
||||
13
include/linux/path.h
Normal file
13
include/linux/path.h
Normal file
@@ -0,0 +1,13 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#ifndef _LINUX_PATH_H
|
||||
#define _LINUX_PATH_H
|
||||
|
||||
struct dentry;
|
||||
struct vfsmount;
|
||||
|
||||
struct path {
|
||||
struct vfsmount *mnt;
|
||||
struct dentry *dentry;
|
||||
};
|
||||
|
||||
#endif /* _LINUX_PATH_H */
|
||||
80
include/linux/percpu_counter.h
Normal file
80
include/linux/percpu_counter.h
Normal file
@@ -0,0 +1,80 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* A simple "approximate counter" for use in ext2 and ext3 superblocks.
|
||||
*
|
||||
* WARNING: these things are HUGE. 4 kbytes per counter on 32-way P4.
|
||||
*
|
||||
* Stub definitions for percpu counters.
|
||||
* U-Boot is single-threaded, use simple counters.
|
||||
*/
|
||||
#ifndef _LINUX_PERCPU_COUNTER_H
|
||||
#define _LINUX_PERCPU_COUNTER_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
struct percpu_counter {
|
||||
s64 count;
|
||||
};
|
||||
|
||||
static inline int percpu_counter_init(struct percpu_counter *fbc, s64 amount,
|
||||
gfp_t gfp)
|
||||
{
|
||||
fbc->count = amount;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void percpu_counter_destroy(struct percpu_counter *fbc)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void percpu_counter_set(struct percpu_counter *fbc, s64 amount)
|
||||
{
|
||||
fbc->count = amount;
|
||||
}
|
||||
|
||||
static inline void percpu_counter_add(struct percpu_counter *fbc, s64 amount)
|
||||
{
|
||||
fbc->count += amount;
|
||||
}
|
||||
|
||||
static inline void percpu_counter_sub(struct percpu_counter *fbc, s64 amount)
|
||||
{
|
||||
fbc->count -= amount;
|
||||
}
|
||||
|
||||
static inline void percpu_counter_inc(struct percpu_counter *fbc)
|
||||
{
|
||||
fbc->count++;
|
||||
}
|
||||
|
||||
static inline void percpu_counter_dec(struct percpu_counter *fbc)
|
||||
{
|
||||
fbc->count--;
|
||||
}
|
||||
|
||||
static inline s64 percpu_counter_read(struct percpu_counter *fbc)
|
||||
{
|
||||
return fbc->count;
|
||||
}
|
||||
|
||||
static inline s64 percpu_counter_read_positive(struct percpu_counter *fbc)
|
||||
{
|
||||
return fbc->count > 0 ? fbc->count : 0;
|
||||
}
|
||||
|
||||
static inline s64 percpu_counter_sum(struct percpu_counter *fbc)
|
||||
{
|
||||
return fbc->count;
|
||||
}
|
||||
|
||||
static inline s64 percpu_counter_sum_positive(struct percpu_counter *fbc)
|
||||
{
|
||||
return fbc->count > 0 ? fbc->count : 0;
|
||||
}
|
||||
|
||||
static inline bool percpu_counter_initialized(struct percpu_counter *fbc)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif /* _LINUX_PERCPU_COUNTER_H */
|
||||
17
include/linux/prefetch.h
Normal file
17
include/linux/prefetch.h
Normal file
@@ -0,0 +1,17 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Generic cache management functions. Everything is arch-specific,
|
||||
* but this header exists to make sure the defines/functions can be
|
||||
* used in a generic way.
|
||||
*
|
||||
* 2000-11-13 Arjan van de Ven <arjan@fenrus.demon.nl>
|
||||
*
|
||||
* Stub definitions for prefetch operations.
|
||||
*/
|
||||
#ifndef _LINUX_PREFETCH_H
|
||||
#define _LINUX_PREFETCH_H
|
||||
|
||||
#define prefetch(x) do { } while (0)
|
||||
#define prefetchw(x) do { } while (0)
|
||||
|
||||
#endif /* _LINUX_PREFETCH_H */
|
||||
38
include/linux/quotaops.h
Normal file
38
include/linux/quotaops.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Definitions for diskquota-operations. When diskquota is configured these
|
||||
* macros expand to the right source-code.
|
||||
*
|
||||
* Author: Marco van Wieringen <mvw@planets.elm.net>
|
||||
*
|
||||
* Stub definitions for quota operations.
|
||||
* U-Boot doesn't support disk quotas.
|
||||
*/
|
||||
#ifndef _LINUX_QUOTAOPS_H
|
||||
#define _LINUX_QUOTAOPS_H
|
||||
|
||||
struct inode;
|
||||
struct dentry;
|
||||
struct kqid;
|
||||
|
||||
#define dquot_initialize(inode) 0
|
||||
#define dquot_drop(inode) do { } while (0)
|
||||
#define dquot_alloc_inode(inode) 0
|
||||
#define dquot_free_inode(inode) do { } while (0)
|
||||
#define dquot_transfer(inode, attr) 0
|
||||
#define dquot_claim_space_nodirty(inode, nr) 0
|
||||
#define dquot_reclaim_space_nodirty(inode, nr) do { } while (0)
|
||||
#define dquot_disable(sb, type, flags) 0
|
||||
#define dquot_suspend(sb, type) 0
|
||||
#define dquot_resume(sb, type) 0
|
||||
#define dquot_file_open(inode, file) 0
|
||||
|
||||
#define sb_has_quota_usage_enabled(sb, type) 0
|
||||
#define sb_has_quota_limits_enabled(sb, type) 0
|
||||
#define sb_has_quota_suspended(sb, type) 0
|
||||
#define sb_has_quota_loaded(sb, type) 0
|
||||
#define sb_has_quota_active(sb, type) 0
|
||||
#define sb_any_quota_loaded(sb) 0
|
||||
#define sb_any_quota_active(sb) 0
|
||||
|
||||
#endif /* _LINUX_QUOTAOPS_H */
|
||||
15
include/linux/random.h
Normal file
15
include/linux/random.h
Normal file
@@ -0,0 +1,15 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Stub definitions for random number generation.
|
||||
*/
|
||||
#ifndef _LINUX_RANDOM_H
|
||||
#define _LINUX_RANDOM_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#define get_random_bytes(buf, len) do { } while (0)
|
||||
#define prandom_u32() 0
|
||||
#define get_random_u32() 0
|
||||
#define get_random_u64() 0ULL
|
||||
|
||||
#endif /* _LINUX_RANDOM_H */
|
||||
28
include/linux/rwsem.h
Normal file
28
include/linux/rwsem.h
Normal file
@@ -0,0 +1,28 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/* rwsem.h: R/W semaphores, public interface
|
||||
*
|
||||
* Written by David Howells (dhowells@redhat.com).
|
||||
* Derived from asm-i386/semaphore.h
|
||||
*
|
||||
* Stub definitions for Linux kernel read-write semaphores.
|
||||
* U-Boot is single-threaded, no locking needed.
|
||||
*/
|
||||
#ifndef _LINUX_RWSEM_H
|
||||
#define _LINUX_RWSEM_H
|
||||
|
||||
struct rw_semaphore {
|
||||
int count;
|
||||
};
|
||||
|
||||
#define DECLARE_RWSEM(name) struct rw_semaphore name = { 0 }
|
||||
|
||||
#define init_rwsem(sem) do { } while (0)
|
||||
#define down_read(sem) do { } while (0)
|
||||
#define down_read_trylock(sem) 1
|
||||
#define up_read(sem) do { } while (0)
|
||||
#define down_write(sem) do { } while (0)
|
||||
#define down_write_trylock(sem) 1
|
||||
#define up_write(sem) do { } while (0)
|
||||
#define downgrade_write(sem) do { } while (0)
|
||||
|
||||
#endif /* _LINUX_RWSEM_H */
|
||||
36
include/linux/sched.h
Normal file
36
include/linux/sched.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Define 'struct task_struct' and provide the main scheduler
|
||||
* APIs (schedule(), wakeup variants, etc.)
|
||||
*
|
||||
* Stub definitions for Linux kernel scheduler.
|
||||
* U-Boot is single-threaded.
|
||||
*/
|
||||
#ifndef _LINUX_SCHED_H
|
||||
#define _LINUX_SCHED_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
struct task_struct {
|
||||
int pid;
|
||||
char comm[16];
|
||||
};
|
||||
|
||||
extern struct task_struct *current;
|
||||
|
||||
#define TASK_RUNNING 0
|
||||
#define TASK_INTERRUPTIBLE 1
|
||||
#define TASK_UNINTERRUPTIBLE 2
|
||||
|
||||
#define cond_resched() do { } while (0)
|
||||
#define yield() do { } while (0)
|
||||
/* Note: schedule() is implemented in common/cyclic.c */
|
||||
|
||||
#define in_interrupt() 0
|
||||
#define in_atomic() 0
|
||||
#define in_task() 1
|
||||
|
||||
#define signal_pending(task) 0
|
||||
#define fatal_signal_pending(task) 0
|
||||
|
||||
#endif /* _LINUX_SCHED_H */
|
||||
39
include/linux/security.h
Normal file
39
include/linux/security.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Linux Security plug
|
||||
*
|
||||
* Copyright (C) 2001 WireX Communications, Inc <chris@wirex.com>
|
||||
* Copyright (C) 2001 Greg Kroah-Hartman <greg@kroah.com>
|
||||
* Copyright (C) 2001 Networks Associates Technology, Inc <ssmalley@nai.com>
|
||||
* Copyright (C) 2001 James Morris <jmorris@intercode.com.au>
|
||||
* Copyright (C) 2001 Silicon Graphics, Inc. (Trust Technology Group)
|
||||
* Copyright (C) 2016 Mellanox Techonologies
|
||||
*
|
||||
* Stub definitions for Linux Security Module (LSM) hooks.
|
||||
* U-Boot doesn't implement security modules.
|
||||
*/
|
||||
#ifndef _LINUX_SECURITY_H
|
||||
#define _LINUX_SECURITY_H
|
||||
|
||||
struct inode;
|
||||
struct dentry;
|
||||
|
||||
static inline int security_inode_init_security(struct inode *inode,
|
||||
struct inode *dir,
|
||||
void *name, void *value,
|
||||
void *len)
|
||||
{
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
#define security_inode_create(dir, dentry, mode) 0
|
||||
#define security_inode_link(old, dir, new) 0
|
||||
#define security_inode_unlink(dir, dentry) 0
|
||||
#define security_inode_symlink(dir, dentry, name) 0
|
||||
#define security_inode_mkdir(dir, dentry, mode) 0
|
||||
#define security_inode_rmdir(dir, dentry) 0
|
||||
#define security_inode_mknod(dir, dentry, mode, dev) 0
|
||||
#define security_inode_rename(od, odent, nd, ndent, f) 0
|
||||
#define security_inode_setattr(dentry, attr) 0
|
||||
|
||||
#endif /* _LINUX_SECURITY_H */
|
||||
18
include/linux/seq_file.h
Normal file
18
include/linux/seq_file.h
Normal file
@@ -0,0 +1,18 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#ifndef _LINUX_SEQ_FILE_H
|
||||
#define _LINUX_SEQ_FILE_H
|
||||
|
||||
/*
|
||||
* Stub definitions for seq_file interface.
|
||||
* U-Boot doesn't use /proc filesystem.
|
||||
*/
|
||||
|
||||
struct seq_file {
|
||||
void *private;
|
||||
};
|
||||
|
||||
#define seq_printf(m, fmt, ...) do { } while (0)
|
||||
#define seq_puts(m, s) do { } while (0)
|
||||
#define seq_putc(m, c) do { } while (0)
|
||||
|
||||
#endif /* _LINUX_SEQ_FILE_H */
|
||||
95
include/linux/slab.h
Normal file
95
include/linux/slab.h
Normal file
@@ -0,0 +1,95 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Written by Mark Hemment, 1996 (markhe@nextd.demon.co.uk).
|
||||
*
|
||||
* (C) SGI 2006, Christoph Lameter
|
||||
* Cleaned up and restructured to ease the addition of alternative
|
||||
* implementations of SLAB allocators.
|
||||
* (C) Linux Foundation 2008-2013
|
||||
* Unified interface for all slab allocators
|
||||
*
|
||||
* Memory allocation functions for Linux kernel compatibility.
|
||||
* These map to U-Boot's malloc/free infrastructure.
|
||||
*/
|
||||
#ifndef _LINUX_SLAB_H
|
||||
#define _LINUX_SLAB_H
|
||||
|
||||
#include <malloc.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#ifndef GFP_ATOMIC
|
||||
#define GFP_ATOMIC ((gfp_t)0)
|
||||
#endif
|
||||
#ifndef GFP_KERNEL
|
||||
#define GFP_KERNEL ((gfp_t)0)
|
||||
#endif
|
||||
#ifndef GFP_NOFS
|
||||
#define GFP_NOFS ((gfp_t)0)
|
||||
#endif
|
||||
#ifndef GFP_USER
|
||||
#define GFP_USER ((gfp_t)0)
|
||||
#endif
|
||||
#ifndef GFP_NOWAIT
|
||||
#define GFP_NOWAIT ((gfp_t)0)
|
||||
#endif
|
||||
#ifndef __GFP_NOWARN
|
||||
#define __GFP_NOWARN ((gfp_t)0)
|
||||
#endif
|
||||
#ifndef __GFP_ZERO
|
||||
#define __GFP_ZERO ((__force gfp_t)0x8000u)
|
||||
#endif
|
||||
#ifndef __GFP_NOFAIL
|
||||
#define __GFP_NOFAIL ((gfp_t)0)
|
||||
#endif
|
||||
|
||||
void *kmalloc(size_t size, gfp_t flags);
|
||||
|
||||
static inline void *kzalloc(size_t size, gfp_t flags)
|
||||
{
|
||||
return kmalloc(size, flags | __GFP_ZERO);
|
||||
}
|
||||
|
||||
static inline void *kmalloc_array(size_t n, size_t size, gfp_t flags)
|
||||
{
|
||||
if (size != 0 && n > SIZE_MAX / size)
|
||||
return NULL;
|
||||
return kmalloc(n * size, flags | __GFP_ZERO);
|
||||
}
|
||||
|
||||
static inline void *kcalloc(size_t n, size_t size, gfp_t flags)
|
||||
{
|
||||
return kmalloc_array(n, size, flags | __GFP_ZERO);
|
||||
}
|
||||
|
||||
static inline void kfree(const void *block)
|
||||
{
|
||||
free((void *)block);
|
||||
}
|
||||
|
||||
static inline void *krealloc(const void *p, size_t new_size, gfp_t flags)
|
||||
{
|
||||
return realloc((void *)p, new_size);
|
||||
}
|
||||
|
||||
void *kmemdup(const void *src, size_t len, gfp_t gfp);
|
||||
|
||||
/* kmem_cache stubs */
|
||||
struct kmem_cache {
|
||||
int sz;
|
||||
};
|
||||
|
||||
struct kmem_cache *get_mem(int element_sz);
|
||||
#define kmem_cache_create(a, sz, c, d, e) get_mem(sz)
|
||||
void *kmem_cache_alloc(struct kmem_cache *obj, gfp_t flag);
|
||||
|
||||
static inline void kmem_cache_free(struct kmem_cache *cachep, void *obj)
|
||||
{
|
||||
free(obj);
|
||||
}
|
||||
|
||||
static inline void kmem_cache_destroy(struct kmem_cache *cachep)
|
||||
{
|
||||
free(cachep);
|
||||
}
|
||||
|
||||
#endif /* _LINUX_SLAB_H */
|
||||
19
include/linux/sort.h
Normal file
19
include/linux/sort.h
Normal file
@@ -0,0 +1,19 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Sorting functions - use stdlib qsort.
|
||||
*/
|
||||
#ifndef _LINUX_SORT_H
|
||||
#define _LINUX_SORT_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
typedef int (*cmp_func_t)(const void *, const void *);
|
||||
|
||||
static inline void sort(void *base, size_t num, size_t size,
|
||||
cmp_func_t cmp, void *swap)
|
||||
{
|
||||
qsort(base, num, size, cmp);
|
||||
}
|
||||
|
||||
#endif /* _LINUX_SORT_H */
|
||||
@@ -17,4 +17,12 @@
|
||||
#undef offsetof
|
||||
#define offsetof(TYPE, MEMBER) __builtin_offsetof(TYPE, MEMBER)
|
||||
|
||||
/**
|
||||
* sizeof_field() - Report the size of a struct field in bytes
|
||||
*
|
||||
* @TYPE: The structure containing the field of interest
|
||||
* @MEMBER: The field to return the size of
|
||||
*/
|
||||
#define sizeof_field(TYPE, MEMBER) sizeof((((TYPE *)0)->MEMBER))
|
||||
|
||||
#endif
|
||||
|
||||
18
include/linux/swap.h
Normal file
18
include/linux/swap.h
Normal file
@@ -0,0 +1,18 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Stub definitions for swap/memory management.
|
||||
* U-Boot doesn't use swap.
|
||||
*/
|
||||
#ifndef _LINUX_SWAP_H
|
||||
#define _LINUX_SWAP_H
|
||||
|
||||
#define mark_page_accessed(page) do { } while (0)
|
||||
|
||||
struct address_space;
|
||||
struct folio;
|
||||
|
||||
static inline void folio_mark_accessed(struct folio *folio)
|
||||
{
|
||||
}
|
||||
|
||||
#endif /* _LINUX_SWAP_H */
|
||||
30
include/linux/timer.h
Normal file
30
include/linux/timer.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Stub definitions for Linux kernel timer support.
|
||||
* U-Boot doesn't use kernel timers.
|
||||
*/
|
||||
#ifndef _LINUX_TIMER_H
|
||||
#define _LINUX_TIMER_H
|
||||
|
||||
struct timer_list {
|
||||
unsigned long expires;
|
||||
void (*function)(struct timer_list *);
|
||||
unsigned long data;
|
||||
};
|
||||
|
||||
#define DEFINE_TIMER(name, func) \
|
||||
struct timer_list name = { .function = func }
|
||||
|
||||
#define setup_timer(timer, func, data) do { } while (0)
|
||||
#define timer_setup(timer, func, flags) do { } while (0)
|
||||
#define init_timer(timer) do { } while (0)
|
||||
#define add_timer(timer) do { } while (0)
|
||||
#define del_timer(timer) 0
|
||||
#define del_timer_sync(timer) do { } while (0)
|
||||
#define mod_timer(timer, expires) 0
|
||||
#define timer_pending(timer) 0
|
||||
|
||||
#define from_timer(var, callback_timer, timer_fieldname) \
|
||||
container_of(callback_timer, typeof(*var), timer_fieldname)
|
||||
|
||||
#endif /* _LINUX_TIMER_H */
|
||||
32
include/linux/uaccess.h
Normal file
32
include/linux/uaccess.h
Normal file
@@ -0,0 +1,32 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#ifndef _LINUX_UACCESS_H
|
||||
#define _LINUX_UACCESS_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <string.h>
|
||||
|
||||
/*
|
||||
* Stub definitions for Linux kernel user-space access functions.
|
||||
* In U-Boot there's no user/kernel separation, so these are simple copies.
|
||||
*/
|
||||
|
||||
static inline unsigned long copy_from_user(void *to, const void *from,
|
||||
unsigned long n)
|
||||
{
|
||||
memcpy(to, from, n);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline unsigned long copy_to_user(void *to, const void *from,
|
||||
unsigned long n)
|
||||
{
|
||||
memcpy(to, from, n);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define get_user(x, ptr) ({ x = *(ptr); 0; })
|
||||
#define put_user(x, ptr) ({ *(ptr) = x; 0; })
|
||||
|
||||
#define access_ok(addr, size) 1
|
||||
|
||||
#endif /* _LINUX_UACCESS_H */
|
||||
24
include/linux/vmalloc.h
Normal file
24
include/linux/vmalloc.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* vmalloc functions for Linux kernel compatibility.
|
||||
* In U-Boot, these just map to regular malloc.
|
||||
*/
|
||||
#ifndef _LINUX_VMALLOC_H
|
||||
#define _LINUX_VMALLOC_H
|
||||
|
||||
#include <linux/slab.h>
|
||||
|
||||
#define vmalloc(size) kmalloc(size, 0)
|
||||
#define __vmalloc(size, flags, pgsz) kmalloc(size, flags)
|
||||
|
||||
static inline void *vzalloc(unsigned long size)
|
||||
{
|
||||
return kzalloc(size, 0);
|
||||
}
|
||||
|
||||
static inline void vfree(const void *addr)
|
||||
{
|
||||
free((void *)addr);
|
||||
}
|
||||
|
||||
#endif /* _LINUX_VMALLOC_H */
|
||||
31
include/linux/wait.h
Normal file
31
include/linux/wait.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Linux wait queue related types and methods
|
||||
*
|
||||
* Stub definitions for Linux kernel wait queues.
|
||||
* U-Boot doesn't use wait queues.
|
||||
*/
|
||||
#ifndef _LINUX_WAIT_H
|
||||
#define _LINUX_WAIT_H
|
||||
|
||||
typedef int wait_queue_head_t;
|
||||
|
||||
struct wait_queue_entry {
|
||||
int dummy;
|
||||
};
|
||||
|
||||
#define DECLARE_WAITQUEUE(name, task) do { } while (0)
|
||||
#define DECLARE_WAIT_QUEUE_HEAD(name) do { } while (0)
|
||||
|
||||
#define init_waitqueue_head(wq) do { } while (0)
|
||||
#define add_wait_queue(wq, entry) do { } while (0)
|
||||
#define remove_wait_queue(wq, entry) do { } while (0)
|
||||
#define wake_up(wq) do { } while (0)
|
||||
#define wake_up_all(wq) do { } while (0)
|
||||
#define wake_up_interruptible(wq) do { } while (0)
|
||||
#define wake_up_interruptible_all(wq) do { } while (0)
|
||||
|
||||
#define wait_event(wq, condition) do { } while (0)
|
||||
#define wait_event_interruptible(wq, condition) 0
|
||||
|
||||
#endif /* _LINUX_WAIT_H */
|
||||
37
include/linux/workqueue.h
Normal file
37
include/linux/workqueue.h
Normal file
@@ -0,0 +1,37 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* workqueue.h --- work queue handling for Linux.
|
||||
*
|
||||
* Stub definitions for Linux kernel workqueue support.
|
||||
* U-Boot doesn't use workqueues.
|
||||
*/
|
||||
#ifndef _LINUX_WORKQUEUE_H
|
||||
#define _LINUX_WORKQUEUE_H
|
||||
|
||||
struct work_struct {
|
||||
void (*func)(struct work_struct *);
|
||||
};
|
||||
|
||||
struct delayed_work {
|
||||
struct work_struct work;
|
||||
};
|
||||
|
||||
#define INIT_WORK(work, func) do { } while (0)
|
||||
#define INIT_DELAYED_WORK(work, func) do { } while (0)
|
||||
#define schedule_work(work) do { } while (0)
|
||||
#define schedule_delayed_work(work, delay) 0
|
||||
#define cancel_work_sync(work) 0
|
||||
#define cancel_delayed_work(work) 0
|
||||
#define cancel_delayed_work_sync(work) 0
|
||||
#define flush_work(work) 0
|
||||
#define flush_delayed_work(work) 0
|
||||
#define queue_work(wq, work) 0
|
||||
#define queue_delayed_work(wq, work, delay) 0
|
||||
|
||||
#define alloc_workqueue(fmt, flags, max, ...) ((struct workqueue_struct *)1)
|
||||
#define create_singlethread_workqueue(name) ((struct workqueue_struct *)1)
|
||||
#define destroy_workqueue(wq) do { } while (0)
|
||||
|
||||
struct workqueue_struct;
|
||||
|
||||
#endif /* _LINUX_WORKQUEUE_H */
|
||||
@@ -5,19 +5,12 @@
|
||||
#include <asm/cache.h>
|
||||
#include <linux/compat.h>
|
||||
|
||||
struct p_current cur = {
|
||||
struct task_struct cur = {
|
||||
.pid = 1,
|
||||
};
|
||||
__maybe_unused struct p_current *current = &cur;
|
||||
__maybe_unused struct task_struct *current = &cur;
|
||||
|
||||
unsigned long copy_from_user(void *dest, const void *src,
|
||||
unsigned long count)
|
||||
{
|
||||
memcpy((void *)dest, (void *)src, count);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void *kmalloc(size_t size, int flags)
|
||||
void *kmalloc(size_t size, gfp_t flags)
|
||||
{
|
||||
void *p;
|
||||
|
||||
@@ -38,7 +31,7 @@ struct kmem_cache *get_mem(int element_sz)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void *kmem_cache_alloc(struct kmem_cache *obj, int flag)
|
||||
void *kmem_cache_alloc(struct kmem_cache *obj, gfp_t flag)
|
||||
{
|
||||
return malloc_cache_aligned(obj->sz);
|
||||
}
|
||||
|
||||
@@ -200,15 +200,6 @@ static long lmb_add_region_flags(struct alist *lmb_rgn_lst, phys_addr_t base,
|
||||
phys_addr_t rgnbase = rgn[i].base;
|
||||
phys_size_t rgnsize = rgn[i].size;
|
||||
phys_size_t rgnflags = rgn[i].flags;
|
||||
phys_addr_t end = base + size - 1;
|
||||
phys_addr_t rgnend = rgnbase + rgnsize - 1;
|
||||
if (rgnbase <= base && end <= rgnend) {
|
||||
if (flags == rgnflags)
|
||||
/* Already have this region, so we're done */
|
||||
return 0;
|
||||
else
|
||||
return -1; /* regions with new flags */
|
||||
}
|
||||
|
||||
ret = lmb_addrs_adjacent(base, size, rgnbase, rgnsize);
|
||||
if (ret > 0) {
|
||||
|
||||
@@ -529,6 +529,26 @@ static int test_alloc_addr(struct unit_test_state *uts, const phys_addr_t ram)
|
||||
ret = lmb_add(ram, ram_size);
|
||||
ut_asserteq(ret, 0);
|
||||
|
||||
/* Try to allocate a page twice */
|
||||
b = lmb_alloc_addr_flags(alloc_addr_a, 0x1000, LMB_NONE);
|
||||
ut_asserteq(b, alloc_addr_a);
|
||||
b = lmb_alloc_addr_flags(alloc_addr_a, 0x1000, LMB_NOOVERWRITE);
|
||||
ut_asserteq(b, 0);
|
||||
b = lmb_alloc_addr_flags(alloc_addr_a, 0x1000, LMB_NONE);
|
||||
ut_asserteq(b, alloc_addr_a);
|
||||
b = lmb_alloc_addr_flags(alloc_addr_a, 0x2000, LMB_NONE);
|
||||
ut_asserteq(b, alloc_addr_a);
|
||||
ret = lmb_free(alloc_addr_a, 0x2000);
|
||||
ut_asserteq(ret, 0);
|
||||
b = lmb_alloc_addr_flags(alloc_addr_a, 0x1000, LMB_NOOVERWRITE);
|
||||
ut_asserteq(b, alloc_addr_a);
|
||||
b = lmb_alloc_addr_flags(alloc_addr_a, 0x1000, LMB_NONE);
|
||||
ut_asserteq(b, 0);
|
||||
b = lmb_alloc_addr_flags(alloc_addr_a, 0x1000, LMB_NOOVERWRITE);
|
||||
ut_asserteq(b, 0);
|
||||
ret = lmb_free(alloc_addr_a, 0x1000);
|
||||
ut_asserteq(ret, 0);
|
||||
|
||||
/* reserve 3 blocks */
|
||||
ret = lmb_reserve(alloc_addr_a, 0x10000);
|
||||
ut_asserteq(ret, 0);
|
||||
@@ -734,7 +754,7 @@ static int lib_test_lmb_flags(struct unit_test_state *uts)
|
||||
|
||||
/* reserve again, same flag */
|
||||
ret = lmb_reserve_flags(0x40010000, 0x10000, LMB_NOMAP);
|
||||
ut_asserteq(ret, 0);
|
||||
ut_asserteq(ret, -1L);
|
||||
ASSERT_LMB(mem_lst, used_lst, ram, ram_size, 1, 0x40010000, 0x10000,
|
||||
0, 0, 0, 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user