Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Kernel Liteos A
提交
6352d6e1
K
Kernel Liteos A
项目概览
OpenHarmony
/
Kernel Liteos A
1 年多 前同步成功
通知
460
Star
414
Fork
55
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
4
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel Liteos A
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
4
Issue
4
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
6352d6e1
编写于
6月 08, 2021
作者:
L
lzl
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
kernel adapter
Signed-off-by:
N
lzl
<
sucer_fater@163.com
>
上级
1a3f3f54
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
13 addition
and
12 deletion
+13
-12
fs/vfs/disk/disk.c
fs/vfs/disk/disk.c
+5
-7
kernel/common/los_rootfs.c
kernel/common/los_rootfs.c
+8
-5
未找到文件。
fs/vfs/disk/disk.c
浏览文件 @
6352d6e1
...
...
@@ -35,14 +35,8 @@
#include "unistd.h"
#include "sys/mount.h"
#include "linux/spinlock.h"
#include "fs/path_cache.h"
#ifdef LOSCFG_DRIVERS_MMC
#include "mmc/block.h"
#endif
los_disk
g_sysDisk
[
SYS_MAX_DISK
];
los_part
g_sysPart
[
SYS_MAX_PART
];
...
...
@@ -1685,13 +1679,17 @@ VOID show_part(los_part *part)
PRINTK
(
"part sec count : %llu
\n
"
,
part
->
sector_count
);
}
#ifdef LOSCFG_DRIVERS_MMC
ssize_t
StorageBlockMmcErase
(
uint32_t
blockId
,
size_t
secStart
,
size_t
secNr
);
#endif
INT32
EraseDiskByID
(
UINT32
diskID
,
size_t
startSector
,
UINT32
sectors
)
{
INT32
ret
=
VFS_ERROR
;
#ifdef LOSCFG_DRIVERS_MMC
los_disk
*
disk
=
get_disk
((
INT32
)
diskID
);
if
(
disk
!=
NULL
)
{
ret
=
do_mmc_e
rase
(
diskID
,
startSector
,
sectors
);
ret
=
StorageBlockMmcE
rase
(
diskID
,
startSector
,
sectors
);
}
#endif
...
...
kernel/common/los_rootfs.c
浏览文件 @
6352d6e1
...
...
@@ -35,7 +35,6 @@
#include "mtd_partition.h"
#endif
#ifdef LOSCFG_DRIVERS_MMC
#include "mmc/block.h"
#include "disk.h"
#endif
#include "sys/mount.h"
...
...
@@ -103,18 +102,22 @@ los_disk *GetMmcDisk(UINT8 type)
#endif
#ifdef LOSCFG_STORAGE_EMMC
struct
disk_divide_info
*
StorageBlockGetEmmc
(
void
);
struct
block_operations
*
StorageBlockGetMmcOps
(
void
);
char
*
StorageBlockGetEmmcNodeName
(
void
*
block
);
STATIC
const
CHAR
*
AddEmmcRootfsPart
(
INT32
rootAddr
,
INT32
rootSize
)
{
INT32
ret
;
struct
mmc_block
*
block
=
(
struct
mmc_block
*
)
((
struct
drv_data
*
)
g_emmcDisk
->
dev
->
data
)
->
priv
;
const
char
*
node_name
=
mmc_block_get_node_n
ame
(
block
);
void
*
block
=
((
struct
drv_data
*
)
g_emmcDisk
->
dev
->
data
)
->
priv
;
const
char
*
node_name
=
StorageBlockGetEmmcNodeN
ame
(
block
);
if
(
los_disk_deinit
(
g_emmcDisk
->
disk_id
)
!=
ENOERR
)
{
PRINT_ERR
(
"Failed to deinit emmc disk!
\n
"
);
return
NULL
;
}
struct
disk_divide_info
*
emmc
=
get_e
mmc
();
struct
disk_divide_info
*
emmc
=
StorageBlockGetE
mmc
();
ret
=
add_mmc_partition
(
emmc
,
rootAddr
/
EMMC_SEC_SIZE
,
rootSize
/
EMMC_SEC_SIZE
);
if
(
ret
!=
LOS_OK
)
{
PRINT_ERR
(
"Failed to add mmc root partition!
\n
"
);
...
...
@@ -138,7 +141,7 @@ STATIC const CHAR *AddEmmcRootfsPart(INT32 rootAddr, INT32 rootSize)
PRINT_ERR
(
"Failed to alloc disk %s!
\n
"
,
node_name
);
return
NULL
;
}
if
(
los_disk_init
(
node_name
,
mmc_block_get_bops
(
block
),
(
void
*
)
block
,
diskId
,
emmc
)
!=
ENOERR
)
{
if
(
los_disk_init
(
node_name
,
StorageBlockGetMmcOps
(),
block
,
diskId
,
emmc
)
!=
ENOERR
)
{
PRINT_ERR
(
"Failed to init emmc disk!
\n
"
);
return
NULL
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录