Skip to content

Commit

Permalink
* Added several functions for assisting with marshalling layouts.
Browse files Browse the repository at this point in the history
  * isInlineElement.
  * hasInlineElements.
* Tested marshalStackArguments.
* zudi_layout_get_size() now returns a word-aligned size.
* zudi_layout_get_size() now takes a "inlineElementsAllowed" argument, which
  tells it whether or not to error on finding inline elements.
* Added checks for error return values from all layout parser functions.
* Added support for the UDI_PHYSIO layout types.
* New inline function, align, a template function that
* Fixed a bug in startDeviceReq which caused it to fail to stop the excess
  threads from getting through.
  • Loading branch information
latentPrion committed Oct 29, 2014
1 parent 0747b2e commit 55f0991
Show file tree
Hide file tree
Showing 6 changed files with 227 additions and 246 deletions.
69 changes: 56 additions & 13 deletions core/__kthreads/x8632/__korientationMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,13 +336,15 @@ void __korientationMain2(MessageStream::sHeader *msgIt)
#define UDI_PHYSIO_VERSION 0x101
#include <udi_physio.h>
#include <kernel/common/floodplainn/initInfo.h>
#include <kernel/common/floodplainn/movableMemoryHeader.h>
static udi_layout_t sTLayout[] =
{
UDI_DL_UBIT8_T, UDI_DL_UBIT8_T, UDI_DL_BUF,
0, 0, 0,
UDI_DL_UBIT16_T, UDI_DL_INLINE_UNTYPED,
UDI_DL_END
};

struct sT
{

Expand All @@ -359,7 +361,39 @@ struct sT
void *m4;
};

static udi_layout_t trLayout[] =
{
UDI_DL_UBIT32_T, UDI_DL_UBIT32_T,
UDI_DL_END
};

ubit8 mem0[512];
ubit8 mem1[128];

struct sMMa
{
sMMa()
:
h(sizeof(a))
{}

fplainn::sMovableMemory h;
udi_instance_attr_list_t a;
};

struct sMMf
{
sMMf()
:
h(sizeof(f))
{}

fplainn::sMovableMemory h;
udi_filter_element_t f;
};

status_t func0(void *mem, udi_layout_t *lay, ...);

void __korientationMain3(MessageStream::sHeader *msgIt)
{
Thread *self;
Expand All @@ -369,25 +403,34 @@ void __korientationMain3(MessageStream::sHeader *msgIt)

const sMetaInitEntry *mie;
udi_mei_op_template_t *opt;
status_t sz1, sz3;
sT mem;
status_t sz0, sz1, sz2, sz3, sz4, sz5, sz6;
udi_enumerate_cb_t uec, dst;

mie = floodplainn.zudi.findMetaInitInfo(CC"udi_gio");
mie = floodplainn.zudi.findMetaInitInfo(CC"udi_mgmt");
fplainn::MetaInit mp(mie->udi_meta_info);

opt = mp.getOpTemplate(UDI_GIO_PROVIDER_OPS_NUM, 1);
opt = mp.getOpTemplate(UDI_MGMT_OPS_NUM, 2);

printf(NOTICE"sizeof attr_list_t %d, filter_elem_t %d.\n",
sizeof(udi_instance_attr_list_t),
sizeof(udi_filter_element_t));

sz1 = fplainn::sChannelMsg::zudi_layout_get_size(
opt->visible_layout, 0);
printf(NOTICE"sz1: %d, %d.\n", sz1,
fplainn::sChannelMsg::hasInlineElements(opt->visible_layout));
uec.attr_list = &(new sMMa)->a;
memset(uec.attr_list, 0x2B, sizeof(*uec.attr_list));
uec.filter_list = &(new sMMf)->f;
memset((void *)uec.filter_list, 0xB2, sizeof(*uec.filter_list));
sz0 = fplainn::sChannelMsg::getTotalInlineLayoutSize(
opt->visible_layout, NULL, &uec.gcb);

sz3 = fplainn::sChannelMsg::zudi_layout_get_size(
opt->marshal_layout, 0);
printf(NOTICE"sz3: %d.\n", sz3);
sz1 = fplainn::sChannelMsg::marshalInlineObjects(
mem0, &dst.gcb, &uec.gcb, opt->visible_layout, NULL);

func0(&mem, sTLayout, 1, 1, 0xDEADBEEF, 65536, 0xCAFEBABE);
mem.dump();
printf(NOTICE"total inline size %d.\n", sz0);
printf(NOTICE"mem0[0] 0x%x, mem0[97] 0x%x\n", mem0[0], mem0[97]);
printf(NOTICE"mem0[98] 0x%x, mem0[98+167] 0x%x\n", mem0[98], mem0[98+167]);
printf(NOTICE"destcb pointers: %d, %d\n",
(void *)dst.attr_list == mem0,
(void *)dst.filter_list == mem0+98);
return;

/* Initialize Interrupt Trib IRQ management (__kpin and __kvector),
Expand Down
2 changes: 1 addition & 1 deletion core/commonlibs/libzbzcore/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY=
DELIVERABLE=../../libzbzcore.a
OBJFILES=main.o distributaryPath.o driverPath.o devicePath.o udi_layout.o \
OBJFILES=main.o distributaryPath.o driverPath.o devicePath.o layout.o \
libzudi.o

all: Makefile $(DELIVERABLE)
Expand Down
Loading

0 comments on commit 55f0991

Please sign in to comment.