mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-21 08:50:27 +00:00
hv: move save_segment/load_segment to a header file
save_segment/load_segment is common code and can be used outside of trusty, move to a header file. Signed-off-by: Binbin Wu <binbin.wu@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -35,21 +35,6 @@ static struct trusty_key_info g_key_info = {
|
||||
.platform = 3U,
|
||||
.num_seeds = 1U
|
||||
};
|
||||
#define save_segment(seg, SEG_NAME) \
|
||||
{ \
|
||||
seg.selector = exec_vmread16(SEG_NAME##_SEL); \
|
||||
seg.base = exec_vmread(SEG_NAME##_BASE); \
|
||||
seg.limit = exec_vmread32(SEG_NAME##_LIMIT); \
|
||||
seg.attr = exec_vmread32(SEG_NAME##_ATTR); \
|
||||
}
|
||||
|
||||
#define load_segment(seg, SEG_NAME) \
|
||||
{ \
|
||||
exec_vmwrite16(SEG_NAME##_SEL, seg.selector); \
|
||||
exec_vmwrite(SEG_NAME##_BASE, seg.base); \
|
||||
exec_vmwrite32(SEG_NAME##_LIMIT, seg.limit); \
|
||||
exec_vmwrite32(SEG_NAME##_ATTR, seg.attr); \
|
||||
}
|
||||
|
||||
/**
|
||||
* @defgroup trusty_apis Trusty APIs
|
||||
|
Reference in New Issue
Block a user