Commit Graph

160722 Commits

Author SHA1 Message Date
pooka
ae519de8f0 Set union vnode size when creating a vnode.
fixes kern/36679 by Geoff C. Wing
2007-07-23 08:21:50 +00:00
kiyohara
83f023eb3d Remove printf for debugging. 2007-07-23 03:45:27 +00:00
macallan
f6e06b3004 sprinkle (vaddr_t) to deal with sizeof(paddr_t) != sizeof(void *)
Now the loader should build again.
2007-07-23 00:45:52 +00:00
mjf
a1e23633a9 Remove newline from format string of aprint_normal.
Thanks to pooka@ for pointing it out.
2007-07-22 23:45:50 +00:00
pooka
4aa4a0d0ae regen: assert that vnode creating operations set the size 2007-07-22 21:27:49 +00:00
pooka
f5ba107ccd Introduce WILLMAKE for vnode operations which create a new vnode.
Insert a KASSERT along the return path of such operations to check
that the operation set the vnode size.
2007-07-22 21:26:53 +00:00
rumble
17b8c7717a Add missing RCSID. 2007-07-22 21:12:27 +00:00
he
e7a46bb8e3 When _KERNEL is defined, we have now grown a dependency on
<sys/proc.h>, since one of the inline functions now refer to curlwp.
Fix this by including <sys/proc.h> when _KERNEL is defined.
2007-07-22 21:07:47 +00:00
he
ef2c9ff103 Explicitly include <sys/proc.h> for tsleep() prototype. 2007-07-22 20:39:22 +00:00
he
41b06f79ca Explicitly include <sys/proc.h> for tsleep() declaration. 2007-07-22 20:36:13 +00:00
pooka
05ce20f4a0 Retire uvn_attach() - it abuses VXLOCK and its functionality,
setting vnode sizes, is handled elsewhere: file system vnode creation
or spec_open() for regular files or block special files, respectively.

Add a call to VOP_MMAP() to the pagedvn exec path, since the vnode
is being memory mapped.

reviewed by tech-kern & wrstuden
2007-07-22 19:16:04 +00:00
pooka
8565af3eda use NULL, not 0, to pass a pointer 2007-07-22 18:59:00 +00:00
xtraeme
f2ddd114e5 Update to catch some problems that I just fixed in the framework. The
following test cases were fixed if a driver tries to register a driver
with sysmon_envsys_register() and the following items appear:

- Sensor with empty description.
- Sensor with state that doesn't match any of ENVSYS_SFOO.
- Sensor with units type that doesn't match any of ENVSYS_FOO.
2007-07-22 18:24:48 +00:00
pooka
9a0aaa5422 Keep track of the maximum size we have supplied the file server (or
it has supplied us).  If we fault pages which are at offset >= server
size, but less than the in-kernel vnode size, inform the file server
of the latest developments in file size before issueing the fault.
The avoids confusion with files which are not written start to finish.

fixes kern/36429 by yamt
2007-07-22 18:22:49 +00:00
xtraeme
666d15456c Fix the last point reported by yamt in PR kern/36673:
- There must be three mandatory objects in a sensor to be valid and be
  enabled on its dictionary: units, state and desc. If any of these
  objects fails for some reason, its dictionary won't created in the
  array and sensor will be marked with ENVSYS_FNOTVALID in edata->flags.

  That means there won't never be a partial dictionary.

- Mark all invalid sensors and sensors with duplicate description with
  ENVSYS_FNOTVALID and remove ENVSYS_FDUPDESC. The former is the generic
  way to say that a sensor does not obey the rules and must be not
  created.

- sysmon_envsys_createplist: if the array does not contain any object,
  release the array and return the error.

