# HG changeset patch # User Josef 'Jeff' Sipek # Date 1323832850 18000 # Node ID 535aec70323608f370fa414663dcfee7c44bed9b # Parent a2bf150177bd79b43eec0980d04cb6b1409d5e1d cp: define a FIXME macro that leaves a sclp message There are far too many fixmes in the code. Sadly, the compiler simply discards them. This usually isn't an issue until one accidentally hits a "weird" bug which just turns out to be an unhandled (but documented) case in another part of the code. Using a macro instead of a comment will let the compiler string-ify the text, and then at runtime use SCLP to print it out. This will immediatelly point at problem areas. So, keep an eye on SCLP from now on :) Signed-off-by: Josef 'Jeff' Sipek diff -r a2bf150177bd -r 535aec703236 cp/drivers/console.c --- a/cp/drivers/console.c Tue Dec 13 20:56:14 2011 -0500 +++ b/cp/drivers/console.c Tue Dec 13 22:20:50 2011 -0500 @@ -64,7 +64,7 @@ int i; for(;;) { - /* FIXME: this should be a sub-unless-zero */ + FIXME("this should be a sub-unless-zero"); if (atomic_read(&con->dev->attention)) do_issue_read(con, &ioop, ccws); @@ -121,7 +121,7 @@ if (con->dev->type != logo->devtype) continue; - /* FIXME: check the connection type */ + FIXME("check the connection type"); list_for_each_entry(rec, &logo->lines, list) con_printf(con, "%*.*s\n", CONFIG_LRECL, diff -r a2bf150177bd -r 535aec703236 cp/drivers/spooldev.c --- a/cp/drivers/spooldev.c Tue Dec 13 20:56:14 2011 -0500 +++ b/cp/drivers/spooldev.c Tue Dec 13 22:20:50 2011 -0500 @@ -173,7 +173,7 @@ if (st.f && (ccw.addr & 0x80000000)) goto prog_check; - /* FIXME */ + FIXME(""); if (ccw.flags & (CCW_FLAG_SKP | CCW_FLAG_PCI | CCW_FLAG_IDA | CCW_FLAG_S | CCW_FLAG_MIDA | CCW_FLAG_CD)) { con_printf(sys->con, "unsupported ccw flag "); diff -r a2bf150177bd -r 535aec703236 cp/drivers/vdevice.c --- a/cp/drivers/vdevice.c Tue Dec 13 20:56:14 2011 -0500 +++ b/cp/drivers/vdevice.c Tue Dec 13 22:20:50 2011 -0500 @@ -85,7 +85,7 @@ case VDEV_MDISK: vdev->type = 0x3390; vdev->model = 3; - // FIXME: hook it up to mdisk driver + FIXME("hook it up to mdisk driver"); break; case VDEV_LINK: case VDEV_INVAL: diff -r a2bf150177bd -r 535aec703236 cp/fs/bcache.c --- a/cp/fs/bcache.c Tue Dec 13 20:56:14 2011 -0500 +++ b/cp/fs/bcache.c Tue Dec 13 22:20:50 2011 -0500 @@ -90,11 +90,10 @@ if (IS_ERR(ptrs)) return ptrs; - /* add the pointer to the cache - * - * FIXME: since we read the whole block, we should probably - * add all the pointers to the cache - */ + /* add the pointer to the cache */ + + FIXME("since we read the whole block, we should probably " + "add all the pointers to the cache"); cur = __bcache_add(file, level, blk, ptrs[off]); if (IS_ERR(cur)) return cur; diff -r a2bf150177bd -r 535aec703236 cp/fs/edf.c --- a/cp/fs/edf.c Tue Dec 13 20:56:14 2011 -0500 +++ b/cp/fs/edf.c Tue Dec 13 22:20:50 2011 -0500 @@ -125,7 +125,7 @@ if (ret) goto out_free; - /* FIXME: init the ALLOCMAP */ + FIXME("init the ALLOCMAP"); free_pages(tmp, 0); return fs; diff -r a2bf150177bd -r 535aec703236 cp/guest/attach.c --- a/cp/guest/attach.c Tue Dec 13 20:56:14 2011 -0500 +++ b/cp/guest/attach.c Tue Dec 13 22:20:50 2011 -0500 @@ -11,7 +11,7 @@ static void guest_append_crw(struct virt_sys *sys, struct crw *crw) { - sclp_msg("FIXME: guest CRW was not queued"); + FIXME("guest CRW was not queued"); } int guest_attach(struct virt_sys *sys, u64 rdev, u64 vdev) diff -r a2bf150177bd -r 535aec703236 cp/guest/exception.c --- a/cp/guest/exception.c Tue Dec 13 20:56:14 2011 -0500 +++ b/cp/guest/exception.c Tue Dec 13 22:20:50 2011 -0500 @@ -11,6 +11,7 @@ void queue_prog_exception(struct virt_sys *sys, enum PROG_EXCEPTION type, u64 param) { + FIXME("supposed to inject a %d program exception", type); con_printf(sys->con, "FIXME: supposed to inject a %d program exception\n", type); sys->cpu->state = GUEST_STOPPED; } diff -r a2bf150177bd -r 535aec703236 cp/guest/init.c --- a/cp/guest/init.c Tue Dec 13 20:56:14 2011 -0500 +++ b/cp/guest/init.c Tue Dec 13 22:20:50 2011 -0500 @@ -82,7 +82,7 @@ struct virt_cpu *cpu = sys->cpu; if (sys->task) { - /* FIXME: kill the vcpu task */ + FIXME("kill the vcpu task"); } assert(list_empty(&cpu->int_io[0])); diff -r a2bf150177bd -r 535aec703236 cp/guest/instruction_priv.c --- a/cp/guest/instruction_priv.c Tue Dec 13 20:56:14 2011 -0500 +++ b/cp/guest/instruction_priv.c Tue Dec 13 22:20:50 2011 -0500 @@ -114,7 +114,8 @@ vdev->pmcw.x = gschib.pmcw.x; vdev->pmcw.s = gschib.pmcw.s; vdev->pmcw.mbi = gschib.pmcw.mbi; - /* FIXME: save measurement-block address */ + + FIXME("save measurement-block address"); out_cc0: cpu->sie_cb.gpsw.cc = 0; @@ -381,13 +382,13 @@ sc &= ~SC_STATUS; - // FIXME: N-condition + FIXME("N-condition"); vdev->scsw.fc = fc; vdev->scsw.ac = ac; vdev->scsw.sc = sc; - // FIXME: dequeue I/O INT + FIXME("dequeue I/O INT"); cc = 0; } else { cc = 1; diff -r a2bf150177bd -r 535aec703236 cp/guest/reset.c --- a/cp/guest/reset.c Tue Dec 13 20:56:14 2011 -0500 +++ b/cp/guest/reset.c Tue Dec 13 22:20:50 2011 -0500 @@ -76,9 +76,10 @@ if (flags & RESET_CPU) { if (flags & SET_ESA390) { - /* FIXME: set the arch mode to ESA/390 */ + FIXME("set the arch mode to ESA/390"); } + FIXME("clear interruptions (PROG, SVC, local EXT, MCHECK)"); /* * FIXME: clear interruptions: * - PROG @@ -97,15 +98,15 @@ cpu->sie_cb.prefix = 0; if (flags & RESET_CPU_TIMER) { - /* FIXME */ + FIXME(""); } if (flags & RESET_CLK_COMP) { - /* FIXME */ + FIXME(""); } if (flags & RESET_TOD_PROG_REG) { - /* FIXME */ + FIXME(""); } if (flags & RESET_CR) { @@ -115,7 +116,7 @@ } if (flags & RESET_BREAK_EV_ADDR) { - /* FIXME: initialize to 0x1 */ + FIXME("initialize to 0x1"); } if (flags & RESET_FPCR) @@ -153,6 +154,7 @@ } if (flags & RESET_PLO_LOCKS) { + FIXME("if RESET_PLO_LOCKS_PRESERVE is set, don't reset locks..."); /* * TODO: if RESET_PLO_LOCKS_PRESERVE is set, don't reset * locks held by powered on CPUS @@ -170,7 +172,7 @@ if (flags & RESET_IO) { for_each_vdev(sys, vdev) { - /* FIXME: wait for I/O to complete? */ + FIXME("wait for I/O to complete?"); mutex_lock(&vdev->lock); /* set to zero */ diff -r a2bf150177bd -r 535aec703236 cp/guest/run.c --- a/cp/guest/run.c Tue Dec 13 20:56:14 2011 -0500 +++ b/cp/guest/run.c Tue Dec 13 22:20:50 2011 -0500 @@ -84,10 +84,6 @@ return 0; } -/* - * FIXME: - * - issue any pending interruptions - */ void run_guest(struct virt_sys *sys) { struct psw *psw = &sys->cpu->sie_cb.gpsw; @@ -109,13 +105,8 @@ } go: - /* - * FIXME: need to ->icptcode = 0; - */ - - /* - * FIXME: load FPRs & FPCR - */ + FIXME("need to ->icptcode = 0;"); + FIXME("load FPRs & FPCR"); /* * IMPORTANT: We MUST keep a valid stack address in R15. This way, @@ -148,9 +139,7 @@ "memory" ); - /* - * FIXME: store FPRs & FPCR - */ + FIXME("store FPRs & FPCR"); handle_interception(sys); } diff -r a2bf150177bd -r 535aec703236 cp/include/nucleus.h --- a/cp/include/nucleus.h Tue Dec 13 20:56:14 2011 -0500 +++ b/cp/include/nucleus.h Tue Dec 13 22:20:50 2011 -0500 @@ -12,6 +12,7 @@ #include #include #include +#include #include extern volatile u64 ticks; @@ -45,6 +46,8 @@ BUG(); \ } while(0) +#define FIXME(fmt, ...) sclp_msg("FIXME @ " __FILE__ ":%d: " fmt, __LINE__, ##__VA_ARGS__) + #include /* diff -r a2bf150177bd -r 535aec703236 cp/mm/dat.c --- a/cp/mm/dat.c Tue Dec 13 20:56:14 2011 -0500 +++ b/cp/mm/dat.c Tue Dec 13 22:20:50 2011 -0500 @@ -50,7 +50,10 @@ goto walk_segment; } - BUG_ON(DAT_RX(virt)); // FIXME: we don't support storage >2GB + if (DAT_RX(virt)) { + FIXME("we don't support storage >2GB"); + BUG(); + } if (region->origin == 0xfffffffffffffUL) { /* @@ -62,10 +65,10 @@ region->origin = ADDR_TO_RTE_ORIGIN((u64) ptr); - region->tf = 0; /* FIXME: is this right? */ + region->tf = 0; region->i = 0; region->tt = DAT_RTE_TT_RTT; - region->tl = 3; /* FIXME: is this right? */ + region->tl = 3; region->__reserved0 = 0; region->__reserved1 = 0; } diff -r a2bf150177bd -r 535aec703236 cp/mm/slab.c --- a/cp/mm/slab.c Tue Dec 13 20:56:14 2011 -0500 +++ b/cp/mm/slab.c Tue Dec 13 22:20:50 2011 -0500 @@ -201,13 +201,11 @@ */ slab = __alloc_slab_obj_newpage(passed_slab, type); - if (IS_ERR(slab)) - /* - * FIXME: if we tried to get a ZONE_NORMAL and failed, - * shouldn't we retry with ZONE_LOW? - */ + if (IS_ERR(slab)) { + FIXME("if we tried to get a ZONE_NORMAL and failed, " + "shouldn't we retry with ZONE_LOW?"); goto out; - + } alloc: /* found a page */ @@ -252,7 +250,7 @@ *bits &= ~(1 << (7 - (objidx % 8))); if (--slab->used) { - /* FIXME: free the page? */ + FIXME("free the page?"); } spin_unlock_intrestore(&slab->first->lock, int_mask); diff -r a2bf150177bd -r 535aec703236 cp/nucleus/config.y --- a/cp/nucleus/config.y Tue Dec 13 20:56:14 2011 -0500 +++ b/cp/nucleus/config.y Tue Dec 13 22:20:50 2011 -0500 @@ -60,7 +60,7 @@ assert(devtype <= 0xffff); assert(devnum <= 0xffff); - /* FIXME: save the pair */ + FIXME("save the pair"); } static void __oper_con(u64 devnum) diff -r a2bf150177bd -r 535aec703236 cp/nucleus/direct.c --- a/cp/nucleus/direct.c Tue Dec 13 20:56:14 2011 -0500 +++ b/cp/nucleus/direct.c Tue Dec 13 22:20:50 2011 -0500 @@ -99,6 +99,6 @@ user->storage_size = prop->storage; user->auth = auth; - // FIXME: locking? + FIXME("locking?"); list_add_tail(&user->list, &directory); } diff -r a2bf150177bd -r 535aec703236 cp/nucleus/direct.y --- a/cp/nucleus/direct.y Tue Dec 13 20:56:14 2011 -0500 +++ b/cp/nucleus/direct.y Tue Dec 13 22:20:50 2011 -0500 @@ -91,7 +91,7 @@ static int __auth_int(u64 in) { - // FIXME + FIXME(""); return AUTH_G; } diff -r a2bf150177bd -r 535aec703236 cp/nucleus/io.c --- a/cp/nucleus/io.c Tue Dec 13 20:56:14 2011 -0500 +++ b/cp/nucleus/io.c Tue Dec 13 22:20:50 2011 -0500 @@ -20,7 +20,7 @@ */ static int __verify_io_op(struct io_op *ioop) { - // FIXME: check everything that makes sense to check + FIXME("check everything that makes sense to check"); return 0; } @@ -124,8 +124,10 @@ ioop->err = -EAGAIN; /* Unit check? */ - if (irb->scsw.dev_status & 0x02) - ioop->err = -EUCHECK; /* FIXME: we should bail */ + if (irb->scsw.dev_status & 0x02) { + FIXME("we should bail"); + ioop->err = -EUCHECK; + } /* Device End is set, we're done */ if (irb->scsw.dev_status & 0x04) diff -r a2bf150177bd -r 535aec703236 cp/shell/cmd_query.c --- a/cp/shell/cmd_query.c Tue Dec 13 20:56:14 2011 -0500 +++ b/cp/shell/cmd_query.c Tue Dec 13 22:20:50 2011 -0500 @@ -47,7 +47,7 @@ case VDEV_CONS: con_printf(con, "CONS %04X 3215 ON %s %04X %s SCH = %05X\n", vdev->pmcw.dev_num, - type2name(con->dev->type), // FIXME? + type2name(con->dev->type), con->dev->ccuu, sys->print_ts ? "TS" : "NOTS", vdev->sch); @@ -67,6 +67,7 @@ vdev->sch); break; case VDEV_MDISK: + FIXME("cyl count & rdev"); con_printf(con, "DASD %04X 3390 %6d CYL ON DASD %04X SCH = %05X\n", vdev->pmcw.dev_num, 0, /* FIXME: cyl count */ @@ -74,6 +75,7 @@ vdev->sch); break; case VDEV_LINK: + FIXME("userid & vdev #"); con_printf(con, "LINK %04X TO %s %04X SCH = %05X\n", vdev->pmcw.dev_num, "????", /* FIXME: userid */ diff -r a2bf150177bd -r 535aec703236 cp/shell/init.c --- a/cp/shell/init.c Tue Dec 13 20:56:14 2011 -0500 +++ b/cp/shell/init.c Tue Dec 13 22:20:50 2011 -0500 @@ -31,7 +31,7 @@ u8 cmd[128]; int ret; - // FIXME: read a line from the + // FIXME: read a line from the console // ret = con_read(sys->con, cmd, 128); ret = -1;