@@ -113,6 +113,34 @@ static void test_1m_clear(void)
report_prefix_pop();
}
+static void test_low_addr_prot(void)
+{
+ union pfmf_r1 r1 = {
+ .reg.cf = 1,
+ .reg.fsc = PFMF_FSC_4K
+ };
+
+ report_prefix_push("low-address protection");
+
+ report_prefix_push("0x1000");
+ expect_pgm_int();
+ low_prot_enable();
+ pfmf(r1.val, (void *)0x1000);
+ low_prot_disable();
+ check_pgm_int_code(PGM_INT_CODE_PROTECTION);
+ report_prefix_pop();
+
+ report_prefix_push("0x0");
+ expect_pgm_int();
+ low_prot_enable();
+ pfmf(r1.val, 0);
+ low_prot_disable();
+ check_pgm_int_code(PGM_INT_CODE_PROTECTION);
+ report_prefix_pop();
+
+ report_prefix_pop();
+}
+
int main(void)
{
bool has_edat = test_facility(8);
@@ -124,6 +152,7 @@ int main(void)
}
test_priv();
+ test_low_addr_prot();
/* Force the buffer pages in */
memset(pagebuf, 0, PAGE_SIZE * 256);