And with all that stuff I can go to holidays and be happy.
2007-07-22 18:17:02 +00:00
christos
8c26d38e7b WARNS=4, pass lint 2007-07-22 17:03:13 +00:00
pooka
0921857772 Don't allow getcwd() on procfs vnodes and provide "/" as the path
instead of the result from getcwd().  The works around locking
panics caused by namei calling VOP_READLINK while holding on to a
directory lock and getcwd() trying to acquire that lock.  The real
fix would be to get rid of getcwd() calls within VOPs (not locking
safe), but that's not a viable option in the netbsd-4 timeframe.

Suggestion for workaround from David Holland.
2007-07-22 13:37:13 +00:00
pooka
27c5f7cba3 Match code with comment (can't really remember doing it often that
way around .. ) and initialize storage to zero when extending a file.
2007-07-22 13:19:38 +00:00
pooka
a53b2cab5e missed one place to set dirent namelen - unmiss it 2007-07-22 12:26:58 +00:00
ad
2a051b63b4 +#include <sys/proc.h> 2007-07-22 08:50:26 +00:00
lukem
0def0e3a66 Rename HAVE_SOCKADDR_SA_LEN to HAVE_STRUCT_SOCKADDR_SA_LEN.
Use defined(HAVE_foo) instead of just testing HAVE_foo.
2007-07-22 05:06:45 +00:00
lukem
6470c9506d Replace HAVE_SOCKADDR_SA_LEN with defined(HAVE_STRUCT_SOCKADDR_SA_LEN) 2007-07-22 05:02:50 +00:00
christos
407114c830 make this compile again 2007-07-22 03:40:59 +00:00
tsutsui
d99606f782 More fixes for Jensen, reported and tested by Christoph Franzen
in PR port-alpha/36628:
- make jensenio_eisa_maxslots() return 8 (instead of 16) since
  EISA config for slot 8-15 on jensen could return invalid values
- pass eisa_chipset_tag_t to eisa_init() and check eisa_maxslots()
  on probing EISA config space
- pass M_ZERO to malloc(9) and make sure malloc(9) doesn't fail
- fix typo in a debug printf, add more debug printfs, and
  use #ifdef EISA_DEBUG to enable them
- cast uint8_t value to uint32_t before shift more than 8 bits
- check buffer region on reading compressed data from EISA config space
2007-07-22 02:14:39 +00:00
xtraeme
bd0460e614 <sys/proc.h> is needed to get nprocs... fixes the build on amd64. 2007-07-21 23:39:46 +00:00
xtraeme
5623c9a1de Convert sysmon_taskqueue to use mutex(9) and condvar(9) and initialize
them in init_main.c via sysmon_task_queue_preinit().

Reviewed and ok by ad@.
2007-07-21 23:15:16 +00:00
pooka
a97de7b959 nuke homegrown getcwd_common() decl 2007-07-21 22:47:36 +00:00
rumble
23622f237e Ensure that the special host token '*SMBSERVER' is not automatically
hyphenated, as this can lead to some confusion (e.g.: '*SMB-SERVER' isn't
valid).

(Thanks Wiz!)
2007-07-21 22:41:09 +00:00
xtraeme
e25c1ce382 - Add more sensors after the two that have duplicate descriptions, to verify
they work fine.
- Remove the workaround for sensor with index 0, it's fixed now.
2007-07-21 22:30:21 +00:00
ad
e7e35c1d1d Temporarily work around an assertion from mutex_enter. 2007-07-21 22:14:42 +00:00
xtraeme
38371ef4fb - Do not touch sme_nsensors when sensors with duplicate description are
found, rather maintain a global counter for all sensors that are unique,
  and use this global to get the correct index in the array.
- Use prop_array_set() rather than prop_array_add() for adding dictionaries
  into our global array. Thanks to yamt@.
- Overwrite the sensor index in the first sensor of a device, to avoid
  a problem with LKMs where the first sensor gets the index of all edata
  structures allocated in kernel.
- Add missing proto for sme_register_sensorname().

