From 04c3a6f66e3b895a087124ed415f01e23e21ee10 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sun, 27 Mar 2016 20:57:01 +0200 Subject: zynq: introduce SG_FAULT to prevent access to AXI segment while PL is not ready access to the axi segment hangs the machine when the fpga is not programmed yet. to prevent access, we introduce a new SG_FAULT flag, that when set on the Segment.type or Physseg.attr, causes the fault handler to immidiately return with an error (as if the segment would not be mapped). during programming, we temporarily set the SG_FAULT flag on the axi physseg, flush all processes tlb's that have the segment mapped and when programming is done, we clear the flag again. --- sys/src/9/pc/devlml.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/src/9/pc') diff --git a/sys/src/9/pc/devlml.c b/sys/src/9/pc/devlml.c index df96bbda2..8aba39836 100644 --- a/sys/src/9/pc/devlml.c +++ b/sys/src/9/pc/devlml.c @@ -179,7 +179,7 @@ lmlreset(void) kstrdup(&segbuf.name, name); segbuf.pa = PADDR(lml->codedata); segbuf.size = Codedatasize; - if(addphysseg(&segbuf) == -1){ + if(addphysseg(&segbuf) == nil){ print("lml: physsegment: %s\n", name); return; } @@ -190,7 +190,7 @@ lmlreset(void) kstrdup(&segbuf.name, name); segbuf.pa = (ulong)regpa; segbuf.size = pcidev->mem[0].size; - if(addphysseg(&segbuf) == -1){ + if(addphysseg(&segbuf) == nil){ print("lml: physsegment: %s\n", name); return; } -- cgit v1.2.3