All them fix another part of yamt@'s PR.
2007-07-21 22:11:02 +00:00
ad
9a40651fc7 VM_MAP_BUSY, VM_MAP_WANTLOCK are no more. 2007-07-21 20:54:12 +00:00
ad
6e948e8304 Fix DEBUG build. 2007-07-21 20:52:59 +00:00
ad
75c47bdc49 NetBSD 4.99.25 - struct disk changed, . 2007-07-21 19:54:03 +00:00
ad
b5a9ff06f1 Replace some uses of lockmgr(). 2007-07-21 19:51:47 +00:00
matt
5aaa0be03a Don't call proc_trampoline_mp when starting a lwp. (XXX why did we do this
before?)
2007-07-21 19:26:14 +00:00
ad
54d8f5b6c1 +#include <sys/conf.h> 2007-07-21 19:23:03 +00:00
ad
4688843d2b Merge unobtrusive locking changes from the vmlocking branch. 2007-07-21 19:21:53 +00:00
ad
253ada188c Move declaration of seltrue_kqfilter() to conf.h, where it's needed. 2007-07-21 19:20:39 +00:00
matt
ae0a442af3 Make MP kernels build again. Heck, if I'm lucky, maybe these changes will
even make one boot.
2007-07-21 19:12:15 +00:00
ad
744a92f0f8 Don't depend on uvm_extern.h pulling in proc.h. 2007-07-21 19:06:20 +00:00
xtraeme
82313816f8 Use the mutex that belongs to the specific task and do not mix them
blindly.

	- sme_list_mtx to access to the linked lists sme_list/sme_names_list.
	- sme_mtx to access to the data in the sysmon envsys device.
2007-07-21 17:18:00 +00:00
xtraeme
2ae3d17915 sme_update_dictionary: if there's a sensor with duplicate description,
there's no need to decrease 'i' again, just sme->sme_nsensors is enough.

Reported by yamt@.
2007-07-21 16:16:59 +00:00
xtraeme
ed4bc532ce Simplify previous. 2007-07-21 15:45:12 +00:00
dsieger
206d59d40f Fix a glitch in previous commit:
s/mi_switch 9/mi_switch.9/

Reported by Paul Goyette.
2007-07-21 15:35:46 +00:00
xtraeme
bbb2e25d8f Skip sensor with duplicate descriptions in the COMPAT_40 case, verified
with envstat(8) from netbsd-4 and sys/lkm/misc/envsys2.

Fixes another part of kern/36673 by yamt@.
2007-07-21 15:30:04 +00:00
xtraeme
3fbf42ac66 - Add sme_events_destroy() to stop/destroy the callout and workqueue if
there are no more events.
- Add sme_event_unregister_all() to remove all events associated with
  a device and use it in sysmon_envsys_unregister() to fix a "use-after-free".
- Check return error of sme_sensor_upfoo() in sme_make_dictionary() and
  return it rather than 0 all the time.
- Add more KASSERTS.
2007-07-21 15:16:58 +00:00
tsutsui
78c4167012 - kern_kern_microtime.c is gone, so replace references of it
with new kern/kern_cctr.c in TODO comments
- also replace struct cc_microtime_state member in struct cpu_info
  with struct cctr_state defined in <sys/cctr.h>, which is unused yet
  in this port
2007-07-21 12:15:05 +00:00
kiyohara
2fd3ecbe55 We wait for the clearness of the NFORCE_SMB_PROTOCOL as transfer completion.
And, the maximum is assumed to be 10msec.  I think that the thing for which
it waits any further is dangerous for the system.
2007-07-21 12:14:27 +00:00
xtraeme
b2537bf157 Some fixes for kern/36673 by yamt@:
- sme_register_sensorname: there's no need to handle empty list case.
- 'obj' argument in sme_sensor_upstring and similar functions is useless:
  removed the obj argument from the functions, it's handled in the function
  itself now.
- check for more errors in sme_make_dictionary() and
  sysmon_envsys_createplist().
2007-07-21 12:11:27 +00:00